mbox series

[GIT,PULL] amlogic Drivers updates for v6.2

Message ID 7d1ca7f4-b3ae-46df-5b9a-7cba8ac3e512@linaro.org (mailing list archive)
State New, archived
Headers show
Series [GIT,PULL] amlogic Drivers updates for v6.2 | expand

Pull-request

https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git tags/amlogic-drivers-for-v6.2

Message

Neil Armstrong Nov. 22, 2022, 3:24 p.m. UTC
Hi,

Here's an Amlogic Drivers change for v6.3, fixes memcpy vs iomem type warnings in meson_sm driver.

Neil

The following changes since commit 9abf2313adc1ca1b6180c508c25f22f9395cc780:

   Linux 6.1-rc1 (2022-10-16 15:36:24 -0700)

are available in the Git repository at:

   https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git tags/amlogic-drivers-for-v6.2

for you to fetch changes up to 7dc69c7d073e6004a281db8f7f15cf6ebf702ea0:

   firmware: meson_sm: Fix memcpy vs iomem type warnings (2022-10-17 17:19:04 +0200)

----------------------------------------------------------------
Amlogic Drivers changes for v6.2:
- Fix memcpy vs iomem type warnings in meson_sm driver

----------------------------------------------------------------
Kees Cook (1):
       firmware: meson_sm: Fix memcpy vs iomem type warnings

  drivers/firmware/meson/meson_sm.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Arnd Bergmann Nov. 22, 2022, 9:48 p.m. UTC | #1
On Tue, Nov 22, 2022, at 16:24, Neil Armstrong wrote:
>
> for you to fetch changes up to 7dc69c7d073e6004a281db8f7f15cf6ebf702ea0:
>
>    firmware: meson_sm: Fix memcpy vs iomem type warnings (2022-10-17 
> 17:19:04 +0200)
>
> ----------------------------------------------------------------
> Amlogic Drivers changes for v6.2:
> - Fix memcpy vs iomem type warnings in meson_sm driver
>

It looks like a trivial fix, but I think it's actually wrong:
The real problem appears to be the use of the ioremap_cache()
function in meson_sm_map_shmem(), which returns an __iomem
token that is mapped cacheable on architectures that support
this function, but behaves like normal ioremap on others.

This is probably not what you want here, instead this should
be converted to memremap(), with the __iomem annotation dropped.
In the long run, we should try to kill off ioremap_cache
entirely, and not introduce new ones.

     Arnd
Neil Armstrong Nov. 23, 2022, 10:51 a.m. UTC | #2
On 22/11/2022 22:48, Arnd Bergmann wrote:
> On Tue, Nov 22, 2022, at 16:24, Neil Armstrong wrote:
>>
>> for you to fetch changes up to 7dc69c7d073e6004a281db8f7f15cf6ebf702ea0:
>>
>>     firmware: meson_sm: Fix memcpy vs iomem type warnings (2022-10-17
>> 17:19:04 +0200)
>>
>> ----------------------------------------------------------------
>> Amlogic Drivers changes for v6.2:
>> - Fix memcpy vs iomem type warnings in meson_sm driver
>>
> 
> It looks like a trivial fix, but I think it's actually wrong:
> The real problem appears to be the use of the ioremap_cache()
> function in meson_sm_map_shmem(), which returns an __iomem
> token that is mapped cacheable on architectures that support
> this function, but behaves like normal ioremap on others.
> 
> This is probably not what you want here, instead this should
> be converted to memremap(), with the __iomem annotation dropped.
> In the long run, we should try to kill off ioremap_cache
> entirely, and not introduce new ones.

OK will have a look into that,

Thanks,
Neil


> 
>       Arnd