[PATCH v9 12/24] s390/Kconfig: remove PCI dependency from HAS_IOMEM

From: Steffen Eiden

Date: Wed Sep 30 2026 - 15:21:57 EST


HAS_IOMEM was defined as def_bool PCI on s390, making it false on kernels
built without PCI support. This made sense until now as the IOMEM code
was only required if PCI was enabled. This will change as KVM will
require IOMEM in the future. To simplify the config space, turn
HAS_IOMEM on unconditionally by default.

All other architectures either do not override HAS_IOMEM or set it
unconditionally. s390 was the only architecture where HAS_IOMEM could be
false on a real system.

Since HAS_IOMEM=y now causes kernel/iomem.o and lib/devres.o to be built
unconditionally, ioremap()/iounmap() must always be available.
Select GENERIC_IOREMAP unconditionally to provide the generic
implementations for the PCI=n case.

Previously GENERIC_IOREMAP was conditioned on CONFIG_PCI in lockstep
with HAS_IOMEM, so mm/ioremap.c was never built without PCI. Therefore,
guard the PCI override macros ioremap_prot, iounmap, and ioremap_wc with
CONFIG_PCI.

Reviewed-by: Ilya Leoshkevich <iii@xxxxxxxxxxxxx>
Signed-off-by: Steffen Eiden <seiden@xxxxxxxxxxxxx>
---
arch/s390/Kconfig | 5 +----
arch/s390/include/asm/io.h | 12 ++++++------
2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 4b51bc6e8948..5a01fbd8e32b 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -181,7 +181,7 @@ config S390
select GENERIC_ENTRY
select GENERIC_GETTIMEOFDAY
select GENERIC_SMP_IDLE_THREAD
- select GENERIC_IOREMAP if PCI
+ select GENERIC_IOREMAP
select GLOB
select HAVE_ALIGNED_STRUCT_PAGE
select HAVE_ARCH_AUDITSYSCALL
@@ -768,9 +768,6 @@ config PCI_NR_FUNCTIONS

endif # PCI

-config HAS_IOMEM
- def_bool PCI
-
config CHSC_SCH
def_tristate m
prompt "Support for CHSC subchannels"
diff --git a/arch/s390/include/asm/io.h b/arch/s390/include/asm/io.h
index faddb9aef3b8..ef0490edeccd 100644
--- a/arch/s390/include/asm/io.h
+++ b/arch/s390/include/asm/io.h
@@ -27,14 +27,8 @@ void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr);
/*
* I/O memory mapping functions.
*/
-#define ioremap_prot ioremap_prot
-#define iounmap iounmap
-
#define _PAGE_IOREMAP pgprot_val(PAGE_KERNEL)

-#define ioremap_wc(addr, size) \
- ioremap_prot((addr), (size), pgprot_writecombine(PAGE_KERNEL))
-
static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
{
return NULL;
@@ -46,6 +40,12 @@ static inline void ioport_unmap(void __iomem *p)

#ifdef CONFIG_PCI

+#define ioremap_prot ioremap_prot
+#define iounmap iounmap
+
+#define ioremap_wc(addr, size) \
+ ioremap_prot((addr), (size), pgprot_writecombine(PAGE_KERNEL))
+
/*
* s390 needs a private implementation of pci_iomap since ioremap with its
* offset parameter isn't sufficient. That's because BAR spaces are not
--
2.53.0