fs: debugfs: fix build error at powerpc platform
Subsystems (3)
Frank Li
maintainerPATCH v2 1/1 fs: debugfs: fix build error at powerpc platform
ld: fs/debugfs/file.o: in function `debugfs_print_regs':
file.c:(.text+0x95a): undefined reference to `ioread64be'
Quoted 1 line
Quoted 1 line
ld: file.c:(.text+0x9dd): undefined reference to `ioread64'
---
Notes:
Change from v1 to v2
- fixed it by #include <linux/io-64-nonatomic-hi-lo.h>
fs/debugfs/file.c | 1 + 1 file changed, 1 insertion(+)
fs/debugfs/file.c +1 -0
@@ -15,6 +15,7 @@#include <linux/pagemap.h> #include <linux/debugfs.h> #include <linux/io.h> +#include <linux/io-64-nonatomic-hi-lo.h> #include <linux/slab.h> #include <linux/atomic.h> #include <linux/device.h>
Signature · 1 line
2.34.1
Quoted 9 lines · Frank Li
ld:
fs/debugfs/file.o: in function `debugfs_print_regs':file.c:(.text+0x95a): undefined reference to `ioread64be'Quoted 1 line
Quoted 1 line
ld: file.c:(.text+0x9dd): undefined reference to `ioread64'
Reported-by kernel test robot <[email protected]>Closes:
https://lore.kernel.org/oe-kbuild-all/[email protected]/Signed-off-by Frank Li <[email protected]>---
I still think this is wrong, for the reasons I explained in
https://lore.kernel.org/all/[email protected]/
The part that I had missed earlier is how this is related to GENERIC_IOMAP, since on those architectures, the ioread helpers are not just fixed-endian MMIO accessors like readl and readq but also multiplex to the PIO functions (inb/inw/inl) that do not have a 64-bit version because x86 and PCI both only define those up to 32 bit width.
The best workaround is probably to use readq() instead of ioread64(), or swab64(readl()) instead of ioread64_be().
This should work on all 64-bit architectures, plus any 32-bit one that defines readq(), so you can just use an 'ifdef readq' around the call.
Arnd
Frank Li
maintainerQuoted 21 lines · Arnd Bergmann
Quoted 9 lines · Frank Li
ld:
fs/debugfs/file.o: in function `debugfs_print_regs':file.c:(.text+0x95a): undefined reference to `ioread64be'Quoted 1 line
Quoted 1 line
ld: file.c:(.text+0x9dd): undefined reference to `ioread64'
Reported-by kernel test robot <[email protected]>Closes:
https://lore.kernel.org/oe-kbuild-all/[email protected]/Signed-off-by Frank Li <[email protected]>---
I still think this is wrong, for the reasons I explained in
https://lore.kernel.org/all/[email protected]/The part that I had missed earlier is how this is related to
GENERIC_IOMAP, since on those architectures, the ioread helpers are not just fixed-endian MMIO accessors like readl and readq but also multiplex to the PIO functions (inb/inw/inl) that do not have a 64-bit version because x86 and PCI both only define those up to 32 bit width.
Quoted 6 lines
The best workaround is probably to use
readq()instead ofioread64(), or swab64(readl()) instead ofioread64_be().This should work on all 64-bit architectures, plus any 32-bit one that defines
readq(), so you can just use an 'ifdef readq' around the call.
My previous patchs were dropped by vinod.
I think it'd better remove 64bit register at previous patch serise.
Let me create a seperate patch to enable 64bit register support for debug fs.
Frank
Quoted 2 lines
Arnd