aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 14:49:46 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 14:49:46 -0400
commitdd77a4ee0f3981693d4229aa1d57cea9e526ff47 (patch)
treecb486be20b950201103a03636cbb1e1d180f0098 /drivers/pci
parente8216dee838c09776680a6f1a2e54d81f3cdfa14 (diff)
parent7e9f4b2d3e21e87c26025810413ef1592834e63b (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (47 commits) Driver core: Don't call put methods while holding a spinlock Driver core: Remove unneeded routines from driver core Driver core: Fix potential deadlock in driver core PCI: enable driver multi-threaded probe Driver Core: add ability for drivers to do a threaded probe sysfs: add proper sysfs_init() prototype drivers/base: check errors drivers/base: Platform notify needs to occur before drivers attach to the device v4l-dev2: handle __must_check add CONFIG_ENABLE_MUST_CHECK add __must_check to device management code Driver core: fixed add_bind_files() definition Driver core: fix comments in drivers/base/power/resume.c sysfs_remove_bin_file: no return value, dump_stack on error kobject: must_check fixes Driver core: add ability for devices to create and remove bin files Class: add support for class interfaces for devices Driver core: create devices/virtual/ tree Driver core: add device_rename function Driver core: add ability for classes to handle devices properly ...
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/Kconfig25
-rw-r--r--drivers/pci/hotplug/acpiphp_ibm.c4
-rw-r--r--drivers/pci/pci-driver.c38
-rw-r--r--drivers/pci/pci.c4
4 files changed, 66 insertions, 5 deletions
diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index 4d762fc4878c..c27e782e6df9 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -17,6 +17,31 @@ config PCI_MSI
17 17
18 If you don't know what to do here, say N. 18 If you don't know what to do here, say N.
19 19
20config PCI_MULTITHREAD_PROBE
21 bool "PCI Multi-threaded probe (EXPERIMENTAL)"
22 depends on PCI && EXPERIMENTAL
23 help
24 Say Y here if you want the PCI core to spawn a new thread for
25 every PCI device that is probed. This can cause a huge
26 speedup in boot times on multiprocessor machines, and even a
27 smaller speedup on single processor machines.
28
29 But it can also cause lots of bad things to happen. A number
30 of PCI drivers can not properly handle running in this way,
31 some will just not work properly at all, while others might
32 decide to blow up power supplies with a huge load all at once,
33 so use this option at your own risk.
34
35 It is very unwise to use this option if you are not using a
36 boot process that can handle devices being created in any
37 order. A program that can create persistant block and network
38 device names (like udev) is a good idea if you wish to use
39 this option.
40
41 Again, use this option at your own risk, you have been warned!
42
43 When in doubt, say N.
44
20config PCI_DEBUG 45config PCI_DEBUG
21 bool "PCI Debugging" 46 bool "PCI Debugging"
22 depends on PCI && DEBUG_KERNEL 47 depends on PCI && DEBUG_KERNEL
diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c
index 317457dd4014..d0a07d9ab30c 100644
--- a/drivers/pci/hotplug/acpiphp_ibm.c
+++ b/drivers/pci/hotplug/acpiphp_ibm.c
@@ -487,9 +487,7 @@ static void __exit ibm_acpiphp_exit(void)
487 if (ACPI_FAILURE(status)) 487 if (ACPI_FAILURE(status))
488 err("%s: Notification handler removal failed\n", __FUNCTION__); 488 err("%s: Notification handler removal failed\n", __FUNCTION__);
489 /* remove the /sys entries */ 489 /* remove the /sys entries */
490 if (sysfs_remove_bin_file(sysdir, &ibm_apci_table_attr)) 490 sysfs_remove_bin_file(sysdir, &ibm_apci_table_attr);
491 err("%s: removal of sysfs file apci_table failed\n",
492 __FUNCTION__);
493} 491}
494 492
495module_init(ibm_acpiphp_init); 493module_init(ibm_acpiphp_init);
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 474e9cd0e9e4..d8ace1f90dd2 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -17,6 +17,16 @@
17 * Registration of PCI drivers and handling of hot-pluggable devices. 17 * Registration of PCI drivers and handling of hot-pluggable devices.
18 */ 18 */
19 19
20/* multithreaded probe logic */
21static int pci_multithread_probe =
22#ifdef CONFIG_PCI_MULTITHREAD_PROBE
23 1;
24#else
25 0;
26#endif
27__module_param_call("", pci_multithread_probe, param_set_bool, param_get_bool, &pci_multithread_probe, 0644);
28
29
20/* 30/*
21 * Dynamic device IDs are disabled for !CONFIG_HOTPLUG 31 * Dynamic device IDs are disabled for !CONFIG_HOTPLUG
22 */ 32 */
@@ -279,6 +289,18 @@ static int pci_device_suspend(struct device * dev, pm_message_t state)
279 return i; 289 return i;
280} 290}
281 291
292static int pci_device_suspend_late(struct device * dev, pm_message_t state)
293{
294 struct pci_dev * pci_dev = to_pci_dev(dev);
295 struct pci_driver * drv = pci_dev->driver;
296 int i = 0;
297
298 if (drv && drv->suspend_late) {
299 i = drv->suspend_late(pci_dev, state);
300 suspend_report_result(drv->suspend_late, i);
301 }
302 return i;
303}
282 304
283/* 305/*
284 * Default resume method for devices that have no driver provided resume, 306 * Default resume method for devices that have no driver provided resume,
@@ -313,6 +335,17 @@ static int pci_device_resume(struct device * dev)
313 return error; 335 return error;
314} 336}
315 337
338static int pci_device_resume_early(struct device * dev)
339{
340 int error = 0;
341 struct pci_dev * pci_dev = to_pci_dev(dev);
342 struct pci_driver * drv = pci_dev->driver;
343
344 if (drv && drv->resume_early)
345 error = drv->resume_early(pci_dev);
346 return error;
347}
348
316static void pci_device_shutdown(struct device *dev) 349static void pci_device_shutdown(struct device *dev)
317{ 350{
318 struct pci_dev *pci_dev = to_pci_dev(dev); 351 struct pci_dev *pci_dev = to_pci_dev(dev);
@@ -385,6 +418,7 @@ int __pci_register_driver(struct pci_driver *drv, struct module *owner)
385 drv->driver.bus = &pci_bus_type; 418 drv->driver.bus = &pci_bus_type;
386 drv->driver.owner = owner; 419 drv->driver.owner = owner;
387 drv->driver.kobj.ktype = &pci_driver_kobj_type; 420 drv->driver.kobj.ktype = &pci_driver_kobj_type;
421 drv->driver.multithread_probe = pci_multithread_probe;
388 422
389 spin_lock_init(&drv->dynids.lock); 423 spin_lock_init(&drv->dynids.lock);
390 INIT_LIST_HEAD(&drv->dynids.list); 424 INIT_LIST_HEAD(&drv->dynids.list);
@@ -509,8 +543,10 @@ struct bus_type pci_bus_type = {
509 .probe = pci_device_probe, 543 .probe = pci_device_probe,
510 .remove = pci_device_remove, 544 .remove = pci_device_remove,
511 .suspend = pci_device_suspend, 545 .suspend = pci_device_suspend,
512 .shutdown = pci_device_shutdown, 546 .suspend_late = pci_device_suspend_late,
547 .resume_early = pci_device_resume_early,
513 .resume = pci_device_resume, 548 .resume = pci_device_resume,
549 .shutdown = pci_device_shutdown,
514 .dev_attrs = pci_dev_attrs, 550 .dev_attrs = pci_dev_attrs,
515}; 551};
516 552
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 9f79dd6d51ab..8ab027886034 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -432,10 +432,12 @@ pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state)
432 case PM_EVENT_ON: 432 case PM_EVENT_ON:
433 return PCI_D0; 433 return PCI_D0;
434 case PM_EVENT_FREEZE: 434 case PM_EVENT_FREEZE:
435 case PM_EVENT_PRETHAW:
436 /* REVISIT both freeze and pre-thaw "should" use D0 */
435 case PM_EVENT_SUSPEND: 437 case PM_EVENT_SUSPEND:
436 return PCI_D3hot; 438 return PCI_D3hot;
437 default: 439 default:
438 printk("They asked me for state %d\n", state.event); 440 printk("Unrecognized suspend event %d\n", state.event);
439 BUG(); 441 BUG();
440 } 442 }
441 return PCI_D0; 443 return PCI_D0;