From: George Cherian <george.cherian@ti.com>
To: balbi@ti.com
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
gregkh@linuxfoundation.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH] usb: dwc3: core: continue probe even if usb3 phy is not available
Date: Wed, 26 Jun 2013 17:37:19 +0530 [thread overview]
Message-ID: <51CAD977.6040309@ti.com> (raw)
In-Reply-To: <20130626101647.GT12640@arwen.pp.htv.fi>
On 6/26/2013 3:46 PM, Felipe Balbi wrote:
> Hi,
>
> On Wed, Jun 26, 2013 at 02:59:14PM +0530, George Cherian wrote:
>> There can be configurations in which DWC3 is hoooked up only to USB2 PHY.
>> In such cases we should not return -EPROBE_DEFER, rather continue probe
>> even if there is no USB3 PHY.
>>
>> Signed-off-by: George Cherian <george.cherian@ti.com>
>> ---
>> drivers/usb/dwc3/core.c | 31 ++++++++++++++++++++++++-------
>> 1 file changed, 24 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
>> index c35d49d..d5e6f3e 100644
>> --- a/drivers/usb/dwc3/core.c
>> +++ b/drivers/usb/dwc3/core.c
>> @@ -100,7 +100,9 @@ static void dwc3_core_soft_reset(struct dwc3 *dwc)
>> dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
>>
>> usb_phy_init(dwc->usb2_phy);
>> - usb_phy_init(dwc->usb3_phy);
>> +
>> + if (dwc->usb3_phy)
>> + usb_phy_init(dwc->usb3_phy);
> I would feel more comfortable if you would move our maximum_speed module
> parameter to DT with a property such as:
>
> snps,maximum_speed = "highspeed";
>
> then on driver you could:
okay
> ret = of_property_read_string(np, "snps,maximum_speed", &maximum_speed);
> if (ret < 0)
> bailout();
>
> if (strncmp(maximum_speed, "superspeed", 10) == 0) {
> /* grab USB3 PHY, return EPROBE_DEFER if not found */
> grab_usb3_phy();
> }
>
> if ((strncmp(maximum_speed, "highspeed", 9) == 0) ||
> (strncmp(maximum_speed, "fullspeed", 9) == 0) ||
> (strncmp(maximum_speed, "lowspeed", 8) == 0)) {
> /* grab USB2 PHY, return EPROBE_DEFER if not found */
> grab_usb2_phy();
> }
>
> this way, we depend solely on setting maximum_speed to highspeed for
> AM437x :-)
In dra7xx one instance is superspeed and one instance highspeed.
>
> ps: don't forget to default to superspeed in case no property is passed.
okay
Regards
-George
WARNING: multiple messages have this Message-ID (diff)
From: George Cherian <george.cherian@ti.com>
To: <balbi@ti.com>
Cc: <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<gregkh@linuxfoundation.org>, <linux-omap@vger.kernel.org>
Subject: Re: [PATCH] usb: dwc3: core: continue probe even if usb3 phy is not available
Date: Wed, 26 Jun 2013 17:37:19 +0530 [thread overview]
Message-ID: <51CAD977.6040309@ti.com> (raw)
In-Reply-To: <20130626101647.GT12640@arwen.pp.htv.fi>
On 6/26/2013 3:46 PM, Felipe Balbi wrote:
> Hi,
>
> On Wed, Jun 26, 2013 at 02:59:14PM +0530, George Cherian wrote:
>> There can be configurations in which DWC3 is hoooked up only to USB2 PHY.
>> In such cases we should not return -EPROBE_DEFER, rather continue probe
>> even if there is no USB3 PHY.
>>
>> Signed-off-by: George Cherian <george.cherian@ti.com>
>> ---
>> drivers/usb/dwc3/core.c | 31 ++++++++++++++++++++++++-------
>> 1 file changed, 24 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
>> index c35d49d..d5e6f3e 100644
>> --- a/drivers/usb/dwc3/core.c
>> +++ b/drivers/usb/dwc3/core.c
>> @@ -100,7 +100,9 @@ static void dwc3_core_soft_reset(struct dwc3 *dwc)
>> dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
>>
>> usb_phy_init(dwc->usb2_phy);
>> - usb_phy_init(dwc->usb3_phy);
>> +
>> + if (dwc->usb3_phy)
>> + usb_phy_init(dwc->usb3_phy);
> I would feel more comfortable if you would move our maximum_speed module
> parameter to DT with a property such as:
>
> snps,maximum_speed = "highspeed";
>
> then on driver you could:
okay
> ret = of_property_read_string(np, "snps,maximum_speed", &maximum_speed);
> if (ret < 0)
> bailout();
>
> if (strncmp(maximum_speed, "superspeed", 10) == 0) {
> /* grab USB3 PHY, return EPROBE_DEFER if not found */
> grab_usb3_phy();
> }
>
> if ((strncmp(maximum_speed, "highspeed", 9) == 0) ||
> (strncmp(maximum_speed, "fullspeed", 9) == 0) ||
> (strncmp(maximum_speed, "lowspeed", 8) == 0)) {
> /* grab USB2 PHY, return EPROBE_DEFER if not found */
> grab_usb2_phy();
> }
>
> this way, we depend solely on setting maximum_speed to highspeed for
> AM437x :-)
In dra7xx one instance is superspeed and one instance highspeed.
>
> ps: don't forget to default to superspeed in case no property is passed.
okay
Regards
-George
next prev parent reply other threads:[~2013-06-26 12:07 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-26 9:29 [PATCH] usb: dwc3: core: continue probe even if usb3 phy is not available George Cherian
2013-06-26 9:29 ` George Cherian
2013-06-26 10:16 ` Felipe Balbi
2013-06-26 10:16 ` Felipe Balbi
2013-06-26 12:07 ` George Cherian [this message]
2013-06-26 12:07 ` George Cherian
2013-06-26 12:12 ` Felipe Balbi
2013-06-26 12:12 ` Felipe Balbi
2013-06-26 12:46 ` Alexander Shishkin
2013-06-26 12:46 ` Alexander Shishkin
2013-06-27 6:14 ` Michael Grzeschik
2013-06-27 6:35 ` Felipe Balbi
2013-06-27 6:35 ` Felipe Balbi
2013-06-27 7:24 ` Michael Grzeschik
2013-06-27 7:30 ` Felipe Balbi
2013-06-27 7:30 ` Felipe Balbi
2013-06-28 18:00 ` Felipe Balbi
2013-06-28 18:00 ` Felipe Balbi
[not found] ` <20130628180000.GF25498-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2013-06-28 20:06 ` Michael Grzeschik
2013-06-28 20:06 ` Michael Grzeschik
2013-06-30 8:20 ` Felipe Balbi
2013-06-30 8:20 ` Felipe Balbi
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=51CAD977.6040309@ti.com \
--to=george.cherian@ti.com \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.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.