Linux-ARM-Kernel Archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Diogo Ivo <diogo.ivo@siemens.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, danishanwar@ti.com, rogerq@kernel.org,
	vigneshr@ti.com, arnd@arndb.de, wsa+renesas@sang-engineering.com,
	vladimir.oltean@nxp.com, andrew@lunn.ch,
	dan.carpenter@linaro.org, netdev@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, jan.kiszka@siemens.com
Subject: Re: [PATCH net-next v5 10/10] net: ti: icssg-prueth: Add ICSSG Ethernet driver for AM65x SR1.0 platforms
Date: Wed, 27 Mar 2024 15:03:10 +0000	[thread overview]
Message-ID: <20240327150310.GM403975@kernel.org> (raw)
In-Reply-To: <20240326110709.26165-11-diogo.ivo@siemens.com>

On Tue, Mar 26, 2024 at 11:07:00AM +0000, Diogo Ivo wrote:
> Add the PRUeth driver for the ICSSG subsystem found in AM65x SR1.0 devices.
> The main differences that set SR1.0 and SR2.0 apart are the missing TXPRU
> core in SR1.0, two extra DMA channels for management purposes and different
> firmware that needs to be configured accordingly.
> 
> Based on the work of Roger Quadros, Vignesh Raghavendra and
> Grygorii Strashko in TI's 5.10 SDK [1].
> 
> [1]: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/?h=ti-linux-5.10.y
> 
> Co-developed-by: Jan Kiszka <jan.kiszka@siemens.com>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> Signed-off-by: Diogo Ivo <diogo.ivo@siemens.com>
> Reviewed-by: MD Danish Anwar <danishanwar@ti.com>

...

> diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c b/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c

...

> +static void prueth_tx_ts_sr1(struct prueth_emac *emac,
> +			     struct emac_tx_ts_response_sr1 *tsr)
> +{
> +	struct skb_shared_hwtstamps ssh;
> +	u32 hi_ts, lo_ts, cookie;
> +	struct sk_buff *skb;
> +	u64 ns;
> +
> +	hi_ts = le32_to_cpu(tsr->hi_ts);
> +	lo_ts = le32_to_cpu(tsr->lo_ts);
> +
> +	ns = (u64)hi_ts << 32 | lo_ts;
> +
> +	cookie = le32_to_cpu(tsr->cookie);

Hi,

le32_to_cpu() expects a __le32 argument.
But the type of tsr->hi_ts, tsr->lo_ts and tsr->cookie is u32.
This seems to indicate that host byte order values
are being used as little endian values, which does not seem correct.

Flagged by Sparse.

> +	if (cookie >= PRUETH_MAX_TX_TS_REQUESTS) {
> +		netdev_dbg(emac->ndev, "Invalid TX TS cookie 0x%x\n",
> +			   cookie);
> +		return;
> +	}
> +
> +	skb = emac->tx_ts_skb[cookie];
> +	emac->tx_ts_skb[cookie] = NULL;	/* free slot */
> +
> +	memset(&ssh, 0, sizeof(ssh));
> +	ssh.hwtstamp = ns_to_ktime(ns);
> +
> +	skb_tstamp_tx(skb, &ssh);
> +	dev_consume_skb_any(skb);
> +}

...

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-03-27 15:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26 11:06 [PATCH net-next v5 00/10] Support ICSSG-based Ethernet on AM65x SR1.0 devices Diogo Ivo
2024-03-26 11:06 ` [PATCH net-next v5 01/10] dt-bindings: net: Add support for AM65x SR1.0 in ICSSG Diogo Ivo
2024-03-26 11:06 ` [PATCH net-next v5 03/10] net: ti: icssg-prueth: Move common functions into a separate file Diogo Ivo
2024-03-26 11:06 ` [PATCH net-next v5 04/10] net: ti: icssg-prueth: Add SR1.0-specific configuration bits Diogo Ivo
2024-03-26 11:06 ` [PATCH net-next v5 05/10] net: ti: icssg-prueth: Add SR1.0-specific description bits Diogo Ivo
2024-03-26 11:06 ` [PATCH net-next v5 06/10] net: ti: icssg-prueth: Adjust IPG configuration for SR1.0 Diogo Ivo
2024-03-26 11:06 ` [PATCH net-next v5 07/10] net: ti: icssg-prueth: Adjust the number of TX channels " Diogo Ivo
2024-03-26 11:06 ` [PATCH net-next v5 08/10] net: ti: icssg-prueth: Add functions to configure SR1.0 packet classifier Diogo Ivo
2024-03-26 11:06 ` [PATCH net-next v5 09/10] net: ti: icssg-prueth: Modify common functions for SR1.0 Diogo Ivo
2024-03-26 11:07 ` [PATCH net-next v5 10/10] net: ti: icssg-prueth: Add ICSSG Ethernet driver for AM65x SR1.0 platforms Diogo Ivo
2024-03-27 15:03   ` Simon Horman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-03-20 14:42 [PATCH net-next v5 00/10] Support ICSSG-based Ethernet on AM65x SR1.0 devices Diogo Ivo
2024-03-20 14:42 ` [PATCH net-next v5 10/10] net: ti: icssg-prueth: Add ICSSG Ethernet driver for AM65x SR1.0 platforms Diogo Ivo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240327150310.GM403975@kernel.org \
    --to=horms@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=arnd@arndb.de \
    --cc=dan.carpenter@linaro.org \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=diogo.ivo@siemens.com \
    --cc=edumazet@google.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rogerq@kernel.org \
    --cc=vigneshr@ti.com \
    --cc=vladimir.oltean@nxp.com \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).