[PATCH 00/11] PCI/CardBus: Disable properly when CARDBUS=n & fix some issues along the way

From: Ilpo Järvinen

Date: Mon Nov 09 2026 - 16:07:51 EST


Hi all,

When CARDBUS=n, there are still leftovers in the bridge setup code that
add annoying corner cases by confusing CardBus bridges with normal PCI
devices. This series attempts to truly disable CardBus bridges when
config asks to do so as it seems the most reasonable way to prevent
those corner cases. That is, this series removes ability to select only
"partial CardBus support", full support for CardBus remains in kernel
and can still be enabled with CONFIG_CARDBUS. The alternative to this
would be to sprinkle pci_is_cardbus_bridge() everywhere to work around
the corner case is not reasonable given CardBus is quite old and rarely
used legacy technology.

Disabling CARDBUS also implies the entire Multi-Function Device is lost
because CardBus bridge at Function 0 gates enumeration of the rest of
the functions that are not CardBus related (multiple drivers affected).
This is intentionally not addressed with Kconfig dependencies; see the
changelogs for the rationale. Towards the end, part of the patches are
marked as RFC because they might have an impact on existing configs for
that reason.

The series first fixes a few issues in PCI core and CardBus integration
(4 patches, the first one is totally unrelated to CardBus but CardBus
integration will use the same label in a later change). The fixes can
be applied on their own if needed. After that, there are some
preparatory changes and the main move of CardBus setup into
setup-cardbus.c. Finally, the series moves a few CardBus specific
quirks and the resource name getter into setup-cardbus.c to keep them
out of the other PCI core code.


Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: Alex Dubov <oakad@xxxxxxxxx>
Cc: Dominik Brodowski <linux@xxxxxxxxxxxxxxxxxxxx>
Cc: linux1394-devel@xxxxxxxxxxxxxxxxxxxxx
Cc: linux-mmc@xxxxxxxxxxxxxxx
Cc: "Maciej W. Rozycki" <macro@xxxxxxxxxxx>
Cc: Maxim Levitsky <maximlevitsky@xxxxxxxxx>
Cc: Sascha Sommer <saschasommer@xxxxxxxxxx>
Cc: Takashi Sakamoto <o-takashi@xxxxxxxxxxxxx>
Cc: Ulf Hansson <ulfh@xxxxxxxxxx>


Ilpo Järvinen (11):
PCI: Free device name when pci_setup_device() fails
PCI: Use Header Type in __pci_bridge_assign_resources()
PCI: Use Header Type to detect CardBus bridges in
pci_resource_alignment()
PCI: Fix off-by-one in CardBus resource names
PCI: Move pci_read_bases() wrapper with BUILD_BUG_ON() to pci.h
mmc: sdricoh_cs: Depend on CARDBUS
pcmcia: yenta_socket: Always select CARDBUS
PCI: Move CardBus device setup to setup-cardbus.c
PCI: Move CardBus legacy mode quirk to setup-cardbus.c
PCI: Move Ricoh RL5C476 MMC quirk to setup-cardbus.c
PCI: Move CardBus resource names to setup-cardbus.c

drivers/mmc/host/Kconfig | 2 +-
drivers/pci/pci.c | 25 +---------
drivers/pci/pci.h | 23 ++++++++-
drivers/pci/probe.c | 27 +++++-----
drivers/pci/quirks.c | 45 -----------------
drivers/pci/setup-bus.c | 6 +--
drivers/pci/setup-cardbus.c | 99 +++++++++++++++++++++++++++++++++++++
drivers/pci/setup-res.c | 2 +-
drivers/pcmcia/Kconfig | 2 +-
9 files changed, 144 insertions(+), 87 deletions(-)


base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
--
2.47.3