From: Subbaraya Sundeep <sbhatta@marvell.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Sai Krishna <saikrishnag@marvell.com>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<sgoutham@marvell.com>, <gakula@marvell.com>,
<lcherian@marvell.com>, <jerinj@marvell.com>,
<hkelam@marvell.com>, <andrew+netdev@lunn.ch>,
<bbhushan2@marvell.com>, <nathan@kernel.org>,
<ndesaulniers@google.com>, <morbo@google.com>,
<justinstitt@google.com>, <llvm@lists.linux.dev>,
<horms@kernel.org>
Subject: Re: [net-next PATCH v3 2/2] octeontx2-af: fix compiler warnings flagged by Sparse
Date: Mon, 26 May 2025 09:15:04 +0000 [thread overview]
Message-ID: <aDQxGAxAMRrYHk2-@928cf0ec7572> (raw)
In-Reply-To: <3bc07f4f-73b4-4d34-98cb-79e84d9f1493@lunn.ch>
On 2025-03-11 at 21:32:12, Andrew Lunn (andrew@lunn.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
prev parent reply other threads:[~2025-05-26 9:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 18:26 [net-next PATCH v3 0/2] octeontx2-af: fix build warnings flagged Sai Krishna
2025-03-11 18:26 ` [net-next PATCH v3 1/2] octeontx2-af: correct __iomem annotations flagged by Sparse Sai Krishna
2025-03-11 21:22 ` Andrew Lunn
2025-04-14 16:38 ` Sai Krishna Gajula
2025-04-14 17:17 ` Andrew Lunn
2025-03-11 18:26 ` [net-next PATCH v3 2/2] octeontx2-af: fix compiler warnings " Sai Krishna
2025-03-11 21:32 ` Andrew Lunn
2025-05-26 9:15 ` Subbaraya Sundeep [this message]
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=aDQxGAxAMRrYHk2-@928cf0ec7572 \
--to=sbhatta@marvell.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=bbhushan2@marvell.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=hkelam@marvell.com \
--cc=horms@kernel.org \
--cc=jerinj@marvell.com \
--cc=justinstitt@google.com \
--cc=kuba@kernel.org \
--cc=lcherian@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saikrishnag@marvell.com \
--cc=sgoutham@marvell.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