public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: linuxzsc@gmail.com (Richard Zhao)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 05/11] USB: chipidea: don't let probe fail if otg controller start one role failed
Date: Tue, 4 Sep 2012 22:17:33 +0800	[thread overview]
Message-ID: <20120904141732.GC19897@richard-laptop> (raw)
In-Reply-To: <20120829104559.GB25433@b20223-02.ap.freescale.net>

On Wed, Aug 29, 2012 at 06:46:00PM +0800, Richard Zhao wrote:
> On Wed, Aug 29, 2012 at 12:48:15PM +0300, Alexander Shishkin wrote:
> > Richard Zhao <richard.zhao@freescale.com> writes:
> > 
> > > On Wed, Aug 29, 2012 at 11:10:33AM +0300, Alexander Shishkin wrote:
> > >> Richard Zhao <richard.zhao@freescale.com> writes:
> > >> 
> > >> > On Tue, Aug 28, 2012 at 11:38:23AM +0300, Alexander Shishkin wrote:
> > >> >> Richard Zhao <richard.zhao@freescale.com> writes:
> > >> >> 
> > >> >> > One role failed, but the other role will possiblly still work.
> > >> >> > For example, when udc start failed, if plug in a host device,
> > >> >> > it works.
> > >> >> 
> > >> >> If you're a host device, ci->role should be HOST at this point and
> > >> >> ci_role_start() shouldn't fail. If ci->role is detected wrongly, the
> > >> >> role detection must be fixed. If ci_role_start() fails for host, but it
> > >> >> still works when it's called again after the id pin change is detected,
> > >> >> again, the problem is elsewhere.
> > >> > The check is only for OTG device. For single role device, it just fail
> > >> > if it start the role failed.
> > >> 
> > >> Sorry, can you rephrase?
> > >> 
> > >> >> 
> > >> >> >
> > >> >> > Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
> > >> >> > ---
> > >> >> >  drivers/usb/chipidea/core.c |    7 +++++--
> > >> >> >  1 file changed, 5 insertions(+), 2 deletions(-)
> > >> >> >
> > >> >> > diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> > >> >> > index 19ef324..8fd390a 100644
> > >> >> > --- a/drivers/usb/chipidea/core.c
> > >> >> > +++ b/drivers/usb/chipidea/core.c
> > >> >> > @@ -473,8 +473,11 @@ static int __devinit ci_hdrc_probe(struct platform_device *pdev)
> > >> >> >  	ret = ci_role_start(ci, ci->role);
> > >> >> >  	if (ret) {
> > >> >> >  		dev_err(dev, "can't start %s role\n", ci_role(ci)->name);
> > >> >> > -		ret = -ENODEV;
> > >> >> > -		goto rm_wq;
> > >> >> > +		ci->role = CI_ROLE_END;
> > >> >> 
> > >> >> So are you relying on id pin interrupt for initializing the role after
> > >> >> this? Can you provide more details?
> > >> > Yes. The ID pin detect still works. My case is, gadget role failed,
> > >> > host role works. I was trying not to ruin host function.
> > >> 
> > >> But it shouldn't even try to start the gadget, because ci_otg_role()
> > >> should set ci->role to HOST before ci_role_start() happens.
> > > It depends on ID pin. If ID pin is gadget and gadget is not support well,
> > > ci_role_start will fail. See below example.
> > >> 
> > >> Another question is, why does gadget start fail?
> > > There's one example:
> > > If usb phy don't support otg yet, otg_set_peripheral will fail, and
> > > then cause udc_start fail.
> > 
> > So you should drop the CI13XXX_REQUIRE_TRANSCEIVER flag from imx
> > platform data till the phy is fully implemented.
> It's just an example. We can not assume udc_start always success. If it
> fails, isn't it better to continue support of host than say game over?
Hi Alex,

Is it persuadable? Could you please give comments of other patches too?

Thanks
Richard
> 
> Thanks
> Richard
> > 
> > Regards,
> > --
> > Alex
> > 
> 

  reply	other threads:[~2012-09-04 14:17 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-28  7:03 [PATCH v2 00/11] chipidea/imx: add otg support and some bug fix Richard Zhao
2012-08-28  7:03 ` [PATCH v2 01/11] USB: chipidea: imx: add pinctrl support Richard Zhao
2012-08-28  7:03 ` [PATCH v2 02/11] USB: chipidea: delay 2ms before read ID status at probe time Richard Zhao
2012-08-28  7:03 ` [PATCH v2 03/11] USB: chipidea: move OTGSC_IDIS clearing from ci_role_work to irq handler Richard Zhao
2012-08-28  7:03 ` [PATCH v2 04/11] USB: chipidea: clear gadget struct at udc_start fail path Richard Zhao
2012-08-28  8:29   ` Alexander Shishkin
2012-08-28  9:09     ` Richard Zhao
2012-08-29  8:03       ` Alexander Shishkin
2012-08-29  8:22         ` Richard Zhao
2012-08-29  9:44           ` Alexander Shishkin
2012-08-29 10:37             ` Richard Zhao
2012-08-28  7:03 ` [PATCH v2 05/11] USB: chipidea: don't let probe fail if otg controller start one role failed Richard Zhao
2012-08-28  8:38   ` Alexander Shishkin
2012-08-28  9:27     ` Richard Zhao
2012-08-29  8:10       ` Alexander Shishkin
2012-08-29  8:33         ` Richard Zhao
2012-08-29  9:48           ` Alexander Shishkin
2012-08-29 10:46             ` Richard Zhao
2012-09-04 14:17               ` Richard Zhao [this message]
2012-09-11  7:23               ` Alexander Shishkin
2012-09-11  8:18                 ` Richard Zhao
2012-09-12 10:47                   ` Alexander Shishkin
2012-09-14  8:35                     ` Richard Zhao
2012-09-14 10:25                       ` Alexander Shishkin
2012-09-17  8:59                         ` Richard Zhao
2012-08-28  7:03 ` [PATCH v2 06/11] USB: mxs-phy: add basic otg support Richard Zhao
2012-09-11  9:05   ` Felipe Balbi
2012-09-12 10:39   ` Heikki Krogerus
2012-09-14  8:30     ` Richard Zhao
2012-09-14  8:56   ` Chen Peter-B29397
2012-09-14 10:53     ` Richard Zhao
2012-08-28  7:03 ` [PATCH v2 07/11] USB: chipidea: add vbus detect for udc Richard Zhao
2012-08-28  7:03 ` [PATCH v2 08/11] USB: chipidea: convert to use devm_request_irq Richard Zhao
2012-08-28  7:03 ` [PATCH v2 09/11] USB: chipidea: add -DDEBUG if CONFIG_USB_CHIPIDEA_DEBUG Richard Zhao
2012-08-28  7:03 ` [PATCH v2 10/11] USB: chipidea: add set_vbus_power support Richard Zhao
2012-09-19  1:25   ` Richard Zhao
2012-08-28  7:03 ` [PATCH v2 11/11] USB: chipidea: re-order irq handling to avoid unhandled irq Richard Zhao
2012-09-05 14:27 ` [PATCH v2 00/11] chipidea/imx: add otg support and some bug fix Marc Kleine-Budde
2012-09-05 15:01 ` Michael Grzeschik

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=20120904141732.GC19897@richard-laptop \
    --to=linuxzsc@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox