Skip to contentSkip to conversation

phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly

PATCH In review Kishon Vijay Abraham I 3 participants 3 messages Nov 4, 2014 – Nov 5, 2014 Generic PHY framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly

From: Oussama Ghorbel <[email protected]>

The USB OTG port does not work since v3.16 on omap platform. This is a regression introduced by the commit
eb82a3d846fa (phy: omap-usb2: Balance pm_runtime_enable() on probe failure
and remove).
This because the call to pm_runtime_enable() function is moved after the call to devm_phy_create() function, which has side effect since later in the subsequent calls of devm_phy_create() there is a check with pm_runtime_enabled() to configure few things.

---
 drivers/phy/phy-omap-usb2.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/phy/phy-omap-usb2.c +4 -2
index 8c84298..f091576 100644
@@ -258,14 +258,16 @@ static int omap_usb2_probe(struct platform_device *pdev)
 	otg->phy		= &phy->phy;
 
 	platform_set_drvdata(pdev, phy);
+	pm_runtime_enable(phy->dev);
 
 	generic_phy = devm_phy_create(phy->dev, NULL, &ops, NULL);
-	if (IS_ERR(generic_phy))
+	if (IS_ERR(generic_phy)) {
+		pm_runtime_disable(phy->dev);
 		return PTR_ERR(generic_phy);
+	}
 
 	phy_set_drvdata(generic_phy, phy);
 
-	pm_runtime_enable(phy->dev);
 	phy_provider = devm_of_phy_provider_register(phy->dev,
 			of_phy_simple_xlate);
 	if (IS_ERR(phy_provider)) {
Signature · 1 line
1.7.9.5
#1 lore raw

Hi,

Quoted 11 lines · Kishon Vijay Abraham I

From: Oussama Ghorbel <[email protected]>

The USB OTG port does not work since v3.16 on omap platform. This is a regression introduced by the commit
eb82a3d846fa (phy: omap-usb2: Balance pm_runtime_enable() on probe failure
and remove).
This because the call to pm_runtime_enable() function is moved after the call to devm_phy_create() function, which has side effect since later in the subsequent calls of devm_phy_create() there is a check with pm_runtime_enabled() to configure few things.

Quoted 3 lines

stable annotations are missing. See

Documentation/stable_kernel_rules.txt

-- Sebastian

#2 lore raw
Quoted 14 lines · Sebastian Reichel

Hi,

Quoted 11 lines · Kishon Vijay Abraham I

From: Oussama Ghorbel <[email protected]>

The USB OTG port does not work since v3.16 on omap platform. This is a regression introduced by the commit
eb82a3d846fa (phy: omap-usb2: Balance pm_runtime_enable() on probe failure
and remove).
This because the call to pm_runtime_enable() function is moved after the call to devm_phy_create() function, which has side effect since later in the subsequent calls of devm_phy_create() there is a check with pm_runtime_enabled() to configure few things.

Quoted 7 lines
Quoted 3 lines

stable annotations are missing. See

Documentation/stable_kernel_rules.txt

I can take care of that, thanks.

greg k-h