From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org, pcihpd-discuss@lists.sourceforge.net
Subject: Re: [PATCH] PCI hotplug changes for 2.5.63
Date: Mon, 24 Feb 2003 17:16 -0800 [thread overview]
Message-ID: <1046135762798@kroah.com> (raw)
In-Reply-To: <1046135760965@kroah.com>
ChangeSet 1.1022.1.4, 2003/02/24 16:26:14-08:00, greg@kroah.com
[PATCH] PCI Hotplug: remove the list_lock, as we rely on sysfs to detect any duplicate slot names.
diff -Nru a/drivers/hotplug/pci_hotplug_core.c b/drivers/hotplug/pci_hotplug_core.c
--- a/drivers/hotplug/pci_hotplug_core.c Mon Feb 24 17:15:50 2003
+++ b/drivers/hotplug/pci_hotplug_core.c Mon Feb 24 17:15:50 2003
@@ -67,8 +67,6 @@
//////////////////////////////////////////////////////////////////
-static spinlock_t list_lock;
-
static LIST_HEAD(pci_hotplug_slot_list);
static struct subsystem hotplug_slots_subsys;
@@ -531,23 +529,16 @@
if ((slot->info == NULL) || (slot->ops == NULL))
return -EINVAL;
- /* make sure we have not already registered this slot */
- spin_lock (&list_lock);
- if (get_slot_from_name (slot->name) != NULL) {
- spin_unlock (&list_lock);
- return -EINVAL;
- }
-
strncpy(slot->kobj.name, slot->name, KOBJ_NAME_LEN);
kobj_set_kset_s(slot, hotplug_slots_subsys);
+ /* this can fail if we have already registered a slot with the same name */
if (kobject_register(&slot->kobj)) {
err("Unable to register kobject");
return -EINVAL;
}
list_add (&slot->slot_list, &pci_hotplug_slot_list);
- spin_unlock (&list_lock);
result = fs_add_slot (slot);
dbg ("Added slot %s to the list\n", slot->name);
@@ -570,16 +561,11 @@
if (slot == NULL)
return -ENODEV;
- /* make sure we have this slot in our list before trying to delete it */
- spin_lock (&list_lock);
temp = get_slot_from_name (slot->name);
if (temp != slot) {
- spin_unlock (&list_lock);
return -ENODEV;
}
-
list_del (&slot->slot_list);
- spin_unlock (&list_lock);
fs_remove_slot (slot);
dbg ("Removed slot %s from the list\n", slot->name);
@@ -638,8 +624,6 @@
static int __init pci_hotplug_init (void)
{
int result;
-
- spin_lock_init(&list_lock);
kset_set_kset_s(&hotplug_slots_subsys, pci_bus_type.subsys);
result = subsystem_register(&hotplug_slots_subsys);
next prev parent reply other threads:[~2003-02-25 1:15 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-25 1:13 [BK PATCH] PCI hotplug changes for 2.5.63 Greg KH
2003-02-25 1:15 ` [PATCH] " Greg KH
2003-02-25 1:15 ` Greg KH
2003-02-25 1:16 ` Greg KH
2003-02-25 1:16 ` Greg KH [this message]
2003-02-25 1:16 ` Greg KH
2003-02-25 1:16 ` Greg KH
2003-02-25 1:16 ` Greg KH
2003-02-25 1:16 ` Greg KH
2003-02-25 1:16 ` Greg KH
2003-02-25 1:16 ` Greg KH
2003-02-25 1:16 ` Greg KH
2003-02-25 1:16 ` Greg KH
2003-02-25 1:16 ` Greg KH
2003-02-25 1:16 ` Greg KH
2003-02-28 23:59 ` [BK PATCH] " Greg KH
2003-03-01 18:55 ` Linus Torvalds
2003-03-01 21:38 ` Greg KH
2003-03-01 22:00 ` Linus Torvalds
2003-03-01 22:25 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1046135762798@kroah.com \
--to=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pcihpd-discuss@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.