phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
PATCH 1/1 phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
The USB OTG port does not work since v3.16 on omap platform. This is a regression introduced by the commiteb82a3d846fa (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
@@ -262,14 +262,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, &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.8.3.2
You may find merge conflict since v3.17-rc5.
If necessary I can send a re-based version of this patch on v3.17-rc5 for seamless integration. In short the linegeneric_phy = devm_phy_create(phy->dev, &ops, NULL);
becamegeneric_phy = devm_phy_create(phy->dev, NULL, &ops, NULL);
Oussama
Quoted 37 lines · Oussama Ghorbel
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: Balancepm_runtime_enable()on probe failure
and remove).
This because the call topm_runtime_enable()function is moved after the call todevm_phy_create()function, which has side effect since later in the subsequent calls ofdevm_phy_create()there is a check withpm_runtime_enabled()to configure few things.Signed-off-by Oussama Ghorbel <[email protected]>--- drivers/phy/phy-omap-usb2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/phy/phy-omap-usb2.c +4
-2@@ -262,14 +262,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, &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)) {
Quoted 3 lines · Oussama Ghorbel
You may find merge conflict since v3.17-rc5.
If necessary I can send a re-based version of this patch on v3.17-rc5 for seamless integration.
Looks like pandaboard USB is still broken on v3.17 due to this bug. Please do send an updated patch based on latest mainline so that Kishon can apply it easily when he gets around to it.
Quoted 34 lines · Oussama Ghorbel
Quoted 33 lines
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: Balancepm_runtime_enable()on probe failure
and remove).
This because the call topm_runtime_enable()function is moved after the call todevm_phy_create()function, which has side effect since later in the subsequent calls ofdevm_phy_create()there is a check withpm_runtime_enabled()to configure few things.Signed-off-by Oussama Ghorbel <[email protected]>--- drivers/phy/phy-omap-usb2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/phy/phy-omap-usb2.c +4
-2@@ -262,14 +262,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, &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)) {
PATCH v2 1/1 phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
The USB OTG port does not work since v3.16 on omap platform. This is a regression introduced by the commiteb82a3d846fa (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
@@ -262,14 +262,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.8.3.2
Quoted 10 lines · Oussama Ghorbel
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: Balancepm_runtime_enable()on probe failure
and remove).
This because the call topm_runtime_enable()function is moved after the call todevm_phy_create()function, which has side effect since later in the subsequent calls ofdevm_phy_create()there is a check withpm_runtime_enabled()to configure few things.Signed-off-by Oussama Ghorbel <[email protected]>
Thanks.
Hi Oussama,
Quoted 10 lines · Oussama Ghorbel
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: Balancepm_runtime_enable()on probe failure
and remove).
This because the call topm_runtime_enable()function is moved after the call todevm_phy_create()function, which has side effect since later in the subsequent calls ofdevm_phy_create()there is a check withpm_runtime_enabled()to configure few things.Signed-off-by Oussama Ghorbel <[email protected]>
Could you please send the patch to
Cc: <[email protected]> [3.16+]
That way it will get into 3.16 onwards. Thanks.
cheers,
-roger
Hi Roger,
Should I resend this v2 version of the patch to [email protected] which is suitable for v3.17 and which will require a very tiny adaptation? Or I should resend the first version of this patch which is suitable for 3.16 but might seems confusing a little sine I'm resend the outdated version.
Thanks,
Oussama
Quoted 23 lines · Roger Quadros
Hi Oussama,
Quoted 10 lines · Oussama Ghorbel
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: Balancepm_runtime_enable()on probe failure
and remove).
This because the call topm_runtime_enable()function is moved after the call todevm_phy_create()function, which has side effect since later in the subsequent calls ofdevm_phy_create()there is a check withpm_runtime_enabled()to configure few things.Signed-off-by Oussama Ghorbel <[email protected]>Acked-by Roger Quadros <[email protected]>Could you please send the patch to
Cc: <[email protected]> [3.16+]That way it will get into 3.16 onwards. Thanks.
cheers,
-roger
Oussama,
Quoted 4 lines · Oussama Ghorbel
Hi Roger,
Should I resend this v2 version of the patch to [email protected] which is suitable for v3.17 and which will require a very tiny adaptation? Or I should resend the first version of this patch which is suitable for 3.16 but might seems confusing a little sine I'm resend the outdated version.
If it is a trivial conflict then I think you can just send the patch which applies to the most recent kernel. Greg can clarify if I'm wrong as he maintains the stable trees.
cheers,
-roger
Quoted 28 lines
Thanks,
OussamaQuoted 23 lines · Roger Quadros
Hi Oussama,
Quoted 10 lines · Oussama Ghorbel
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: Balancepm_runtime_enable()on probe failure
and remove).
This because the call topm_runtime_enable()function is moved after the call todevm_phy_create()function, which has side effect since later in the subsequent calls ofdevm_phy_create()there is a check withpm_runtime_enabled()to configure few things.Signed-off-by Oussama Ghorbel <[email protected]>Acked-by Roger Quadros <[email protected]>Could you please send the patch to
Cc: <[email protected]> [3.16+]That way it will get into 3.16 onwards. Thanks.
cheers,
-roger
Quoted 11 lines · Roger Quadros
Oussama,
Quoted 4 lines · Oussama Ghorbel
Hi Roger,
Should I resend this v2 version of the patch to [email protected] which is suitable for v3.17 and which will require a very tiny adaptation? Or I should resend the first version of this patch which is suitable for 3.16 but might seems confusing a little sine I'm resend the outdated version.
If it is a trivial conflict then I think you can just send the patch which applies to the most recent kernel.
Greg can clarify if I'm wrong as he maintains the stable trees.
Please read Documentation/stable_kernel_rules.txt for how to submit patches to the stable trees. Note, it has to be in Linus's tree _first_ before you ever worry about the stable trees. Do that first please.
thanks,
greg k-h
Nothing to send then.
Oussama
Quoted 18 lines · Greg KH
Quoted 10 lines · Roger Quadros
Oussama,
Quoted 4 lines · Oussama Ghorbel
Hi Roger,
Should I resend this v2 version of the patch to [email protected] which is suitable for v3.17 and which will require a very tiny adaptation? Or I should resend the first version of this patch which is suitable for 3.16 but might seems confusing a little sine I'm resend the outdated version.
If it is a trivial conflict then I think you can just send the patch which applies to the most recent kernel.
Greg can clarify if I'm wrong as he maintains the stable trees.Please read
Documentation/stable_kernel_rules.txtfor how to submit patches to the stable trees. Note, it has to be in Linus's tree _first_ before you ever worry about the stable trees. Do that first please.thanks,
greg k-h
Unless I'm missing something, this patch appears to have still not been picked up. It would be nice if it can go in for 3.18 so that we have working USB on pandaboard again at least in that release.
Tony, would you mind carrying it as OMAP maintainer since we haven't heard anything from Kishon (the PHY maintainer) about this? It's been acked by Roger (whose patch introduced the problem).
Thanks.
(leaving the patch intact below)
Quoted 44 lines · Oussama Ghorbel
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: Balancepm_runtime_enable()on probe failure
and remove).
This because the call topm_runtime_enable()function is moved after the call todevm_phy_create()function, which has side effect since later in the subsequent calls ofdevm_phy_create()there is a check withpm_runtime_enabled()to configure few things.Signed-off-by Oussama Ghorbel <[email protected]>--- drivers/phy/phy-omap-usb2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/phy/phy-omap-usb2.c +4
-2@@ -262,14 +262,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 · 6 lines
1.8.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines · Rabin Vincent
Unless I'm missing something, this patch appears to have still not been picked up. It would be nice if it can go in for 3.18 so that we have working USB on pandaboard again at least in that release.
Tony, would you mind carrying it as OMAP maintainer since we haven't heard anything from Kishon (the PHY maintainer) about this? It's been acked by Roger (whose patch introduced the problem).
I'll send this in this -rc cycle.
Thanks
Kishon
Quoted 50 lines
Thanks.
(leaving the patch intact below)
Quoted 44 lines · Oussama Ghorbel
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: Balancepm_runtime_enable()on probe failure
and remove).
This because the call topm_runtime_enable()function is moved after the call todevm_phy_create()function, which has side effect since later in the subsequent calls ofdevm_phy_create()there is a check withpm_runtime_enabled()to configure few things.Signed-off-by Oussama Ghorbel <[email protected]>--- drivers/phy/phy-omap-usb2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/phy/phy-omap-usb2.c +4
-2@@ -262,14 +262,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 · 6 lines
1.8.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Greg,
Quoted 8 lines · Oussama Ghorbel
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: Balancepm_runtime_enable()on probe failure
and remove).
This because the call topm_runtime_enable()function is moved after the call todevm_phy_create()function, which has side effect since later in the subsequent calls ofdevm_phy_create()there is a check withpm_runtime_enabled()to configure few things.
This is the only fix for this -rc cycle in the PHY susbsystem. So can you take this directly? Or else I can prepare a pull request. Let me know.
Thanks
Kishon
Quoted 30 lines
Signed-off-by Oussama Ghorbel <[email protected]>--- drivers/phy/phy-omap-usb2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/phy/phy-omap-usb2.c +4
-2@@ -262,14 +262,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)) {
Quoted 12 lines · Kishon Vijay Abraham I
Hi Greg,
Quoted 8 lines · Oussama Ghorbel
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: Balancepm_runtime_enable()on probe failure
and remove).
This because the call topm_runtime_enable()function is moved after the call todevm_phy_create()function, which has side effect since later in the subsequent calls ofdevm_phy_create()there is a check withpm_runtime_enabled()to configure few things.
Quoted 4 lines
This is the only fix for this -rc cycle in the PHY susbsystem. So can you take this directly? Or else I can prepare a pull request. Let me know.
I don't have this in my archives anymore, please resend so that I can apply it from an email.
thanks,
greg k-h
Hi all,
2014-11-04 0:29 GMT+01:00 Greg KH <[email protected]>:
Quoted 16 lines · Kishon Vijay Abraham I
Quoted 15 lines
Hi Greg,
Quoted 8 lines · Oussama Ghorbel
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: Balancepm_runtime_enable()on probe failure
and remove).
This because the call topm_runtime_enable()function is moved after the call todevm_phy_create()function, which has side effect since later in the subsequent calls ofdevm_phy_create()there is a check withpm_runtime_enabled()to configure few things.This is the only fix for this -rc cycle in the PHY susbsystem. So can you take this directly? Or else I can prepare a pull request. Let me know.
Quoted 8 lines
Quoted 1 line
I don't have this in my archives anymore, please resend so that I can apply it from an email.
thanks,
greg k-h
I'm trying to use the OTG port as HOST on OMAP3-based platform (IGEPv2), I saw that this patch is already applied in kernel 3.18.0-rc4 so I expected it to work, but I've some problems. To explain the situation let me propose some test cases.
The first tests I made were configuring the MUSB OTG as HOST only mode,In this mode test case A fails and test case B and C succeed.
USB Mode Selection (HOST only mode)
Test case A) Boot the system :
mode : b_idle
vbus : Vbus off, timeout 1100 msec
1) Ground ID-pin
mode : a_idle
vbus : Vbus off, timeout 1100 msec
2) Plug pendrive
mode : a_idle
vbus : Vbus off, timeout 1100 msec
Failed: Pendrive is not detected.
Test case B) Boot with ID-pin grounded :
mode : a_idle
vbus : Vbus off, timeout 1100 msec
1) Plug pendrive
mode : a_host
vbus : Vbus off, timeout 1100 msec
Success: Pendrive is detected
Test case C) Boot with ID-pin grounded and pendrive
mode : a_host
vbus : Vbus off, timeout 1100 msec
Success: Pendrive is detected
The second tests I made were configuring the MUSB OTG as Dual Role mode,In this mode all test cases failed.
MUSB Mode Selection (Dual Role mode)
Test case A) Boot the system :
mode : b_idle
vbus : Vbus off, timeout 1100 msec
1) Ground ID-pin:
mode : a_idle
mode : Vbus off, timeout 1100 msec
2) Plug pendrive
mode : a_idle
vbus : Vbus off, timeout 1100 msec
Failed: Pendrive is not detected.
Test case B) Boot with ID-pin grounded :
mode : b_idle
vbus : Vbus off, timeout 1100 msec
1) Plug pendrive
mode : b_idle
vbus : Vbus off, timeout 1100 msec
Failed: Pendrive is not detected.
Test case C) Boot with ID-pin grounded and pendrive
mode : b_idle
vbus : Vbus off, timeout 1100 msec
Failed: Pendrive is not detected.
I got the mode and vbus values from sysfs:
cat /sys/bus/platform/drivers/musb-hdrc/musb-hdrc.0.auto/mode cat /sys/bus/platform/drivers/musb-hdrc/musb-hdrc.0.auto/vbus
Did anybody test these test cases ?
I'm a bit surprised with the vbus status because always reports Vbus off, although pendrive is working. I'm missing something ?
Note that if you see at the mode transitions something looks wrong. For example, in Dual Role Mode test case B and C the mode is b_idle instead of a_idle.
Thanks,
Enric