<mani_s>
arnd, is the {get/put}_unaligned macros supposed to be working fine on unaligned device memory on ARM64?
<mani_s>
I thought it would but this macro boils down to ldr that generates alignment fault
<mani_s>
ldrx3, [x1, #20]!
<mani_s>
So x1 has the address of the packed struct and 20 is the offset of the u64 field that is not 8byte aligned
<arnd>
mani_s: for device memory, you have to use readb()/writeb()
<mani_s>
arnd, okay, so memcpy_{from/to}io should be fine?
<arnd>
get_unaligned()/put_unaligned() is only meaningful on normal memory, where it will use whatever the architecture allows, e.g. ldr on arm/arm64 but not ldrd on arm
<arnd>
memcpy_fromio works fine, that should fall back to byte accesses where necessary, but may use larger alignment if it can
<arnd>
not sure if the arm64 implementation makes use of the optimized path
<mani_s>
arnd, yes, the arm64 implementation will use readb/writeb for non-aligned addresses
<mani_s>
and readl/writel/ for 8byte aligned ones
<mani_s>
arnd, I think this limitation should be documented in doc/Documentation/unaligned-memory-access.txt
<mani_s>
what do you think?
<arnd>
good idea. If you send a patch for Documentation/core-api/unaligned-memory-access.rst to the documentation maintainers, I'll review it
<mani_s>
arnd, thanks
<mani_s>
will do
pespin has joined #linux-msm
<arnd>
There is a bit in Documentation/driver-api/device-io.rst that indicates that it's wrong to access __iomem pointers with anything other than helper functions expecting an __iomem pointer, but it's not explicit the effects on alignment
jhovold has quit [Quit: WeeChat 3.3]
<arnd>
maybe add a pointer to the device-io.rst in unaligned-memory-access.rst when mentioning __iomem, that should keep it nice and concise
jn has quit [Read error: Connection reset by peer]
jn has joined #linux-msm
djakov has quit [Remote host closed the connection]
djakov has joined #linux-msm
jhovold has joined #linux-msm
<Tooniis[m]>
aka_: maybe you need to increase the timeout period a bit? if it works after a reload then maybe whatever timed out before became ready before the second probe
pevik has quit [Ping timeout: 480 seconds]
pespin has quit [Remote host closed the connection]