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-09-24 16:15 Oussama Ghorbel
  2014-09-26 13:17 ` Oussama Ghorbel
  0 siblings, 1 reply; 15+ 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] 15+ messages in thread

* Re: [PATCH] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
  2014-09-24 16:15 [PATCH] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly Oussama Ghorbel
@ 2014-09-26 13:17 ` Oussama Ghorbel
  2014-10-06 19:44   ` Rabin Vincent
  0 siblings, 1 reply; 15+ 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] 15+ 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
  2014-10-07 11:02     ` [PATCHv2] " Oussama Ghorbel
  0 siblings, 1 reply; 15+ 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] 15+ messages in thread

* [PATCHv2] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
  2014-10-06 19:44   ` Rabin Vincent
@ 2014-10-07 11:02     ` Oussama Ghorbel
  2014-10-07 17:11       ` Rabin Vincent
                         ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Oussama Ghorbel @ 2014-10-07 11:02 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: Rabin Vincent, rogerq, linux-usb, 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 93d7835..acc13f8 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, 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.8.3.2


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

* Re: [PATCHv2] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
  2014-10-07 11:02     ` [PATCHv2] " Oussama Ghorbel
@ 2014-10-07 17:11       ` Rabin Vincent
  2014-10-08  8:17       ` Roger Quadros
                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 15+ messages in thread
From: Rabin Vincent @ 2014-10-07 17:11 UTC (permalink / raw)
  To: Oussama Ghorbel; +Cc: Kishon Vijay Abraham I, rogerq, linux-usb, linux-kernel

On Tue, Oct 07, 2014 at 12:02:51PM +0100, 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>

Tested-by: Rabin Vincent <rabin@rab.in>

Thanks.

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

* Re: [PATCHv2] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
  2014-10-07 11:02     ` [PATCHv2] " Oussama Ghorbel
  2014-10-07 17:11       ` Rabin Vincent
@ 2014-10-08  8:17       ` Roger Quadros
  2014-10-08 10:54         ` Oussama Ghorbel
  2014-10-29 23:09       ` Rabin Vincent
  2014-11-03 11:21       ` Kishon Vijay Abraham I
  3 siblings, 1 reply; 15+ messages in thread
From: Roger Quadros @ 2014-10-08  8:17 UTC (permalink / raw)
  To: Oussama Ghorbel, Kishon Vijay Abraham I
  Cc: Rabin Vincent, linux-usb, linux-kernel

Hi Oussama,

On 10/07/2014 02:02 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>

Acked-by: Roger Quadros <rogerq@ti.com>

Could you please send the patch to
Cc: <stable@vger.kernel.org>        [3.16+]

That way it will get into 3.16 onwards. Thanks.

cheers,
-roger


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

* Re: [PATCHv2] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
  2014-10-08  8:17       ` Roger Quadros
@ 2014-10-08 10:54         ` Oussama Ghorbel
  2014-10-08 11:42           ` Roger Quadros
  0 siblings, 1 reply; 15+ messages in thread
From: Oussama Ghorbel @ 2014-10-08 10:54 UTC (permalink / raw)
  To: Roger Quadros, Kishon Vijay Abraham I
  Cc: Rabin Vincent, linux-usb, linux-kernel

Hi Roger,

Should I resend this v2 version of the patch to stable@vger.kernel.org 
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
On 10/08/2014 09:17 AM, Roger Quadros wrote:
> Hi Oussama,
>
> On 10/07/2014 02:02 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>
> Acked-by: Roger Quadros <rogerq@ti.com>
>
> Could you please send the patch to
> Cc: <stable@vger.kernel.org>        [3.16+]
>
> That way it will get into 3.16 onwards. Thanks.
>
> cheers,
> -roger
>


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

* Re: [PATCHv2] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
  2014-10-08 10:54         ` Oussama Ghorbel
@ 2014-10-08 11:42           ` Roger Quadros
  2014-10-08 13:26             ` Greg KH
  0 siblings, 1 reply; 15+ messages in thread
From: Roger Quadros @ 2014-10-08 11:42 UTC (permalink / raw)
  To: Oussama Ghorbel, Kishon Vijay Abraham I, Greg KH
  Cc: Rabin Vincent, linux-usb, linux-kernel

Oussama,

On 10/08/2014 01:54 PM, Oussama Ghorbel wrote:
> Hi Roger,
> 
> Should I resend this v2 version of the patch to stable@vger.kernel.org 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

> 
> Thanks,
> Oussama
> On 10/08/2014 09:17 AM, Roger Quadros wrote:
>> Hi Oussama,
>>
>> On 10/07/2014 02:02 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>
>> Acked-by: Roger Quadros <rogerq@ti.com>
>>
>> Could you please send the patch to
>> Cc: <stable@vger.kernel.org>        [3.16+]
>>
>> That way it will get into 3.16 onwards. Thanks.
>>
>> cheers,
>> -roger
>>
> 


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

* Re: [PATCHv2] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
  2014-10-08 11:42           ` Roger Quadros
@ 2014-10-08 13:26             ` Greg KH
  2014-10-08 13:50               ` Oussama Ghorbel
  0 siblings, 1 reply; 15+ messages in thread
From: Greg KH @ 2014-10-08 13:26 UTC (permalink / raw)
  To: Roger Quadros
  Cc: Oussama Ghorbel, Kishon Vijay Abraham I, Rabin Vincent,
	linux-usb, linux-kernel

On Wed, Oct 08, 2014 at 02:42:56PM +0300, Roger Quadros wrote:
> Oussama,
> 
> On 10/08/2014 01:54 PM, Oussama Ghorbel wrote:
> > Hi Roger,
> > 
> > Should I resend this v2 version of the patch to stable@vger.kernel.org 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

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

* Re: [PATCHv2] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
  2014-10-08 13:26             ` Greg KH
@ 2014-10-08 13:50               ` Oussama Ghorbel
  0 siblings, 0 replies; 15+ messages in thread
From: Oussama Ghorbel @ 2014-10-08 13:50 UTC (permalink / raw)
  To: Greg KH, Roger Quadros
  Cc: Kishon Vijay Abraham I, Rabin Vincent, linux-usb, linux-kernel

Nothing to send then.

Oussama
On 10/08/2014 02:26 PM, Greg KH wrote:
> On Wed, Oct 08, 2014 at 02:42:56PM +0300, Roger Quadros wrote:
>> Oussama,
>>
>> On 10/08/2014 01:54 PM, Oussama Ghorbel wrote:
>>> Hi Roger,
>>>
>>> Should I resend this v2 version of the patch to stable@vger.kernel.org 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


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

* Re: [PATCHv2] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
  2014-10-07 11:02     ` [PATCHv2] " Oussama Ghorbel
  2014-10-07 17:11       ` Rabin Vincent
  2014-10-08  8:17       ` Roger Quadros
@ 2014-10-29 23:09       ` Rabin Vincent
  2014-10-30  5:16         ` Kishon Vijay Abraham I
  2014-11-03 11:21       ` Kishon Vijay Abraham I
  3 siblings, 1 reply; 15+ messages in thread
From: Rabin Vincent @ 2014-10-29 23:09 UTC (permalink / raw)
  To: kishon, tony; +Cc: rogerq, linux-usb, linux-kernel, ghorbel, linux-omap

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)

On Tue, Oct 07, 2014 at 12:02:51PM +0100, 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 93d7835..acc13f8 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, 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.8.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCHv2] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
  2014-10-29 23:09       ` Rabin Vincent
@ 2014-10-30  5:16         ` Kishon Vijay Abraham I
  0 siblings, 0 replies; 15+ messages in thread
From: Kishon Vijay Abraham I @ 2014-10-30  5:16 UTC (permalink / raw)
  To: Rabin Vincent, tony; +Cc: rogerq, linux-usb, linux-kernel, ghorbel, linux-omap



On Thursday 30 October 2014 04:39 AM, Rabin Vincent wrote:
> 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

> 
> Thanks.
> 
> (leaving the patch intact below)
> 
> On Tue, Oct 07, 2014 at 12:02:51PM +0100, 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 93d7835..acc13f8 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, 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.8.3.2
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCHv2] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
  2014-10-07 11:02     ` [PATCHv2] " Oussama Ghorbel
                         ` (2 preceding siblings ...)
  2014-10-29 23:09       ` Rabin Vincent
@ 2014-11-03 11:21       ` Kishon Vijay Abraham I
  2014-11-03 23:29         ` Greg KH
  3 siblings, 1 reply; 15+ messages in thread
From: Kishon Vijay Abraham I @ 2014-11-03 11:21 UTC (permalink / raw)
  To: Oussama Ghorbel, Greg KH; +Cc: Rabin Vincent, rogerq, linux-usb, linux-kernel

Hi Greg,

On Tuesday 07 October 2014 04:32 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.

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.

Acked-by: Kishon Vijay Abraham I <kishon@ti.com>

Thanks
Kishon
> 
> 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 93d7835..acc13f8 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, 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)) {
> 

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

* Re: [PATCHv2] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
  2014-11-03 11:21       ` Kishon Vijay Abraham I
@ 2014-11-03 23:29         ` Greg KH
  2014-11-11 15:10           ` Enric Balletbo Serra
  0 siblings, 1 reply; 15+ messages in thread
From: Greg KH @ 2014-11-03 23:29 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: Oussama Ghorbel, Rabin Vincent, rogerq, linux-usb, linux-kernel

On Mon, Nov 03, 2014 at 04:51:41PM +0530, Kishon Vijay Abraham I wrote:
> Hi Greg,
> 
> On Tuesday 07 October 2014 04:32 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.
> 
> 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.
> 
> Acked-by: Kishon Vijay Abraham I <kishon@ti.com>

I don't have this in my archives anymore, please resend so that I can
apply it from an email.

thanks,

greg k-h

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

* Re: [PATCHv2] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
  2014-11-03 23:29         ` Greg KH
@ 2014-11-11 15:10           ` Enric Balletbo Serra
  0 siblings, 0 replies; 15+ messages in thread
From: Enric Balletbo Serra @ 2014-11-11 15:10 UTC (permalink / raw)
  To: Greg KH
  Cc: Kishon Vijay Abraham I, Oussama Ghorbel, Rabin Vincent, rogerq,
	linux-usb, linux-kernel, Javier Martinez Canillas,
	Angelo Dureghello

Hi all,

2014-11-04 0:29 GMT+01:00 Greg KH <gregkh@linuxfoundation.org>:
> On Mon, Nov 03, 2014 at 04:51:41PM +0530, Kishon Vijay Abraham I wrote:
>> Hi Greg,
>>
>> On Tuesday 07 October 2014 04:32 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.
>>
>> 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.
>>
>> Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
>
> 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

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

end of thread, other threads:[~2014-11-11 15:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-24 16:15 [PATCH] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly Oussama Ghorbel
2014-09-26 13:17 ` Oussama Ghorbel
2014-10-06 19:44   ` Rabin Vincent
2014-10-07 11:02     ` [PATCHv2] " Oussama Ghorbel
2014-10-07 17:11       ` Rabin Vincent
2014-10-08  8:17       ` Roger Quadros
2014-10-08 10:54         ` Oussama Ghorbel
2014-10-08 11:42           ` Roger Quadros
2014-10-08 13:26             ` Greg KH
2014-10-08 13:50               ` Oussama Ghorbel
2014-10-29 23:09       ` Rabin Vincent
2014-10-30  5:16         ` Kishon Vijay Abraham I
2014-11-03 11:21       ` Kishon Vijay Abraham I
2014-11-03 23:29         ` Greg KH
2014-11-11 15:10           ` Enric Balletbo Serra

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).