Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758251Ab3CDP3g (ORCPT ); Mon, 4 Mar 2013 10:29:36 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:44943 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1758075Ab3CDP3e (ORCPT ); Mon, 4 Mar 2013 10:29:34 -0500 Date: Mon, 4 Mar 2013 10:29:33 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Vivek Gautam cc: Vivek Gautam , , , , , , , , , , Doug Anderson Subject: Re: [PATCH v2 06/10] usb: xhci: Enable runtime pm in xhci-plat In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1244 Lines: 35 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/