From: Dominik Brodowski Date: Mon, 27 Jun 2005 23:29:02 +0000 (-0700) Subject: [PATCH] ACPI-based PCI resources: PCMCIA bugfix, but resources missing in trees X-Git-Tag: v2.6.13-rc1~46^2~2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6d00f0de9e932e2884b3b7af8e43c0a61a271ee;p=linux-2.6 [PATCH] ACPI-based PCI resources: PCMCIA bugfix, but resources missing in trees Don't auto-configure yenta sockets for PCMCIA devices if it is connected to the root PCI bus on the x86 or x86_64 architectures. Previously, this was handled by the "ioport_resource"/"iomem_resource" check a few lines below, but with the new ACPI-based resource handling this doesn't catch all cases any longer. pci-yenta-cardbus-fix.patch and this patch should solve the initialization time trouble. However, the ACPI-based PCI resource handling is badly broken, IMHO: - many resources of devices don't show up in the resource trees ( /proc/iomem and /proc/ioports) any longer. This means that PCMCIA, but also possibly other subsystems (ISA, PnP, ...) do not know which resources it cannot use. - verify_root_windows() should fail if there are no iomem _or_ ioport resources, not only if there are no iomem _and_ ioport resources. Signed-off-by: Dominik Brodowski Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c index 51aa04b7ec..c42455d20e 100644 --- a/drivers/pcmcia/rsrc_nonstatic.c +++ b/drivers/pcmcia/rsrc_nonstatic.c @@ -779,6 +779,17 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s) if (!s->cb_dev || !s->cb_dev->bus) return -ENODEV; +#if defined(CONFIG_X86) || defined(CONFIG_X86_64) + /* If this is the root bus, the risk of hitting + * some strange system devices which aren't protected + * by either ACPI resource tables or properly requested + * resources is too big. Therefore, don't do auto-adding + * of resources at the moment. + */ + if (s->cb_dev->bus->number == 0) + return -EINVAL; +#endif + for (i=0; i < PCI_BUS_NUM_RESOURCES; i++) { res = s->cb_dev->bus->resource[i]; if (!res)