[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aDQxGAxAMRrYHk2-@928cf0ec7572>
Date: Mon, 26 May 2025 09:15:04 +0000
From: Subbaraya Sundeep <sbhatta@...vell.com>
To: Andrew Lunn <andrew@...n.ch>
CC: Sai Krishna <saikrishnag@...vell.com>, <davem@...emloft.net>,
<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<sgoutham@...vell.com>, <gakula@...vell.com>, <lcherian@...vell.com>,
<jerinj@...vell.com>, <hkelam@...vell.com>, <andrew+netdev@...n.ch>,
<bbhushan2@...vell.com>, <nathan@...nel.org>,
<ndesaulniers@...gle.com>, <morbo@...gle.com>,
<justinstitt@...gle.com>, <llvm@...ts.linux.dev>, <horms@...nel.org>
Subject: Re: [net-next PATCH v3 2/2] octeontx2-af: fix compiler warnings
flagged by Sparse
On 2025-03-11 at 21:32:12, Andrew Lunn (andrew@...n.ch) wrote:
> On Tue, Mar 11, 2025 at 11:56:31PM +0530, Sai Krishna wrote:
> > Sparse flagged a number of warnings while typecasting iomem
> > type to required data type.
>
> > For example, fwdata is just a shared memory data structure used
> > between firmware and kernel, thus remapping and typecasting
> > to required data type may not cause issue.
>
> This is generally wrong. __iomem is there for a reason. If you are
> removing it, it suggests what you do next with the pointer is wrong.
>
> Andrew
Hi Andrew,
Sorry for delay in response. To provide some information, firmware sets
aside some DDR memory region for firmware and kernel communication.
Kernel ioremaps that space and typecasts to fwdata structure and uses it.
Agree that ioremap is for io device's csr space but since we know that it
is not really a register space but DDR we are ioremapping, typecasting
and using it. We assumed __force is there for these kind of exceptions.
Please suggest how to proceed with this. memcpy_fromio can done for fwdata
but this fwdata is NOT read only once structure, firmware keeps updating it in
cases like link speed changes and ethtool eeprom info changes. So everytime
we have to ioremap, memcpy_fromio and iounmap which we want to avoid.
Thanks.
Sundeep
>
> ---
> pw-bot: cr
Powered by blists - more mailing lists