From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Diehl Date: Wed, 06 Mar 2002 01:31:15 +0000 Subject: Re: [PATCH] PCI device list locking Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Mon, 4 Mar 2002, Greg KH wrote: > > + spin_lock(&pcidevlist_lock); > > pci_for_each_dev(dev) { > > if (!pci_dev_driver(dev)) > > count += pci_announce_device(drv, dev); > > } > > + spin_unlock(&pcidevlist_lock); > > pci_announce_device() calls the pci driver's probe() function, which can > easily sleep. Not a good thing :( Unless I missed something even a semaphore might deadlock then: think of a pci driver for bridge-type device which has devices already attached when probed - for example cardbus (or hotplug) controller with device on the downside. If the devices are found during probe(), the driver might want to just add them in one go. Martin _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel