summaryrefslogtreecommitdiff
path: root/drivers/pci/hotplug/pci_hotplug_core.c
AgeCommit message (Collapse)Author
2008-05-27pci hotplug core: add check of duplicate slot nameKenji Kaneshige
Fix the following errors reported by Jan C. Nordholz in http://bugzilla.kernel.org/show_bug.cgi?id=10751. kobject_add_internal failed for 2 with -EEXIST, don't try to register things with the same name in the same directory. Pid: 1, comm: swapper Tainted: G W 2.6.26-rc3 #1 [<c0266980>] kobject_add_internal+0x140/0x190 [<c0266afd>] kobject_init_and_add+0x2d/0x40 [<c027bc91>] pci_hp_register+0x81/0x2f0 [<c027fd07>] pciehp_probe+0x1a7/0x470 [<c01b3b84>] sysfs_add_one+0x44/0xa0 [<c01b3c1f>] sysfs_addrm_start+0x3f/0xb0 [<c01b497a>] sysfs_create_link+0x8a/0xf0 [<c0279570>] pcie_port_probe_service+0x50/0x80 [<c02e0545>] driver_sysfs_add+0x55/0x70 [<c02e0662>] driver_probe_device+0x82/0x180 [<c02e07cc>] __driver_attach+0x6c/0x70 [<c02dfe0a>] bus_for_each_dev+0x3a/0x60 [<c05db2d0>] pcied_init+0x0/0x80 [<c02e04e6>] driver_attach+0x16/0x20 [<c02e0760>] __driver_attach+0x0/0x70 [<c02e0341>] bus_add_driver+0x1a1/0x220 [<c05db2d0>] pcied_init+0x0/0x80 [<c02e09cd>] driver_register+0x4d/0x120 [<c05db050>] ibm_acpiphp_init+0x0/0x190 [<c0125aab>] printk+0x1b/0x20 [<c05db2d0>] pcied_init+0x0/0x80 [<c05db2de>] pcied_init+0xe/0x80 [<c05c751a>] kernel_init+0x10a/0x300 [<c0120138>] schedule_tail+0x18/0x50 [<c0103b9a>] ret_from_fork+0x6/0x1c [<c05c7410>] kernel_init+0x0/0x300 [<c05c7410>] kernel_init+0x0/0x300 [<c010485b>] kernel_thread_helper+0x7/0x1c ======================= pci_hotplug: Unable to register kobject '2'<3>pciehp: pci_hp_register failed with error -22 Slot with the same name can be registered multiple times if shpchp or pciehp driver is loaded after acpiphp is loaded because ACPI based hotplug driver and Native OS hotplug driver trying to handle the same physical slot. In this case, current pci_hotplug core will call kobject_init_and_add() muliple time with the same name. This is the cause of this problem. To fix this problem, this patch adds the check into pci_hp_register() to see if the slot with the same name. Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2008-04-20PCI: replace remaining __FUNCTION__ occurrencesHarvey Harrison
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01PCI: Add missing "space" in printk messagesJoe Perches
Signed-off-by: Joe Perches <joe@perches.com> Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01PCI: hotplug: pci_hotplug_core whitespace fixAlex Chiang
Remove superfluous space. Signed-off-by: Alex Chiang <achiang@hp.com> Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-01-24Kobject: convert drivers/* from kobject_unregister() to kobject_put()Greg Kroah-Hartman
There is no need for kobject_unregister() anymore, thanks to Kay's kobject cleanup changes, so replace all instances of it with kobject_put(). Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-01-24driver core: add way to get to bus ksetGreg Kroah-Hartman
This allows an easier way to get to the kset associated with a struct bus_type (you have three to choose from...) This will make it easier to move these fields to be dynamic in a future patch. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-01-24Kobject: change drivers/pci/hotplug/pci_hotplug_core.c to use ↵Greg Kroah-Hartman
kobject_init_and_add Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-01-24kset: convert pci hotplug to use kset_create_and_addGreg Kroah-Hartman
This also renames pci_hotplug_slots_subsys to pcis_hotplug_slots_kset catch all current users with a build error instead of a build warning which can easily be missed. Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-01-24kobject: remove struct kobj_type from struct ksetGreg Kroah-Hartman
We don't need a "default" ktype for a kset. We should set this explicitly every time for each kset. This change is needed so that we can make ksets dynamic, and cleans up one of the odd, undocumented assumption that the kset/kobject/ktype model has. This patch is based on a lot of help from Kay Sievers. Nasty bug in the block code was found by Dave Young <hidave.darkstar@gmail.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Dave Young <hidave.darkstar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-10-15Get rid of unused variable warning in drivers/pci/hotplug/pci_hotplug_core.cLinus Torvalds
Commit 5a7ad7f044941316dc98eda2a087a12a7a50649d removed all uses of 'retval', but didn't remove the variable itself. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-12sysfs: kill sysfs_update_file()Tejun Heo
sysfs_update_file() depends on inode->i_mtime but sysfs iondes are now reclaimable making the reported modification time unreliable. There's only one user (pci hotplug) of this notification mechanism and it reportedly isn't utilized from userland. Kill sysfs_update_file(). Signed-off-by: Tejun Heo <htejun@gmail.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-05-08header cleaning: don't include smp_lock.h when not usedRandy Dunlap
Remove includes of <linux/smp_lock.h> where it is not used/needed. Suggested by Al Viro. Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc, sparc64, and arm (all 59 defconfigs). Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-02remove "struct subsystem" as it is no longer neededGreg Kroah-Hartman
We need to work on cleaning up the relationship between kobjects, ksets and ktypes. The removal of 'struct subsystem' is the first step of this, especially as it is not really needed at all. Thanks to Kay for fixing the bugs in this patch. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-18PCI Hotplug: move pci_hotplug.h to include/linux/Greg Kroah-Hartman
This makes it possible to build pci hotplug drivers outside of the main kernel tree, and Sam keeps telling me to move local header files to their proper places... Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-10-18change pci hotplug subsystem maintainer to KristenKristen Carlson Accardi
Here's a patch adding me to the maintainers file for the pci hotplug subsystem, as we discussed. Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-26PCI Hotplug: fix __must_check warningsGreg Kroah-Hartman
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-06-30Remove obsolete #include <linux/config.h>Jörn Engel
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2005-06-20[PATCH] sysfs: (driver/pci) if show/store is missing return -EIODmitry Torokhov
sysfs: fix drivers/pci so if an attribute does not implement show or store method read/write will return -EIO instead of 0. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-04-16Linux-2.6.12-rc2v2.6.12-rc2Linus Torvalds
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!