Re: [PATCH v2 06/10] usb: xhci: Enable runtime pm in xhci-plat

From: Alan Stern
Date: Mon Mar 04 2013 - 10:29:39 EST


On Mon, 4 Mar 2013, Vivek Gautam wrote:

> >> @@ -149,6 +150,8 @@ static int xhci_plat_probe(struct platform_device *pdev)
> >> if (ret)
> >> goto put_usb3_hcd;
> >>
> >> + pm_runtime_enable(&pdev->dev);
> >
> > This is generally not a good idea. You shouldn't enable a device for
> > runtime PM without first telling the PM core what state it is in.
> >
> Right, but i am not completely sure on any fixed path to follow for
> enabling runtime
> power management on a device. :-(
> Does it become necessary to "pm_runtime_set_active" or
> "pm_runtime_set_suspended" a device
> before "pm_runtime_enable" ?

Yes, it usually is necesary. And especially here, because the runtime
PM core sets the initial status of every device to RPM_SUSPENDED.

> pm_runtime_enable would just try to
> decrement the disable_depth
> of the device.

That's right. And once that happens, the PM core would think the
device was suspended even though it was really at full power.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/