Re: [PATCH 4/6] platform/apple: Add new Apple Mac SMC driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 1, 2022, at 21:26, Andy Shevchenko wrote:
> On Thu, Sep 1, 2022 at 5:18 PM Russell King <rmk+kernel@xxxxxxxxxxxxxxx> wrote:
[...]
>
> ...
>
>> +       if (size <= 4)
>> +               memcpy(buf, &rdata, size);
>> +       else
>> +               memcpy_fromio(buf, smc->shmem.iomem, size);
>
> This is unclear why plain memcpy() for the small size and what are the
> side effects of the memory. Maybe you wanted memremap() instead of
> ioremap() to begin with?

rdata is used for small buffers, comes directly as part of a message sent on the
underlying hardware FIFO and is on the stack (and thus mapped as as Normal memory)
while smc->shmem.iomem has to be Device-nGnRnE. Mapping it with any other attributes
will generate SErrors for each access.




Sven



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux