Thread (9 messages) read the whole thread 9 messages, 3 authors, 2017-06-29

Re: [PATCH v2 1/3] io-64-nonatomic: add io{read|write}64[be] macros

From: Logan Gunthorpe <logang@deltatee.com>
Date: 2017-06-28 16:03:16
Also in: linux-crypto, lkml


On 28/06/17 04:11 AM, Arnd Bergmann wrote:
This is wrong since ioread* is not the same read* on x86 and other
architectures that have native PCI PIO accessors, or that require
additional barriers for those.

You have to copy hi_lo_readq() here, and call ioread32 twice instead
of calling readl() twice. Same for iowrite64.
quoted
+#ifndef ioread64be
+#define ioread64be(p) be64_to_cpu(ioread64(p))
+#endif
This has another problem: ioread64() is defined to access little-endian
registers, just like readq(). This means that instead of be64_to_cpu()
you need swab64() and always perform the byte swap, otherwise this
would be broken on big-endian architectures.
Ah, ok, understood. I'll see if I can fix both these issues.

Thanks,

Logan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help