lkml.org 
[lkml]   [2012]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [BUGFIX] PM: Fix active child counting when disabled and forbidden
On Wed, 7 Nov 2012, Huang Ying wrote:

> > > Devices will be disabled if the PCI driver is unbound from the PCI
> > > device.
> >
> > Yes. But without a PCI driver, nothing will call
> > pm_runtime_set_suspended.
>
> pm_runtime_set_suspended will be called in pci_device_remove or error
> path of local_pci_probe.

Yes, okay. But that's what we want. Unused, driverless PCI devices
shouldn't force their parents to remain at full power.

> > And even if something does call
> > pm_runtime_set_suspended, it's still not a problem -- the device can't
> > be used without a driver.
>
> The VGA device can be used without a driver.

Ah, right, that's your _real_ problem. You should have mentioned this
in the original Changelog for the patch.

Rafael, this does need to be fixed. The PCI subsystem assumes that
driverless devices are not in use, so they are disabled for runtime PM
and marked as suspended. This is not appropriate for VGA devices,
which can indeed be used without a driver.

I'm not sure what the best solution is. Maybe we should Ying's
proposal a step farther:

Make pm_runtime_set_suspended() fail if runtime PM is
forbidden.

Make pm_runtime_forbid() call pm_runtime_set_active()
(and do a runtime resume of the parent) if disable_depth > 0.

Make the PCI runtime-idle routine call
pm_runtime_set_suspended() if disable_depth > 0. Or maybe
do this for all devices, in the runtime PM core.

What do you think?

Alan Stern



\
 
 \ /
  Last update: 2012-11-07 17:41    [W:0.113 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site