diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/hotplug/Kconfig | 9 | ||||
-rw-r--r-- | drivers/pci/hotplug/acpiphp_core.c | 3 | ||||
-rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 2 | ||||
-rw-r--r-- | drivers/pci/hotplug/cpci_hotplug_pci.c | 54 | ||||
-rw-r--r-- | drivers/pci/hotplug/pciehp.h | 5 | ||||
-rw-r--r-- | drivers/pci/hotplug/pciehp_hpc.c | 4 | ||||
-rw-r--r-- | drivers/pci/pci-driver.c | 3 | ||||
-rw-r--r-- | drivers/pci/pcie/portdrv_pci.c | 38 | ||||
-rw-r--r-- | drivers/pci/quirks.c | 66 | ||||
-rw-r--r-- | drivers/pci/search.c | 48 |
10 files changed, 162 insertions, 70 deletions
diff --git a/drivers/pci/hotplug/Kconfig b/drivers/pci/hotplug/Kconfig index 3fae77ffb2fa..8a60f391ffcf 100644 --- a/drivers/pci/hotplug/Kconfig +++ b/drivers/pci/hotplug/Kconfig | |||
@@ -76,7 +76,7 @@ config HOTPLUG_PCI_IBM | |||
76 | 76 | ||
77 | config HOTPLUG_PCI_ACPI | 77 | config HOTPLUG_PCI_ACPI |
78 | tristate "ACPI PCI Hotplug driver" | 78 | tristate "ACPI PCI Hotplug driver" |
79 | depends on ACPI_DOCK && HOTPLUG_PCI | 79 | depends on (!ACPI_DOCK && ACPI && HOTPLUG_PCI) || (ACPI_DOCK && HOTPLUG_PCI) |
80 | help | 80 | help |
81 | Say Y here if you have a system that supports PCI Hotplug using | 81 | Say Y here if you have a system that supports PCI Hotplug using |
82 | ACPI. | 82 | ACPI. |
@@ -153,13 +153,6 @@ config HOTPLUG_PCI_SHPC_POLL_EVENT_MODE | |||
153 | 153 | ||
154 | When in doubt, say N. | 154 | When in doubt, say N. |
155 | 155 | ||
156 | config HOTPLUG_PCI_SHPC_PHPRM_LEGACY | ||
157 | bool "For AMD SHPC only: Use $HRT for resource/configuration" | ||
158 | depends on HOTPLUG_PCI_SHPC && !ACPI | ||
159 | help | ||
160 | Say Y here for AMD SHPC. You have to select this option if you are | ||
161 | using this driver on platform with AMD SHPC. | ||
162 | |||
163 | config HOTPLUG_PCI_RPA | 156 | config HOTPLUG_PCI_RPA |
164 | tristate "RPA PCI Hotplug driver" | 157 | tristate "RPA PCI Hotplug driver" |
165 | depends on HOTPLUG_PCI && PPC_PSERIES && PPC64 && !HOTPLUG_PCI_FAKE | 158 | depends on HOTPLUG_PCI && PPC_PSERIES && PPC64 && !HOTPLUG_PCI_FAKE |
diff --git a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c index 34de5697983d..e2fef60c2d06 100644 --- a/drivers/pci/hotplug/acpiphp_core.c +++ b/drivers/pci/hotplug/acpiphp_core.c | |||
@@ -27,8 +27,7 @@ | |||
27 | * along with this program; if not, write to the Free Software | 27 | * along with this program; if not, write to the Free Software |
28 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 28 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
29 | * | 29 | * |
30 | * Send feedback to <gregkh@us.ibm.com>, | 30 | * Send feedback to <kristen.c.accardi@intel.com> |
31 | * <t-kochi@bq.jp.nec.com> | ||
32 | * | 31 | * |
33 | */ | 32 | */ |
34 | 33 | ||
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index ef95d12fb32c..ae67a8f55ba1 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
@@ -26,7 +26,7 @@ | |||
26 | * along with this program; if not, write to the Free Software | 26 | * along with this program; if not, write to the Free Software |
27 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 27 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
28 | * | 28 | * |
29 | * Send feedback to <t-kochi@bq.jp.nec.com> | 29 | * Send feedback to <kristen.c.accardi@intel.com> |
30 | * | 30 | * |
31 | */ | 31 | */ |
32 | 32 | ||
diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c index 02be74caa89f..4afcaffd031c 100644 --- a/drivers/pci/hotplug/cpci_hotplug_pci.c +++ b/drivers/pci/hotplug/cpci_hotplug_pci.c | |||
@@ -254,8 +254,8 @@ int cpci_led_off(struct slot* slot) | |||
254 | 254 | ||
255 | int cpci_configure_slot(struct slot* slot) | 255 | int cpci_configure_slot(struct slot* slot) |
256 | { | 256 | { |
257 | unsigned char busnr; | 257 | struct pci_bus *parent; |
258 | struct pci_bus *child; | 258 | int fn; |
259 | 259 | ||
260 | dbg("%s - enter", __FUNCTION__); | 260 | dbg("%s - enter", __FUNCTION__); |
261 | 261 | ||
@@ -276,23 +276,53 @@ int cpci_configure_slot(struct slot* slot) | |||
276 | */ | 276 | */ |
277 | n = pci_scan_slot(slot->bus, slot->devfn); | 277 | n = pci_scan_slot(slot->bus, slot->devfn); |
278 | dbg("%s: pci_scan_slot returned %d", __FUNCTION__, n); | 278 | dbg("%s: pci_scan_slot returned %d", __FUNCTION__, n); |
279 | if (n > 0) | ||
280 | pci_bus_add_devices(slot->bus); | ||
281 | slot->dev = pci_get_slot(slot->bus, slot->devfn); | 279 | slot->dev = pci_get_slot(slot->bus, slot->devfn); |
282 | if (slot->dev == NULL) { | 280 | if (slot->dev == NULL) { |
283 | err("Could not find PCI device for slot %02x", slot->number); | 281 | err("Could not find PCI device for slot %02x", slot->number); |
284 | return 1; | 282 | return -ENODEV; |
285 | } | 283 | } |
286 | } | 284 | } |
287 | 285 | parent = slot->dev->bus; | |
288 | if (slot->dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { | 286 | |
289 | pci_read_config_byte(slot->dev, PCI_SECONDARY_BUS, &busnr); | 287 | for (fn = 0; fn < 8; fn++) { |
290 | child = pci_add_new_bus(slot->dev->bus, slot->dev, busnr); | 288 | struct pci_dev *dev; |
291 | pci_do_scan_bus(child); | 289 | |
292 | pci_bus_size_bridges(child); | 290 | dev = pci_get_slot(parent, PCI_DEVFN(PCI_SLOT(slot->devfn), fn)); |
291 | if (!dev) | ||
292 | continue; | ||
293 | if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) || | ||
294 | (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)) { | ||
295 | /* Find an unused bus number for the new bridge */ | ||
296 | struct pci_bus *child; | ||
297 | unsigned char busnr, start = parent->secondary; | ||
298 | unsigned char end = parent->subordinate; | ||
299 | |||
300 | for (busnr = start; busnr <= end; busnr++) { | ||
301 | if (!pci_find_bus(pci_domain_nr(parent), | ||
302 | busnr)) | ||
303 | break; | ||
304 | } | ||
305 | if (busnr >= end) { | ||
306 | err("No free bus for hot-added bridge\n"); | ||
307 | pci_dev_put(dev); | ||
308 | continue; | ||
309 | } | ||
310 | child = pci_add_new_bus(parent, dev, busnr); | ||
311 | if (!child) { | ||
312 | err("Cannot add new bus for %s\n", | ||
313 | pci_name(dev)); | ||
314 | pci_dev_put(dev); | ||
315 | continue; | ||
316 | } | ||
317 | child->subordinate = pci_do_scan_bus(child); | ||
318 | pci_bus_size_bridges(child); | ||
319 | } | ||
320 | pci_dev_put(dev); | ||
293 | } | 321 | } |
294 | 322 | ||
295 | pci_bus_assign_resources(slot->dev->bus); | 323 | pci_bus_assign_resources(parent); |
324 | pci_bus_add_devices(parent); | ||
325 | pci_enable_bridges(parent); | ||
296 | 326 | ||
297 | dbg("%s - exit", __FUNCTION__); | 327 | dbg("%s - exit", __FUNCTION__); |
298 | return 0; | 328 | return 0; |
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index ce89f5815861..eaea9d36a1bb 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h | |||
@@ -279,6 +279,11 @@ struct hpc_ops { | |||
279 | 279 | ||
280 | 280 | ||
281 | #ifdef CONFIG_ACPI | 281 | #ifdef CONFIG_ACPI |
282 | #include <acpi/acpi.h> | ||
283 | #include <acpi/acpi_bus.h> | ||
284 | #include <acpi/actypes.h> | ||
285 | #include <linux/pci-acpi.h> | ||
286 | |||
282 | #define pciehp_get_hp_hw_control_from_firmware(dev) \ | 287 | #define pciehp_get_hp_hw_control_from_firmware(dev) \ |
283 | pciehp_acpi_get_hp_hw_control_from_firmware(dev) | 288 | pciehp_acpi_get_hp_hw_control_from_firmware(dev) |
284 | static inline int pciehp_get_hp_params_from_firmware(struct pci_dev *dev, | 289 | static inline int pciehp_get_hp_params_from_firmware(struct pci_dev *dev, |
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 0d8fb6e607a1..6ab3b6cd2b54 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -38,10 +38,6 @@ | |||
38 | 38 | ||
39 | #include "../pci.h" | 39 | #include "../pci.h" |
40 | #include "pciehp.h" | 40 | #include "pciehp.h" |
41 | #include <acpi/acpi.h> | ||
42 | #include <acpi/acpi_bus.h> | ||
43 | #include <acpi/actypes.h> | ||
44 | #include <linux/pci-acpi.h> | ||
45 | #ifdef DEBUG | 41 | #ifdef DEBUG |
46 | #define DBG_K_TRACE_ENTRY ((unsigned int)0x00000001) /* On function entry */ | 42 | #define DBG_K_TRACE_ENTRY ((unsigned int)0x00000001) /* On function entry */ |
47 | #define DBG_K_TRACE_EXIT ((unsigned int)0x00000002) /* On function exit */ | 43 | #define DBG_K_TRACE_EXIT ((unsigned int)0x00000002) /* On function exit */ |
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 10e1a905c144..474e9cd0e9e4 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -139,9 +139,8 @@ const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, | |||
139 | /** | 139 | /** |
140 | * pci_match_device - Tell if a PCI device structure has a matching | 140 | * pci_match_device - Tell if a PCI device structure has a matching |
141 | * PCI device id structure | 141 | * PCI device id structure |
142 | * @ids: array of PCI device id structures to search in | ||
143 | * @dev: the PCI device structure to match against | ||
144 | * @drv: the PCI driver to match against | 142 | * @drv: the PCI driver to match against |
143 | * @dev: the PCI device structure to match against | ||
145 | * | 144 | * |
146 | * Used by a driver to check whether a PCI device present in the | 145 | * Used by a driver to check whether a PCI device present in the |
147 | * system is in its list of supported devices. Returns the matching | 146 | * system is in its list of supported devices. Returns the matching |
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index 50bfc1b2f3bf..478d0d28f7ad 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c | |||
@@ -30,23 +30,6 @@ MODULE_LICENSE("GPL"); | |||
30 | /* global data */ | 30 | /* global data */ |
31 | static const char device_name[] = "pcieport-driver"; | 31 | static const char device_name[] = "pcieport-driver"; |
32 | 32 | ||
33 | static int pcie_portdrv_save_config(struct pci_dev *dev) | ||
34 | { | ||
35 | return pci_save_state(dev); | ||
36 | } | ||
37 | |||
38 | static int pcie_portdrv_restore_config(struct pci_dev *dev) | ||
39 | { | ||
40 | int retval; | ||
41 | |||
42 | pci_restore_state(dev); | ||
43 | retval = pci_enable_device(dev); | ||
44 | if (retval) | ||
45 | return retval; | ||
46 | pci_set_master(dev); | ||
47 | return 0; | ||
48 | } | ||
49 | |||
50 | /* | 33 | /* |
51 | * pcie_portdrv_probe - Probe PCI-Express port devices | 34 | * pcie_portdrv_probe - Probe PCI-Express port devices |
52 | * @dev: PCI-Express port device being probed | 35 | * @dev: PCI-Express port device being probed |
@@ -73,8 +56,10 @@ static int __devinit pcie_portdrv_probe (struct pci_dev *dev, | |||
73 | "%s->Dev[%04x:%04x] has invalid IRQ. Check vendor BIOS\n", | 56 | "%s->Dev[%04x:%04x] has invalid IRQ. Check vendor BIOS\n", |
74 | __FUNCTION__, dev->device, dev->vendor); | 57 | __FUNCTION__, dev->device, dev->vendor); |
75 | } | 58 | } |
76 | if (pcie_port_device_register(dev)) | 59 | if (pcie_port_device_register(dev)) { |
60 | pci_disable_device(dev); | ||
77 | return -ENOMEM; | 61 | return -ENOMEM; |
62 | } | ||
78 | 63 | ||
79 | return 0; | 64 | return 0; |
80 | } | 65 | } |
@@ -86,6 +71,23 @@ static void pcie_portdrv_remove (struct pci_dev *dev) | |||
86 | } | 71 | } |
87 | 72 | ||
88 | #ifdef CONFIG_PM | 73 | #ifdef CONFIG_PM |
74 | static int pcie_portdrv_save_config(struct pci_dev *dev) | ||
75 | { | ||
76 | return pci_save_state(dev); | ||
77 | } | ||
78 | |||
79 | static int pcie_portdrv_restore_config(struct pci_dev *dev) | ||
80 | { | ||
81 | int retval; | ||
82 | |||
83 | pci_restore_state(dev); | ||
84 | retval = pci_enable_device(dev); | ||
85 | if (retval) | ||
86 | return retval; | ||
87 | pci_set_master(dev); | ||
88 | return 0; | ||
89 | } | ||
90 | |||
89 | static int pcie_portdrv_suspend (struct pci_dev *dev, pm_message_t state) | 91 | static int pcie_portdrv_suspend (struct pci_dev *dev, pm_message_t state) |
90 | { | 92 | { |
91 | int ret = pcie_port_device_suspend(dev, state); | 93 | int ret = pcie_port_device_suspend(dev, state); |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index e3c78c39b7e4..73177429fe74 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -438,6 +438,7 @@ static void __devinit quirk_ich6_lpc_acpi(struct pci_dev *dev) | |||
438 | pci_read_config_dword(dev, 0x48, ®ion); | 438 | pci_read_config_dword(dev, 0x48, ®ion); |
439 | quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES+1, "ICH6 GPIO"); | 439 | quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES+1, "ICH6 GPIO"); |
440 | } | 440 | } |
441 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_0, quirk_ich6_lpc_acpi ); | ||
441 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, quirk_ich6_lpc_acpi ); | 442 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, quirk_ich6_lpc_acpi ); |
442 | 443 | ||
443 | /* | 444 | /* |
@@ -990,6 +991,11 @@ static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev) | |||
990 | case 0x8070: /* P4G8X Deluxe */ | 991 | case 0x8070: /* P4G8X Deluxe */ |
991 | asus_hides_smbus = 1; | 992 | asus_hides_smbus = 1; |
992 | } | 993 | } |
994 | if (dev->device == PCI_DEVICE_ID_INTEL_E7501_MCH) | ||
995 | switch (dev->subsystem_device) { | ||
996 | case 0x80c9: /* PU-DLS */ | ||
997 | asus_hides_smbus = 1; | ||
998 | } | ||
993 | if (dev->device == PCI_DEVICE_ID_INTEL_82855GM_HB) | 999 | if (dev->device == PCI_DEVICE_ID_INTEL_82855GM_HB) |
994 | switch (dev->subsystem_device) { | 1000 | switch (dev->subsystem_device) { |
995 | case 0x1751: /* M2N notebook */ | 1001 | case 0x1751: /* M2N notebook */ |
@@ -1058,6 +1064,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82845G_HB, asu | |||
1058 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82850_HB, asus_hides_smbus_hostbridge ); | 1064 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82850_HB, asus_hides_smbus_hostbridge ); |
1059 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82865_HB, asus_hides_smbus_hostbridge ); | 1065 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82865_HB, asus_hides_smbus_hostbridge ); |
1060 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_7205_0, asus_hides_smbus_hostbridge ); | 1066 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_7205_0, asus_hides_smbus_hostbridge ); |
1067 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7501_MCH, asus_hides_smbus_hostbridge ); | ||
1061 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855PM_HB, asus_hides_smbus_hostbridge ); | 1068 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855PM_HB, asus_hides_smbus_hostbridge ); |
1062 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855GM_HB, asus_hides_smbus_hostbridge ); | 1069 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855GM_HB, asus_hides_smbus_hostbridge ); |
1063 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82915GM_HB, asus_hides_smbus_hostbridge ); | 1070 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82915GM_HB, asus_hides_smbus_hostbridge ); |
@@ -1081,10 +1088,10 @@ static void __init asus_hides_smbus_lpc(struct pci_dev *dev) | |||
1081 | } | 1088 | } |
1082 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, asus_hides_smbus_lpc ); | 1089 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, asus_hides_smbus_lpc ); |
1083 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, asus_hides_smbus_lpc ); | 1090 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, asus_hides_smbus_lpc ); |
1091 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0, asus_hides_smbus_lpc ); | ||
1084 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, asus_hides_smbus_lpc ); | 1092 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, asus_hides_smbus_lpc ); |
1085 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, asus_hides_smbus_lpc ); | 1093 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, asus_hides_smbus_lpc ); |
1086 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, asus_hides_smbus_lpc ); | 1094 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, asus_hides_smbus_lpc ); |
1087 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, asus_hides_smbus_lpc ); | ||
1088 | 1095 | ||
1089 | static void __init asus_hides_smbus_lpc_ich6(struct pci_dev *dev) | 1096 | static void __init asus_hides_smbus_lpc_ich6(struct pci_dev *dev) |
1090 | { | 1097 | { |
@@ -1511,6 +1518,63 @@ static void __devinit quirk_netmos(struct pci_dev *dev) | |||
1511 | } | 1518 | } |
1512 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETMOS, PCI_ANY_ID, quirk_netmos); | 1519 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETMOS, PCI_ANY_ID, quirk_netmos); |
1513 | 1520 | ||
1521 | static void __devinit quirk_e100_interrupt(struct pci_dev *dev) | ||
1522 | { | ||
1523 | u16 command; | ||
1524 | u32 bar; | ||
1525 | u8 __iomem *csr; | ||
1526 | u8 cmd_hi; | ||
1527 | |||
1528 | switch (dev->device) { | ||
1529 | /* PCI IDs taken from drivers/net/e100.c */ | ||
1530 | case 0x1029: | ||
1531 | case 0x1030 ... 0x1034: | ||
1532 | case 0x1038 ... 0x103E: | ||
1533 | case 0x1050 ... 0x1057: | ||
1534 | case 0x1059: | ||
1535 | case 0x1064 ... 0x106B: | ||
1536 | case 0x1091 ... 0x1095: | ||
1537 | case 0x1209: | ||
1538 | case 0x1229: | ||
1539 | case 0x2449: | ||
1540 | case 0x2459: | ||
1541 | case 0x245D: | ||
1542 | case 0x27DC: | ||
1543 | break; | ||
1544 | default: | ||
1545 | return; | ||
1546 | } | ||
1547 | |||
1548 | /* | ||
1549 | * Some firmware hands off the e100 with interrupts enabled, | ||
1550 | * which can cause a flood of interrupts if packets are | ||
1551 | * received before the driver attaches to the device. So | ||
1552 | * disable all e100 interrupts here. The driver will | ||
1553 | * re-enable them when it's ready. | ||
1554 | */ | ||
1555 | pci_read_config_word(dev, PCI_COMMAND, &command); | ||
1556 | pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &bar); | ||
1557 | |||
1558 | if (!(command & PCI_COMMAND_MEMORY) || !bar) | ||
1559 | return; | ||
1560 | |||
1561 | csr = ioremap(bar, 8); | ||
1562 | if (!csr) { | ||
1563 | printk(KERN_WARNING "PCI: Can't map %s e100 registers\n", | ||
1564 | pci_name(dev)); | ||
1565 | return; | ||
1566 | } | ||
1567 | |||
1568 | cmd_hi = readb(csr + 3); | ||
1569 | if (cmd_hi == 0) { | ||
1570 | printk(KERN_WARNING "PCI: Firmware left %s e100 interrupts " | ||
1571 | "enabled, disabling\n", pci_name(dev)); | ||
1572 | writeb(1, csr + 3); | ||
1573 | } | ||
1574 | |||
1575 | iounmap(csr); | ||
1576 | } | ||
1577 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, quirk_e100_interrupt); | ||
1514 | 1578 | ||
1515 | static void __devinit fixup_rev1_53c810(struct pci_dev* dev) | 1579 | static void __devinit fixup_rev1_53c810(struct pci_dev* dev) |
1516 | { | 1580 | { |
diff --git a/drivers/pci/search.c b/drivers/pci/search.c index 622b3f8ba820..d529462d1b53 100644 --- a/drivers/pci/search.c +++ b/drivers/pci/search.c | |||
@@ -41,7 +41,7 @@ pci_do_find_bus(struct pci_bus* bus, unsigned char busnr) | |||
41 | * in the global list of PCI buses. If the bus is found, a pointer to its | 41 | * in the global list of PCI buses. If the bus is found, a pointer to its |
42 | * data structure is returned. If no bus is found, %NULL is returned. | 42 | * data structure is returned. If no bus is found, %NULL is returned. |
43 | */ | 43 | */ |
44 | struct pci_bus * __devinit pci_find_bus(int domain, int busnr) | 44 | struct pci_bus * pci_find_bus(int domain, int busnr) |
45 | { | 45 | { |
46 | struct pci_bus *bus = NULL; | 46 | struct pci_bus *bus = NULL; |
47 | struct pci_bus *tmp_bus; | 47 | struct pci_bus *tmp_bus; |
@@ -61,7 +61,7 @@ struct pci_bus * __devinit pci_find_bus(int domain, int busnr) | |||
61 | * @from: Previous PCI bus found, or %NULL for new search. | 61 | * @from: Previous PCI bus found, or %NULL for new search. |
62 | * | 62 | * |
63 | * Iterates through the list of known PCI busses. A new search is | 63 | * Iterates through the list of known PCI busses. A new search is |
64 | * initiated by passing %NULL to the @from argument. Otherwise if | 64 | * initiated by passing %NULL as the @from argument. Otherwise if |
65 | * @from is not %NULL, searches continue from next device on the | 65 | * @from is not %NULL, searches continue from next device on the |
66 | * global list. | 66 | * global list. |
67 | */ | 67 | */ |
@@ -148,13 +148,14 @@ struct pci_dev * pci_get_slot(struct pci_bus *bus, unsigned int devfn) | |||
148 | * @from: Previous PCI device found in search, or %NULL for new search. | 148 | * @from: Previous PCI device found in search, or %NULL for new search. |
149 | * | 149 | * |
150 | * Iterates through the list of known PCI devices. If a PCI device is | 150 | * Iterates through the list of known PCI devices. If a PCI device is |
151 | * found with a matching @vendor, @device, @ss_vendor and @ss_device, a pointer to its | 151 | * found with a matching @vendor, @device, @ss_vendor and @ss_device, a |
152 | * device structure is returned. Otherwise, %NULL is returned. | 152 | * pointer to its device structure is returned. Otherwise, %NULL is returned. |
153 | * A new search is initiated by passing %NULL to the @from argument. | 153 | * A new search is initiated by passing %NULL as the @from argument. |
154 | * Otherwise if @from is not %NULL, searches continue from next device on the global list. | 154 | * Otherwise if @from is not %NULL, searches continue from next device |
155 | * on the global list. | ||
155 | * | 156 | * |
156 | * NOTE: Do not use this function anymore, use pci_get_subsys() instead, as | 157 | * NOTE: Do not use this function any more; use pci_get_subsys() instead, as |
157 | * the pci device returned by this function can disappear at any moment in | 158 | * the PCI device returned by this function can disappear at any moment in |
158 | * time. | 159 | * time. |
159 | */ | 160 | */ |
160 | static struct pci_dev * pci_find_subsys(unsigned int vendor, | 161 | static struct pci_dev * pci_find_subsys(unsigned int vendor, |
@@ -191,14 +192,15 @@ exit: | |||
191 | * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids | 192 | * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids |
192 | * @from: Previous PCI device found in search, or %NULL for new search. | 193 | * @from: Previous PCI device found in search, or %NULL for new search. |
193 | * | 194 | * |
194 | * Iterates through the list of known PCI devices. If a PCI device is | 195 | * Iterates through the list of known PCI devices. If a PCI device is found |
195 | * found with a matching @vendor and @device, a pointer to its device structure is | 196 | * with a matching @vendor and @device, a pointer to its device structure is |
196 | * returned. Otherwise, %NULL is returned. | 197 | * returned. Otherwise, %NULL is returned. |
197 | * A new search is initiated by passing %NULL to the @from argument. | 198 | * A new search is initiated by passing %NULL as the @from argument. |
198 | * Otherwise if @from is not %NULL, searches continue from next device on the global list. | 199 | * Otherwise if @from is not %NULL, searches continue from next device |
200 | * on the global list. | ||
199 | * | 201 | * |
200 | * NOTE: Do not use this function anymore, use pci_get_device() instead, as | 202 | * NOTE: Do not use this function any more; use pci_get_device() instead, as |
201 | * the pci device returned by this function can disappear at any moment in | 203 | * the PCI device returned by this function can disappear at any moment in |
202 | * time. | 204 | * time. |
203 | */ | 205 | */ |
204 | struct pci_dev * | 206 | struct pci_dev * |
@@ -215,11 +217,11 @@ pci_find_device(unsigned int vendor, unsigned int device, const struct pci_dev * | |||
215 | * @ss_device: PCI subsystem device id to match, or %PCI_ANY_ID to match all device ids | 217 | * @ss_device: PCI subsystem device id to match, or %PCI_ANY_ID to match all device ids |
216 | * @from: Previous PCI device found in search, or %NULL for new search. | 218 | * @from: Previous PCI device found in search, or %NULL for new search. |
217 | * | 219 | * |
218 | * Iterates through the list of known PCI devices. If a PCI device is | 220 | * Iterates through the list of known PCI devices. If a PCI device is found |
219 | * found with a matching @vendor, @device, @ss_vendor and @ss_device, a pointer to its | 221 | * with a matching @vendor, @device, @ss_vendor and @ss_device, a pointer to its |
220 | * device structure is returned, and the reference count to the device is | 222 | * device structure is returned, and the reference count to the device is |
221 | * incremented. Otherwise, %NULL is returned. A new search is initiated by | 223 | * incremented. Otherwise, %NULL is returned. A new search is initiated by |
222 | * passing %NULL to the @from argument. Otherwise if @from is not %NULL, | 224 | * passing %NULL as the @from argument. Otherwise if @from is not %NULL, |
223 | * searches continue from next device on the global list. | 225 | * searches continue from next device on the global list. |
224 | * The reference count for @from is always decremented if it is not %NULL. | 226 | * The reference count for @from is always decremented if it is not %NULL. |
225 | */ | 227 | */ |
@@ -262,7 +264,7 @@ exit: | |||
262 | * found with a matching @vendor and @device, the reference count to the | 264 | * found with a matching @vendor and @device, the reference count to the |
263 | * device is incremented and a pointer to its device structure is returned. | 265 | * device is incremented and a pointer to its device structure is returned. |
264 | * Otherwise, %NULL is returned. A new search is initiated by passing %NULL | 266 | * Otherwise, %NULL is returned. A new search is initiated by passing %NULL |
265 | * to the @from argument. Otherwise if @from is not %NULL, searches continue | 267 | * as the @from argument. Otherwise if @from is not %NULL, searches continue |
266 | * from next device on the global list. The reference count for @from is | 268 | * from next device on the global list. The reference count for @from is |
267 | * always decremented if it is not %NULL. | 269 | * always decremented if it is not %NULL. |
268 | */ | 270 | */ |
@@ -279,11 +281,13 @@ pci_get_device(unsigned int vendor, unsigned int device, struct pci_dev *from) | |||
279 | * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids | 281 | * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids |
280 | * @from: Previous PCI device found in search, or %NULL for new search. | 282 | * @from: Previous PCI device found in search, or %NULL for new search. |
281 | * | 283 | * |
282 | * Iterates through the list of known PCI devices in the reverse order of pci_find_device(). | 284 | * Iterates through the list of known PCI devices in the reverse order of |
285 | * pci_find_device(). | ||
283 | * If a PCI device is found with a matching @vendor and @device, a pointer to | 286 | * If a PCI device is found with a matching @vendor and @device, a pointer to |
284 | * its device structure is returned. Otherwise, %NULL is returned. | 287 | * its device structure is returned. Otherwise, %NULL is returned. |
285 | * A new search is initiated by passing %NULL to the @from argument. | 288 | * A new search is initiated by passing %NULL as the @from argument. |
286 | * Otherwise if @from is not %NULL, searches continue from previous device on the global list. | 289 | * Otherwise if @from is not %NULL, searches continue from previous device |
290 | * on the global list. | ||
287 | */ | 291 | */ |
288 | struct pci_dev * | 292 | struct pci_dev * |
289 | pci_find_device_reverse(unsigned int vendor, unsigned int device, const struct pci_dev *from) | 293 | pci_find_device_reverse(unsigned int vendor, unsigned int device, const struct pci_dev *from) |
@@ -317,7 +321,7 @@ exit: | |||
317 | * found with a matching @class, the reference count to the device is | 321 | * found with a matching @class, the reference count to the device is |
318 | * incremented and a pointer to its device structure is returned. | 322 | * incremented and a pointer to its device structure is returned. |
319 | * Otherwise, %NULL is returned. | 323 | * Otherwise, %NULL is returned. |
320 | * A new search is initiated by passing %NULL to the @from argument. | 324 | * A new search is initiated by passing %NULL as the @from argument. |
321 | * Otherwise if @from is not %NULL, searches continue from next device | 325 | * Otherwise if @from is not %NULL, searches continue from next device |
322 | * on the global list. The reference count for @from is always decremented | 326 | * on the global list. The reference count for @from is always decremented |
323 | * if it is not %NULL. | 327 | * if it is not %NULL. |