diff mbox

[v2,6/6] ASoC: Intel: Skylake: remove call to pci_dev_put

Message ID 1458040168-3769-7-git-send-email-vinod.koul@intel.com (mailing list archive)
State Accepted
Commit 36e7972c0d3f8819a5d9335c36c5dcd168cd2b72
Headers show

Commit Message

Vinod Koul March 15, 2016, 11:09 a.m. UTC
In driver remove we call pci_dev_put(), that is not required as we never
call pci_dev_get() so remove that.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/skylake/skl.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Mark Brown March 16, 2016, 10:08 a.m. UTC | #1
On Tue, Mar 15, 2016 at 04:39:28PM +0530, Vinod Koul wrote:
> In driver remove we call pci_dev_put(), that is not required as we never
> call pci_dev_get() so remove that.

Why is the fix for this not to call pci_dev_get()?
Vinod Koul March 16, 2016, 10:52 a.m. UTC | #2
On Wed, Mar 16, 2016 at 10:08:29AM +0000, Mark Brown wrote:
> On Tue, Mar 15, 2016 at 04:39:28PM +0530, Vinod Koul wrote:
> > In driver remove we call pci_dev_put(), that is not required as we never
> > call pci_dev_get() so remove that.
> 
> Why is the fix for this not to call pci_dev_get()?

Why do I need either, I see no reason why driver should be doing this,
so removed :)
Mark Brown March 16, 2016, 11:03 a.m. UTC | #3
On Wed, Mar 16, 2016 at 04:22:44PM +0530, Vinod Koul wrote:
> On Wed, Mar 16, 2016 at 10:08:29AM +0000, Mark Brown wrote:

> > Why is the fix for this not to call pci_dev_get()?

> Why do I need either, I see no reason why driver should be doing this,
> so removed :)

Well, the PCI documentation says that drivers are expected to record a
reference to their devices in probe().  This is a bit unusual given that
normally the driver core takes a reference to the device for us but
presumably there's some reason for this?
Takashi Iwai March 16, 2016, 11:35 a.m. UTC | #4
On Wed, 16 Mar 2016 12:03:10 +0100,
Mark Brown wrote:
> 
> On Wed, Mar 16, 2016 at 04:22:44PM +0530, Vinod Koul wrote:
> > On Wed, Mar 16, 2016 at 10:08:29AM +0000, Mark Brown wrote:
> 
> > > Why is the fix for this not to call pci_dev_get()?
> 
> > Why do I need either, I see no reason why driver should be doing this,
> > so removed :)
> 
> Well, the PCI documentation says that drivers are expected to record a
> reference to their devices in probe().  This is a bit unusual given that
> normally the driver core takes a reference to the device for us but
> presumably there's some reason for this?

Maybe the document is obsoleted.  The PCI core, at least the probe /
remove via the normal PCI bus, takes pci_dev_get() and pci_dev_put()
already there.


Takashi
Vinod Koul March 16, 2016, 2:44 p.m. UTC | #5
On Wed, Mar 16, 2016 at 12:35:08PM +0100, Takashi Iwai wrote:
> On Wed, 16 Mar 2016 12:03:10 +0100,
> Mark Brown wrote:
> > 
> > On Wed, Mar 16, 2016 at 04:22:44PM +0530, Vinod Koul wrote:
> > > On Wed, Mar 16, 2016 at 10:08:29AM +0000, Mark Brown wrote:
> > 
> > > > Why is the fix for this not to call pci_dev_get()?
> > 
> > > Why do I need either, I see no reason why driver should be doing this,
> > > so removed :)
> > 
> > Well, the PCI documentation says that drivers are expected to record a
> > reference to their devices in probe().  This is a bit unusual given that
> > normally the driver core takes a reference to the device for us but
> > presumably there's some reason for this?
> 
> Maybe the document is obsoleted.  The PCI core, at least the probe /
> remove via the normal PCI bus, takes pci_dev_get() and pci_dev_put()
> already there.

Yes that is my understanding too, that is why we removed this from driver
here..

Mark, is this fine now?
Mark Brown March 16, 2016, 2:57 p.m. UTC | #6
On Wed, Mar 16, 2016 at 08:14:05PM +0530, Vinod Koul wrote:
> On Wed, Mar 16, 2016 at 12:35:08PM +0100, Takashi Iwai wrote:

> > Maybe the document is obsoleted.  The PCI core, at least the probe /
> > remove via the normal PCI bus, takes pci_dev_get() and pci_dev_put()
> > already there.

> Yes that is my understanding too, that is why we removed this from driver
> here..

> Mark, is this fine now?

You might want to put some of this analysis in the changelog.
Vinod Koul March 16, 2016, 3:54 p.m. UTC | #7
On Wed, Mar 16, 2016 at 02:57:53PM +0000, Mark Brown wrote:
> On Wed, Mar 16, 2016 at 08:14:05PM +0530, Vinod Koul wrote:
> > On Wed, Mar 16, 2016 at 12:35:08PM +0100, Takashi Iwai wrote:
> 
> > > Maybe the document is obsoleted.  The PCI core, at least the probe /
> > > remove via the normal PCI bus, takes pci_dev_get() and pci_dev_put()
> > > already there.
> 
> > Yes that is my understanding too, that is why we removed this from driver
> > here..
> 
> > Mark, is this fine now?
> 
> You might want to put some of this analysis in the changelog.

Yup makes sense, v3 on the way then !
diff mbox

Patch

diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index 72971dc55c52..07d9bc1cf3cb 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -724,7 +724,6 @@  static void skl_remove(struct pci_dev *pci)
 
 	if (pci_dev_run_wake(pci))
 		pm_runtime_get_noresume(&pci->dev);
-	pci_dev_put(pci);
 
 	/* codec removal, invoke bus_device_remove */
 	snd_hdac_ext_bus_device_remove(ebus);