linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* A question about the patch: [PATCH] PCI/PM: Keep runtime PM enabled for unbound PCI devices
@ 2013-11-13 13:09 mike
  2013-11-13 16:47 ` Bjorn Helgaas
  0 siblings, 1 reply; 16+ messages in thread
From: mike @ 2013-11-13 13:09 UTC (permalink / raw)
  To: ying.huang; +Cc: bhelgaas, stern, linux-pci

Hi Huang Ying,

I see you are the author of this patch, commit id is:
967577b062417b4e4b8e27b711220f4124f5153a

I have a question while I try to understand this patch,
So I would very grateful if you or others can give me some reply.....

............
-       rc = ddi->drv->probe(ddi->dev, ddi->id);
+       pm_runtime_get_sync(dev);
+       pci_dev->driver = pci_drv;
^^^^^^^^^^^^^^^^^^^^^^^^^^
I see here you make the driver to initialize before probe,
But I have no idea of why you do this change.....

and I look inside the code, it may be pm_runtime relate??

Thanks
Mike
+       rc = pci_drv->probe(pci_dev, ddi->id);
         if (rc) {
-               pm_runtime_disable(dev);
-               pm_runtime_set_suspended(dev);
-               pm_runtime_put_noidle(dev);
+               pci_dev->driver = NULL;
+               pm_runtime_put_sync(dev);
         }
-       if (parent)
-               pm_runtime_put(parent);
         return rc;
  }

@@ -330,10 +325,8 @@ __pci_device_probe(struct pci_driver *drv, struct 
pci_dev *pci_dev)
                 id = pci_match_device(drv, pci_dev);
                 if (id)
                         error = pci_call_probe(drv, pci_dev, id);
-               if (error >= 0) {
-                       pci_dev->driver = drv;
+               if (error >= 0)
                         error = 0;
-               }
         }
         return error;
  }
.......................


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2013-11-27 14:02 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-13 13:09 A question about the patch: [PATCH] PCI/PM: Keep runtime PM enabled for unbound PCI devices mike
2013-11-13 16:47 ` Bjorn Helgaas
2013-11-13 19:20   ` Alan Stern
2013-11-14  3:23     ` mike
2013-11-14  5:59       ` Huang Ying
2013-11-14  7:19         ` mike
2013-11-14  7:53           ` Huang Ying
2013-11-14  8:12             ` mike
2013-11-14  8:25               ` Huang Ying
2013-11-14  8:37                 ` mike
2013-11-14  8:54                   ` Huang Ying
2013-11-26  5:41                     ` Mike Qiu
2013-11-26 20:32                       ` Rafael J. Wysocki
2013-11-27  5:32                         ` Mike Qiu
2013-11-27  6:31                           ` Huang Ying
2013-11-27 14:15                             ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).