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