linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
@ 2014-11-04  6:17 Kishon Vijay Abraham I
  2014-11-05 17:54 ` Sebastian Reichel
  0 siblings, 1 reply; 6+ messages in thread
From: Kishon Vijay Abraham I @ 2014-11-04  6:17 UTC (permalink / raw)
  To: gregkh; +Cc: kishon, linux-kernel

From: Oussama Ghorbel <ghorbel@pivasoftware.com>

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.

Signed-off-by: Oussama Ghorbel <ghorbel@pivasoftware.com>
Tested-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/phy/phy-omap-usb2.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c
index 8c84298..f091576 100644
--- a/drivers/phy/phy-omap-usb2.c
+++ b/drivers/phy/phy-omap-usb2.c
@@ -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)) {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
  2014-11-04  6:17 [PATCH] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly Kishon Vijay Abraham I
@ 2014-11-05 17:54 ` Sebastian Reichel
  2014-11-05 22:29   ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Reichel @ 2014-11-05 17:54 UTC (permalink / raw)
  To: Kishon Vijay Abraham I; +Cc: gregkh, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 873 bytes --]

Hi,

On Tue, Nov 04, 2014 at 11:47:06AM +0530, Kishon Vijay Abraham I wrote:
> From: Oussama Ghorbel <ghorbel@pivasoftware.com>
> 
> 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.
> 
> Signed-off-by: Oussama Ghorbel <ghorbel@pivasoftware.com>
> Tested-by: Rabin Vincent <rabin@rab.in>
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

stable annotations are missing. See

Documentation/stable_kernel_rules.txt

-- Sebastian

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
  2014-11-05 17:54 ` Sebastian Reichel
@ 2014-11-05 22:29   ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2014-11-05 22:29 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: Kishon Vijay Abraham I, linux-kernel

On Wed, Nov 05, 2014 at 06:54:23PM +0100, Sebastian Reichel wrote:
> Hi,
> 
> On Tue, Nov 04, 2014 at 11:47:06AM +0530, Kishon Vijay Abraham I wrote:
> > From: Oussama Ghorbel <ghorbel@pivasoftware.com>
> > 
> > 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.
> > 
> > Signed-off-by: Oussama Ghorbel <ghorbel@pivasoftware.com>
> > Tested-by: Rabin Vincent <rabin@rab.in>
> > Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> 
> stable annotations are missing. See
> 
> Documentation/stable_kernel_rules.txt

I can take care of that, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
  2014-09-26 13:17 ` Oussama Ghorbel
@ 2014-10-06 19:44   ` Rabin Vincent
  0 siblings, 0 replies; 6+ messages in thread
From: Rabin Vincent @ 2014-10-06 19:44 UTC (permalink / raw)
  To: Oussama Ghorbel; +Cc: Kishon Vijay Abraham I, linux-kernel, rogerq, linux-usb

On Fri, Sep 26, 2014 at 02:17:47PM +0100, Oussama Ghorbel wrote:
> 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.

> On 09/24/2014 05:15 PM, Oussama Ghorbel wrote:
> >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.
> >
> >Signed-off-by: Oussama Ghorbel <ghorbel@pivasoftware.com>
> >---
> >  drivers/phy/phy-omap-usb2.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> >diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c
> >index 34b3961..3fb9293 100644
> >--- a/drivers/phy/phy-omap-usb2.c
> >+++ b/drivers/phy/phy-omap-usb2.c
> >@@ -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)) {

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
  2014-09-24 16:15 Oussama Ghorbel
@ 2014-09-26 13:17 ` Oussama Ghorbel
  2014-10-06 19:44   ` Rabin Vincent
  0 siblings, 1 reply; 6+ messages in thread
From: Oussama Ghorbel @ 2014-09-26 13:17 UTC (permalink / raw)
  To: Kishon Vijay Abraham I; +Cc: linux-kernel

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 line
generic_phy = devm_phy_create(phy->dev, &ops, NULL);
became
generic_phy = devm_phy_create(phy->dev, NULL, &ops, NULL);

Oussama

On 09/24/2014 05:15 PM, Oussama Ghorbel wrote:
> 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.
>
> Signed-off-by: Oussama Ghorbel <ghorbel@pivasoftware.com>
> ---
>   drivers/phy/phy-omap-usb2.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c
> index 34b3961..3fb9293 100644
> --- a/drivers/phy/phy-omap-usb2.c
> +++ b/drivers/phy/phy-omap-usb2.c
> @@ -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)) {


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
@ 2014-09-24 16:15 Oussama Ghorbel
  2014-09-26 13:17 ` Oussama Ghorbel
  0 siblings, 1 reply; 6+ messages in thread
From: Oussama Ghorbel @ 2014-09-24 16:15 UTC (permalink / raw)
  To: Kishon Vijay Abraham I; +Cc: linux-kernel, 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: 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.

Signed-off-by: Oussama Ghorbel <ghorbel@pivasoftware.com>
---
 drivers/phy/phy-omap-usb2.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c
index 34b3961..3fb9293 100644
--- a/drivers/phy/phy-omap-usb2.c
+++ b/drivers/phy/phy-omap-usb2.c
@@ -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)) {
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-11-05 22:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-04  6:17 [PATCH] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly Kishon Vijay Abraham I
2014-11-05 17:54 ` Sebastian Reichel
2014-11-05 22:29   ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2014-09-24 16:15 Oussama Ghorbel
2014-09-26 13:17 ` Oussama Ghorbel
2014-10-06 19:44   ` Rabin Vincent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).