All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
To: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
Cc: Marek Szyprowski
	<m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Kyungmin Park
	<kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Robert Baldyga
	<r.baldyga-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Paul Zimmerman <paulz-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>,
	Krzysztof Kozlowski
	<k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH 3/9] usb: dwc2/gadget: fix support for soft_connect udc framework feature
Date: Fri, 17 Oct 2014 10:49:25 -0500	[thread overview]
Message-ID: <20141017154925.GR26260@saruman> (raw)
In-Reply-To: <20141017154630.GQ26260@saruman>

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

On Fri, Oct 17, 2014 at 10:46:30AM -0500, Felipe Balbi wrote:
> Hi,
> 
> On Fri, Oct 17, 2014 at 10:44:35AM -0500, Felipe Balbi wrote:
> > On Fri, Oct 17, 2014 at 12:43:48PM +0200, Marek Szyprowski wrote:
> > > Hello,
> > > 
> > > On 2014-10-16 15:36, Felipe Balbi wrote:
> > > >On Thu, Oct 16, 2014 at 02:57:59PM +0200, Marek Szyprowski wrote:
> > > >>Enabling and disabling usb gadget by writing to
> > > >>/sys/class/udc/*hsotg/soft_connect results in calling udc_start/udc_stop
> > > >>functions with the same usb gadget driver, so the driver should not WARN
> > > >>about such case.
> > > >>
> > > >>Signed-off-by: Marek Szyprowski <m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> > > >>---
> > > >>  drivers/usb/dwc2/gadget.c | 2 +-
> > > >>  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >>
> > > >>diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> > > >>index 8870e38c1d82..37fda4c03397 100644
> > > >>--- a/drivers/usb/dwc2/gadget.c
> > > >>+++ b/drivers/usb/dwc2/gadget.c
> > > >>@@ -2892,7 +2892,7 @@ static int s3c_hsotg_udc_start(struct usb_gadget *gadget,
> > > >>  		return -EINVAL;
> > > >>  	}
> > > >>-	WARN_ON(hsotg->driver);
> > > >>+	WARN_ON(hsotg->driver && hsotg->driver != driver);
> > > >the bug is in your ->udc_stop(). You should clear hsotg->driver to NULL
> > > >there.
> > > 
> > > Ok, I will change udc_stop() to always zero hsotg->driver, like other udc
> > > drivers. I was a bit confused by the fact that udc core passes driver to
> > > udc_stop(), when called from soft_connect and NULL on gadget removal.
> > 
> > That can probably be cleaned up, I'll go have a look on all UDCs and
> > make sure I won't break anything.
> 
> looks like chipidea is the only one still using that argument, if you

meant dwc2

-- 
balbi

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

  reply	other threads:[~2014-10-17 15:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-16 12:57 [PATCH 0/9] more dwc2/gadget fixes Marek Szyprowski
2014-10-16 12:57 ` [PATCH 2/9] usb: dwc2/gadget: fix enumeration issues Marek Szyprowski
2014-10-16 13:34   ` Felipe Balbi
2014-10-16 12:57 ` [PATCH 3/9] usb: dwc2/gadget: fix support for soft_connect udc framework feature Marek Szyprowski
2014-10-16 13:36   ` Felipe Balbi
2014-10-17 10:43     ` Marek Szyprowski
2014-10-17 15:44       ` Felipe Balbi
2014-10-17 15:46         ` Felipe Balbi
2014-10-17 15:49           ` Felipe Balbi [this message]
2014-10-17 16:02             ` Felipe Balbi
2014-10-17 17:07               ` Felipe Balbi
2014-10-16 12:58 ` [PATCH 5/9] usb: dwc2/gadget: move setting last reset time to s3c_hsotg_core_init Marek Szyprowski
2014-10-16 12:58 ` [PATCH 7/9] usb: dwc2/gadget: use soft disconnect mode for implementing pullup control Marek Szyprowski
     [not found]   ` <1413464285-24172-8-git-send-email-m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-10-16 13:41     ` Felipe Balbi
     [not found] ` <1413464285-24172-1-git-send-email-m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-10-16 12:57   ` [PATCH 1/9] usb: dwc2/gadget: report disconnect event from 'end session' irq Marek Szyprowski
2014-10-16 13:33     ` Felipe Balbi
2014-10-17 10:35       ` Marek Szyprowski
2014-10-17 19:20         ` Felipe Balbi
2014-10-16 12:58   ` [PATCH 4/9] usb: dwc2/gadget: disable phy before turning off power regulators Marek Szyprowski
2014-10-16 12:58   ` [PATCH 6/9] usb: dwc2/gadget: decouple setting soft disconnect from s3c_hsotg_core_init Marek Szyprowski
     [not found]     ` <1413464285-24172-7-git-send-email-m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-10-16 13:38       ` Felipe Balbi
2014-10-20 10:46         ` Marek Szyprowski
2014-10-16 12:58   ` [PATCH 8/9] usb: dwc2/gadget: fix calls to phy control functions in suspend/resume code Marek Szyprowski
2014-10-16 13:42     ` Felipe Balbi
2014-10-20 10:46       ` Marek Szyprowski
2014-10-16 12:58   ` [PATCH 9/9] usb: dwc2/gadget: rework suspend/resume code to correctly restore gadget state Marek Szyprowski

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=20141017154925.GR26260@saruman \
    --to=balbi-l0cymroini0@public.gmane.org \
    --cc=k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=paulz-HKixBCOQz3hWk0Htik3J/w@public.gmane.org \
    --cc=r.baldyga-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.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.