From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3C3D2C54E67 for ; Wed, 27 Mar 2024 15:03:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QCojYCWJMiJ6ThHWLDoRGcecfHD6eJcubJDAn2duemU=; b=nWSPqbeLx+OWEa ccXbtrvLjQq7873iRBHGBS9+o+REZndJB+XhCnNYSDFf6JjIFYZ0PqA0SvLwx1w/TvP5jhEt8go7g hWPBDkTv7uJ7mJsByC9Iwan/EakBseNqZ+VYMx79pFacMr6LxyfCcdIAqCwNPFiBUpLbI10UbUTDg rsYwAAsD47goXkU1PC5sVIdne4sMBt7F0znxGG2UMw4lpDhA/Uqv2RxKXI80szFzrpibnTbWJ2Mkp /Uf3KM17RCx3JABtpIN+MxhDk41Ly7xVKnZ1bhIi7nvPBtMvngSWddlAsk3NNU6z1dAoEIM/OUquk hS6LJdlvcknV2ghWyjHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpUoC-00000009fII-2V4p; Wed, 27 Mar 2024 15:03:20 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpUo9-00000009fGX-0u7P for linux-arm-kernel@lists.infradead.org; Wed, 27 Mar 2024 15:03:19 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 8AD51615A2; Wed, 27 Mar 2024 15:03:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A3FAC433C7; Wed, 27 Mar 2024 15:03:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711551796; bh=CGIqnkjueQUIrMfaOnXLPuPIQPCHiV113pH5rQd5Vvg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KKpmAb2SrE9Jtzyp+KsTgTSfv6P9gxzpxrVuV2oOr+mmS6lzpLF35BMYGWs0eKqSE VYgu7W/67+O9KPB/bOl+pCNTMhQSsYibuDRN2KVl01RGzf88k537p+O8eENH6iPWVc 1WwyfznkocRmaaEWpPepxUpcs0B7XHvUnj7R12T+z4L3n7bwxFfv6/aaUcvKfmacmb EUrKN1GJAD0KNlTMNCpDZJy+bXJCPW6hiEQYGe057TpzAcCIAu5Oew7Ml4ecVINGgr yGiPYLKilPY1mov+rwGcGVpF3GtEeqN94VuK00wyJuiZSQUt23130MfAk2A89hwCy5 zF5W4mwt7HKTg== Date: Wed, 27 Mar 2024 15:03:10 +0000 From: Simon Horman To: Diogo Ivo 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 Message-ID: <20240327150310.GM403975@kernel.org> References: <20240326110709.26165-1-diogo.ivo@siemens.com> <20240326110709.26165-11-diogo.ivo@siemens.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240326110709.26165-11-diogo.ivo@siemens.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240327_080317_367316_B34519ED X-CRM114-Status: GOOD ( 16.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > Signed-off-by: Jan Kiszka > Signed-off-by: Diogo Ivo > Reviewed-by: MD Danish Anwar ... > 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