Thread (15 messages) 15 messages, 4 authors, 2013-05-15

Re: [PATCH v2, part 1 3/9] PCI: Convert alloc_pci_dev(void) to pci_alloc_dev(bus) instead

From: Liu Jiang <hidden>
Date: 2013-05-15 14:46:21
Also in: linux-pci, linux-scsi, lkml, sparclinux

On Wed 15 May 2013 10:43:02 PM CST, Yinghai Lu wrote:
On Wed, May 15, 2013 at 7:39 AM, Liu Jiang [off-list ref] wrote:
quoted
On Wed 15 May 2013 02:52:51 AM CST, Yinghai Lu wrote:
quoted
On Tue, May 14, 2013 at 9:57 AM, Liu Jiang [off-list ref] wrote:
quoted
On Tue 14 May 2013 11:10:33 PM CST, Yinghai Lu wrote:
quoted

On Tue, May 14, 2013 at 7:59 AM, Liu Jiang [off-list ref] wrote:
quoted

On 05/14/2013 04:26 PM, Gu Zheng wrote:
       I suggest to use pci_release_dev() instead because it also needs
to
release OF related resources.
I will update it in next version.
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index bc075a3..2ac6338 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1281,7 +1281,7 @@ static struct pci_dev *pci_scan_device(struct
pci_bus
*bus
           pci_set_of_node(dev);

           if (pci_setup_device(dev)) {
-               kfree(dev);
+               pci_release_dev(&dev->dev);
                   return NULL;


no, should move pci_set_of_node calling into pci_setup_device.

Yinghai


I'm not sure whether we should call pci_set_of_node() for SR-IOV devices
too,
any suggestions here?

or just move down pci_set_of_node after pci_setup_device?

anyway that is another bug.
quoted
I'm not familiar with the OF logic and can't make sure whether
pci_setup_device()
has dependency on dev->of_node. Feel it's more safe to call
pci_release_of_node()
on failing path instead of tuning call-site of pci_set_of_node().
that is another bug, let of guy handle it.

Yinghai
Hi Yinghai,
       I don't know any OF exports, could you please help to CC
some OF experts?
Thanks,
Gerry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help