From 817a9282b0774606280d8286ab29708a5bbff48e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 9 Apr 2013 09:37:19 -0700 Subject: [PATCH] 3.8-stable patches added patches: eisa-pci-fix-bus-res-reference.patch eisa-pci-init-eisa-early-before-pnp.patch ixgbe-fix-registration-order-of-driver-and-dca-nofitication.patch --- .../eisa-pci-fix-bus-res-reference.patch | 81 +++++++++++++++ .../eisa-pci-init-eisa-early-before-pnp.patch | 99 +++++++++++++++++++ ...order-of-driver-and-dca-nofitication.patch | 48 +++++++++ queue-3.8/series | 3 + 4 files changed, 231 insertions(+) create mode 100644 queue-3.8/eisa-pci-fix-bus-res-reference.patch create mode 100644 queue-3.8/eisa-pci-init-eisa-early-before-pnp.patch create mode 100644 queue-3.8/ixgbe-fix-registration-order-of-driver-and-dca-nofitication.patch diff --git a/queue-3.8/eisa-pci-fix-bus-res-reference.patch b/queue-3.8/eisa-pci-fix-bus-res-reference.patch new file mode 100644 index 00000000000..efc96e1e0c5 --- /dev/null +++ b/queue-3.8/eisa-pci-fix-bus-res-reference.patch @@ -0,0 +1,81 @@ +From 2cfda637e29ce9e3df31b59f64516b2e571cc985 Mon Sep 17 00:00:00 2001 +From: Yinghai Lu +Date: Mon, 1 Apr 2013 11:48:59 -0600 +Subject: EISA/PCI: Fix bus res reference + +From: Yinghai Lu + +commit 2cfda637e29ce9e3df31b59f64516b2e571cc985 upstream. + +Matthew found that 3.8.3 is having problems with an old (ancient) +PCI-to-EISA bridge, the Intel 82375. It worked with the 3.2 kernel. +He identified the 82375, but doesn't assign the struct resource *res +pointer inside the struct eisa_root_device, and panics. + +pci_eisa_init() was using bus->resource[] directly instead of +pci_bus_resource_n(). The bus->resource[] array is a PCI-internal +implementation detail, and after commit 45ca9e97 (PCI: add helpers for +building PCI bus resource lists) and commit 0efd5aab (PCI: add struct +pci_host_bridge_window with CPU/bus address offset), bus->resource[] is not +used for PCI root buses any more. + +The 82375 is a subtractive-decode PCI device, so handle it the same +way we handle PCI-PCI bridges in subtractive-decode mode in +pci_read_bridge_bases(). + +[bhelgaas: changelog] +Reported-by: Matthew Whitehead +Tested-by: Matthew Whitehead +Signed-off-by: Yinghai Lu +Signed-off-by: Bjorn Helgaas +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/eisa/pci_eisa.c | 28 +++++++++++++++++++++++++--- + 1 file changed, 25 insertions(+), 3 deletions(-) + +--- a/drivers/eisa/pci_eisa.c ++++ b/drivers/eisa/pci_eisa.c +@@ -21,7 +21,8 @@ static struct eisa_root_device pci_eisa_ + + static int __init pci_eisa_init(struct pci_dev *pdev) + { +- int rc; ++ int rc, i; ++ struct resource *res, *bus_res = NULL; + + if ((rc = pci_enable_device (pdev))) { + printk (KERN_ERR "pci_eisa : Could not enable device %s\n", +@@ -29,9 +30,30 @@ static int __init pci_eisa_init(struct p + return rc; + } + ++ /* ++ * The Intel 82375 PCI-EISA bridge is a subtractive-decode PCI ++ * device, so the resources available on EISA are the same as those ++ * available on the 82375 bus. This works the same as a PCI-PCI ++ * bridge in subtractive-decode mode (see pci_read_bridge_bases()). ++ * We assume other PCI-EISA bridges are similar. ++ * ++ * eisa_root_register() can only deal with a single io port resource, ++ * so we use the first valid io port resource. ++ */ ++ pci_bus_for_each_resource(pdev->bus, res, i) ++ if (res && (res->flags & IORESOURCE_IO)) { ++ bus_res = res; ++ break; ++ } ++ ++ if (!bus_res) { ++ dev_err(&pdev->dev, "No resources available\n"); ++ return -1; ++ } ++ + pci_eisa_root.dev = &pdev->dev; +- pci_eisa_root.res = pdev->bus->resource[0]; +- pci_eisa_root.bus_base_addr = pdev->bus->resource[0]->start; ++ pci_eisa_root.res = bus_res; ++ pci_eisa_root.bus_base_addr = bus_res->start; + pci_eisa_root.slots = EISA_MAX_SLOTS; + pci_eisa_root.dma_mask = pdev->dma_mask; + dev_set_drvdata(pci_eisa_root.dev, &pci_eisa_root); diff --git a/queue-3.8/eisa-pci-init-eisa-early-before-pnp.patch b/queue-3.8/eisa-pci-init-eisa-early-before-pnp.patch new file mode 100644 index 00000000000..3e0322ac023 --- /dev/null +++ b/queue-3.8/eisa-pci-init-eisa-early-before-pnp.patch @@ -0,0 +1,99 @@ +From c5fb301ae83bec6892e54984e6ec765c47df8e10 Mon Sep 17 00:00:00 2001 +From: Yinghai Lu +Date: Wed, 27 Mar 2013 21:28:05 -0700 +Subject: EISA/PCI: Init EISA early, before PNP + +From: Yinghai Lu + +commit c5fb301ae83bec6892e54984e6ec765c47df8e10 upstream. + +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: Matthew Whitehead +Tested-by: Matthew Whitehead +Signed-off-by: Yinghai Lu +Signed-off-by: Bjorn Helgaas +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/eisa/pci_eisa.c | 41 ++++++++++++++++++++++------------------- + 1 file changed, 22 insertions(+), 19 deletions(-) + +--- a/drivers/eisa/pci_eisa.c ++++ b/drivers/eisa/pci_eisa.c +@@ -19,8 +19,7 @@ + /* There is only *one* pci_eisa device per machine, right ? */ + static struct eisa_root_device pci_eisa_root; + +-static int __init pci_eisa_init(struct pci_dev *pdev, +- const struct pci_device_id *ent) ++static int __init pci_eisa_init(struct pci_dev *pdev) + { + int rc; + +@@ -45,22 +44,26 @@ static int __init pci_eisa_init(struct p + return 0; + } + +-static struct pci_device_id pci_eisa_pci_tbl[] = { +- { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, +- PCI_CLASS_BRIDGE_EISA << 8, 0xffff00, 0 }, +- { 0, } +-}; +- +-static struct pci_driver __refdata pci_eisa_driver = { +- .name = "pci_eisa", +- .id_table = pci_eisa_pci_tbl, +- .probe = pci_eisa_init, +-}; +- +-static int __init pci_eisa_init_module (void) ++/* ++ * We have to call pci_eisa_init_early() before pnpacpi_init()/isapnp_init(). ++ * Otherwise pnp resource will get enabled early and could prevent eisa ++ * 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) + { +- return pci_register_driver (&pci_eisa_driver); +-} ++ struct pci_dev *dev = NULL; ++ int ret; ++ ++ for_each_pci_dev(dev) ++ if ((dev->class >> 8) == PCI_CLASS_BRIDGE_EISA) { ++ ret = pci_eisa_init(dev); ++ if (ret) ++ return ret; ++ } + +-device_initcall(pci_eisa_init_module); +-MODULE_DEVICE_TABLE(pci, pci_eisa_pci_tbl); ++ return 0; ++} ++subsys_initcall_sync(pci_eisa_init_early); diff --git a/queue-3.8/ixgbe-fix-registration-order-of-driver-and-dca-nofitication.patch b/queue-3.8/ixgbe-fix-registration-order-of-driver-and-dca-nofitication.patch new file mode 100644 index 00000000000..d05070055c1 --- /dev/null +++ b/queue-3.8/ixgbe-fix-registration-order-of-driver-and-dca-nofitication.patch @@ -0,0 +1,48 @@ +From f01fc1a82c2ee68726b400fadb156bd623b5f2f1 Mon Sep 17 00:00:00 2001 +From: Jakub Kicinski +Date: Wed, 3 Apr 2013 16:50:54 +0000 +Subject: ixgbe: fix registration order of driver and DCA nofitication + +From: Jakub Kicinski + +commit f01fc1a82c2ee68726b400fadb156bd623b5f2f1 upstream. + +ixgbe_notify_dca cannot be called before driver registration +because it expects driver's klist_devices to be allocated and +initialized. While on it make sure debugfs files are removed +when registration fails. + +Signed-off-by: Jakub Kicinski +Tested-by: Phil Schmitt +Signed-off-by: Jeff Kirsher +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c ++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +@@ -7858,12 +7858,19 @@ static int __init ixgbe_init_module(void + ixgbe_dbg_init(); + #endif /* CONFIG_DEBUG_FS */ + ++ ret = pci_register_driver(&ixgbe_driver); ++ if (ret) { ++#ifdef CONFIG_DEBUG_FS ++ ixgbe_dbg_exit(); ++#endif /* CONFIG_DEBUG_FS */ ++ return ret; ++ } ++ + #ifdef CONFIG_IXGBE_DCA + dca_register_notify(&dca_notifier); + #endif + +- ret = pci_register_driver(&ixgbe_driver); +- return ret; ++ return 0; + } + + module_init(ixgbe_init_module); diff --git a/queue-3.8/series b/queue-3.8/series index 5f85458ee38..82ede788250 100644 --- a/queue-3.8/series +++ b/queue-3.8/series @@ -18,3 +18,6 @@ drm-i915-be-sure-to-turn-hsync-vsync-back-on-at-crt-enable-v2.patch drm-correctly-restore-mappings-if-drm_open-fails.patch revert-drivers-rtc-rtc-at91rm9200.c-use-a-variable-for-storing-imr.patch mm-prevent-mmap_cache-race-in-find_vma.patch +eisa-pci-init-eisa-early-before-pnp.patch +eisa-pci-fix-bus-res-reference.patch +ixgbe-fix-registration-order-of-driver-and-dca-nofitication.patch -- 2.47.3