On 2025/7/2 19:09, Arnd Bergmann wrote: > On Tue, Jul 1, 2025, at 14:22, Tiwei Bie wrote: >> On 2025/7/1 16:43, Arnd Bergmann wrote: >>> On Tue, Jul 1, 2025, at 10:26, Geert Uytterhoeven wrote: >>> --- a/lib/Kconfig >>> +++ b/lib/Kconfig >>> @@ -381,7 +381,7 @@ config HAS_IOPORT >>> config HAS_IOPORT_MAP >>> bool >>> depends on HAS_IOMEM && !NO_IOPORT_MAP >>> - default y >>> + default HAS_IOPORT >>> >>> source "kernel/dma/Kconfig" >>> >>> It seems silly to turn off HAS_IOPORT_MAP on platforms that don't >>> have HAS_IOPORT to start with. >> >> I'm not entirely clear on the meaning of HAS_IOPORT though. It looks >> HAS_IOPORT was introduced to support disabling compilation of the I/O >> accessor functions inb()/outb() and friends [1]. > > Correct > >> And looking at the >> code, xtensa supports IOPORT_MAP [2][3], but doesn't select HAS_IOPORT >> (which is also stated in the commit log in [1]). > > xtensa selects NO_IOPORT_MAP, which means that HAS_IOPORT_MAP > gets disabled here: > > arch/xtensa/Kconfig:config NO_IOPORT_MAP > arch/xtensa/Kconfig- def_bool n
The value of NO_IOPORT_MAP on xtensa is inverted compared to that on most other platforms that explicitly defines NO_IOPORT_MAP. When NO_IOPORT_MAP is explicitly defined, it is typically set to 'y', which disables HAS_IOPORT_MAP [1]. However, on xtensa, NO_IOPORT_MAP is set to 'n' [2], thereby enabling HAS_IOPORT_MAP. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/Kconfig?h=v6.16-rc4#n468 [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/xtensa/Kconfig?h=v6.16-rc4#n82 Regards, Tiwei