提交 c5fb301a 编写于 作者: Y Yinghai Lu 提交者: Bjorn Helgaas

EISA/PCI: Init EISA early, before PNP

Matthew reported kernels fail the pci_eisa probe and are later successful
with the virtual_eisa_root_init force probe without slot0.

The reason for that is: PNP probing is before pci_eisa_init gets called
as pci_eisa_init is called via pci_driver.

pnp 00:0f has 0xc80 - 0xc84 reserved.
[    9.700409] pnp 00:0f: [io  0x0c80-0x0c84]

so eisa_probe will fail from pci_eisa_init
				==>eisa_root_register
					==>eisa_probe path.
as force_probe is not set in pci_eisa_root, it will bail early when
slot0 is not probed and initialized.

Try to use subsys_initcall_sync instead, and will keep following sequence:
	pci_subsys_init
	pci_eisa_init_early
	pnpacpi_init/isapnp_init

After this patch EISA can be initialized properly, and PNP overlapping
resource will not be reserved.
[   10.104434] system 00:0f: [io  0x0c80-0x0c84] could not be reserved
Reported-by: NMatthew Whitehead <mwhitehe@redhat.com>
Tested-by: NMatthew Whitehead <mwhitehe@redhat.com>
Signed-off-by: NYinghai Lu <yinghai@kernel.org>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org
上级 2cfda637
...@@ -19,8 +19,7 @@ ...@@ -19,8 +19,7 @@
/* There is only *one* pci_eisa device per machine, right ? */ /* There is only *one* pci_eisa device per machine, right ? */
static struct eisa_root_device pci_eisa_root; static struct eisa_root_device pci_eisa_root;
static int __init pci_eisa_init(struct pci_dev *pdev, static int __init pci_eisa_init(struct pci_dev *pdev)
const struct pci_device_id *ent)
{ {
int rc, i; int rc, i;
struct resource *res, *bus_res = NULL; struct resource *res, *bus_res = NULL;
...@@ -67,22 +66,26 @@ static int __init pci_eisa_init(struct pci_dev *pdev, ...@@ -67,22 +66,26 @@ static int __init pci_eisa_init(struct pci_dev *pdev,
return 0; return 0;
} }
static struct pci_device_id pci_eisa_pci_tbl[] = { /*
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, * We have to call pci_eisa_init_early() before pnpacpi_init()/isapnp_init().
PCI_CLASS_BRIDGE_EISA << 8, 0xffff00, 0 }, * Otherwise pnp resource will get enabled early and could prevent eisa
{ 0, } * to be initialized.
}; * Also need to make sure pci_eisa_init_early() is called after
* x86/pci_subsys_init().
* So need to use subsys_initcall_sync with it.
*/
static int __init pci_eisa_init_early(void)
{
struct pci_dev *dev = NULL;
int ret;
static struct pci_driver __refdata pci_eisa_driver = { for_each_pci_dev(dev)
.name = "pci_eisa", if ((dev->class >> 8) == PCI_CLASS_BRIDGE_EISA) {
.id_table = pci_eisa_pci_tbl, ret = pci_eisa_init(dev);
.probe = pci_eisa_init, if (ret)
}; return ret;
}
static int __init pci_eisa_init_module (void) return 0;
{
return pci_register_driver (&pci_eisa_driver);
} }
subsys_initcall_sync(pci_eisa_init_early);
device_initcall(pci_eisa_init_module);
MODULE_DEVICE_TABLE(pci, pci_eisa_pci_tbl);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册