All of lore.kernel.org
 help / color / mirror / Atom feed
From: rogerq@ti.com (Roger Quadros)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] USB: initialize or shutdown PHY when add or remove host controller
Date: Tue, 18 Jun 2013 11:23:59 +0300	[thread overview]
Message-ID: <51C0191F.2050104@ti.com> (raw)
In-Reply-To: <20130618080130.GC5461@arwen.pp.htv.fi>

On 06/18/2013 11:01 AM, Felipe Balbi wrote:
> Hi,
> 
> On Tue, Jun 18, 2013 at 03:15:01AM -0400, Chao Xie wrote:
>> Some controller need software to initialize PHY before add
>> host controller, and shut down PHY after remove host controller.
>> Add the generic code for these controllers so they do not need
>> do it in its own host controller driver.
>>
>> Signed-off-by: Chao Xie <chao.xie@marvell.com>
>> ---
>>  drivers/usb/core/hcd.c |   19 ++++++++++++++++++-
>>  1 files changed, 18 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
>> index d53547d..b26196b 100644
>> --- a/drivers/usb/core/hcd.c
>> +++ b/drivers/usb/core/hcd.c
>> @@ -43,6 +43,7 @@
>>  
>>  #include <linux/usb.h>
>>  #include <linux/usb/hcd.h>
>> +#include <linux/usb/phy.h>
>>  
>>  #include "usb.h"
>>  
>> @@ -2531,12 +2532,22 @@ int usb_add_hcd(struct usb_hcd *hcd,
>>  	 */
>>  	set_bit(HCD_FLAG_RH_RUNNING, &hcd->flags);
>>  
>> +	/* Initialize the PHY before other hardware operation. */
>> +	if (hcd->phy) {
> 
> this looks wrong for two reasons:
> 
> a) you're not grabbing the PHY here.
> 
> 	You can't just assume another entity grabbed your PHY for you.

Isn't that done in the controller drivers e.g. ehci-fsl.c, ohci-omap, etc?
If the controllers don't want HCD core to manage the PHY they can just set it
to some error code.

cheers,
-roger

WARNING: multiple messages have this Message-ID (diff)
From: Roger Quadros <rogerq@ti.com>
To: <balbi@ti.com>
Cc: Chao Xie <chao.xie@marvell.com>, <gregkh@linuxfoundation.org>,
	<stern@rowland.harvard.edu>, <linux-usb@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <xiechao.mail@gmail.com>
Subject: Re: [PATCH] USB: initialize or shutdown PHY when add or remove host controller
Date: Tue, 18 Jun 2013 11:23:59 +0300	[thread overview]
Message-ID: <51C0191F.2050104@ti.com> (raw)
In-Reply-To: <20130618080130.GC5461@arwen.pp.htv.fi>

On 06/18/2013 11:01 AM, Felipe Balbi wrote:
> Hi,
> 
> On Tue, Jun 18, 2013 at 03:15:01AM -0400, Chao Xie wrote:
>> Some controller need software to initialize PHY before add
>> host controller, and shut down PHY after remove host controller.
>> Add the generic code for these controllers so they do not need
>> do it in its own host controller driver.
>>
>> Signed-off-by: Chao Xie <chao.xie@marvell.com>
>> ---
>>  drivers/usb/core/hcd.c |   19 ++++++++++++++++++-
>>  1 files changed, 18 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
>> index d53547d..b26196b 100644
>> --- a/drivers/usb/core/hcd.c
>> +++ b/drivers/usb/core/hcd.c
>> @@ -43,6 +43,7 @@
>>  
>>  #include <linux/usb.h>
>>  #include <linux/usb/hcd.h>
>> +#include <linux/usb/phy.h>
>>  
>>  #include "usb.h"
>>  
>> @@ -2531,12 +2532,22 @@ int usb_add_hcd(struct usb_hcd *hcd,
>>  	 */
>>  	set_bit(HCD_FLAG_RH_RUNNING, &hcd->flags);
>>  
>> +	/* Initialize the PHY before other hardware operation. */
>> +	if (hcd->phy) {
> 
> this looks wrong for two reasons:
> 
> a) you're not grabbing the PHY here.
> 
> 	You can't just assume another entity grabbed your PHY for you.

Isn't that done in the controller drivers e.g. ehci-fsl.c, ohci-omap, etc?
If the controllers don't want HCD core to manage the PHY they can just set it
to some error code.

cheers,
-roger

  reply	other threads:[~2013-06-18  8:23 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-18  7:15 [PATCH] USB: initialize or shutdown PHY when add or remove host controller Chao Xie
2013-06-18  7:15 ` Chao Xie
2013-06-18  8:01 ` Felipe Balbi
2013-06-18  8:01   ` Felipe Balbi
2013-06-18  8:23   ` Roger Quadros [this message]
2013-06-18  8:23     ` Roger Quadros
2013-06-18  8:24     ` Felipe Balbi
2013-06-18  8:24       ` Felipe Balbi
2013-06-18  8:34       ` Roger Quadros
2013-06-18  8:34         ` Roger Quadros
2013-06-18  8:37         ` Felipe Balbi
2013-06-18  8:37           ` Felipe Balbi
2013-06-18  8:45           ` Roger Quadros
2013-06-18  8:45             ` Roger Quadros
2013-06-18  8:48             ` Felipe Balbi
2013-06-18  8:48               ` Felipe Balbi
2013-06-18  9:27               ` Chao Xie
2013-06-18  9:27                 ` Chao Xie
2013-06-18 14:53       ` Alan Stern
2013-06-18 14:53         ` Alan Stern
2013-06-18 15:00         ` Felipe Balbi
2013-06-18 15:00           ` Felipe Balbi
2013-06-18 15:18           ` Alan Stern
2013-06-18 15:18             ` Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51C0191F.2050104@ti.com \
    --to=rogerq@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.