Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	linux-usb@vger.kernel.org
Cc: balbi@kernel.org, Joel Stanley <joel@jms.id.au>,
	Alan Stern <stern@rowland.harvard.edu>
Subject: Re: [PATCH v2 04/12] usb: gadget: aspeed: Improve debugging when nuking
Date: Sat, 13 Jul 2019 09:40:46 +1000
Message-ID: <bac94289bf8fb79c495418b810e434bd18758c26.camel@kernel.crashing.org> (raw)
In-Reply-To: <bbda0e6e-1710-f4e9-3b15-1a450566e4d4@cogentembedded.com>

On Fri, 2019-07-12 at 12:06 +0300, Sergei Shtylyov wrote:
> On 12.07.2019 12:01, Sergei Shtylyov wrote:
> 
> > > When nuking requests, it's useful to display how many were
> > > actually nuked. It has proven handy when debugging issues
> > > where EP0 went in a wrong state.
> > > 
> > > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > > ---
> > >   drivers/usb/gadget/udc/aspeed-vhub/core.c | 7 +++++--
> > >   1 file changed, 5 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/usb/gadget/udc/aspeed-vhub/core.c 
> > > b/drivers/usb/gadget/udc/aspeed-vhub/core.c
> > > index db3628be38c0..0c77cd488c48 100644
> > > --- a/drivers/usb/gadget/udc/aspeed-vhub/core.c
> > > +++ b/drivers/usb/gadget/udc/aspeed-vhub/core.c
> > > @@ -65,13 +65,16 @@ void ast_vhub_done(struct ast_vhub_ep *ep, struct 
> > > ast_vhub_req *req,
> > >   void ast_vhub_nuke(struct ast_vhub_ep *ep, int status)
> > >   {
> > >       struct ast_vhub_req *req;
> > > -
> > > -    EPDBG(ep, "Nuking\n");
> > > +    int count = 0;
> > >       /* Beware, lock will be dropped & req-acquired by done() */
> > >       while (!list_empty(&ep->queue)) {
> > >           req = list_first_entry(&ep->queue, struct ast_vhub_req, queue);
> > >           ast_vhub_done(ep, req, status);
> > > +        count++;
> > > +    }
> > > +    if (count) {
> > > +        EPDBG(ep, "Nuked %d request(s)\n", count);
> > 
> >     CodingStyle says to avoid {} around a single statement.
> 
>     I somehow missed this in v1 posting, sorry about that.

Yeah well ... there used to be more in there, forgot to remove the {}
when I stripped it down. I'm not going to respin for something so
trivial unless something else shows up.

Felipe, what's your situation with getting those patches ? I haven't
heard for you in a couple of weeks...

Cheers,
Ben.



  reply index

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12  2:53 [PATCH 00/10] usb: gadget: aspeed: Bug fixes Benjamin Herrenschmidt
2019-07-12  2:53 ` [PATCH v2 01/12] usb: gadget: aspeed: Don't set port enable change bit on reset Benjamin Herrenschmidt
2019-07-12  2:53 ` [PATCH v2 02/12] usb: gadget: aspeed: Cleanup EP0 state on port reset Benjamin Herrenschmidt
2019-07-12  2:53 ` [PATCH v2 03/12] usb: gadget: aspeed: Fix EP0 stall handling Benjamin Herrenschmidt
2019-07-12  2:53 ` [PATCH v2 04/12] usb: gadget: aspeed: Improve debugging when nuking Benjamin Herrenschmidt
2019-07-12  9:01   ` Sergei Shtylyov
2019-07-12  9:06     ` Sergei Shtylyov
2019-07-12 23:40       ` Benjamin Herrenschmidt [this message]
2019-07-12  2:53 ` [PATCH v2 05/12] usb: gadget: aspeed: Don't reject requests on suspended devices Benjamin Herrenschmidt
2019-07-12  2:53 ` [PATCH v2 06/12] usb: gadget: aspeed: Check suspend/resume callback existence Benjamin Herrenschmidt
2019-07-12  2:53 ` [PATCH v2 07/12] usb: gadget: aspeed: Rework the reset logic Benjamin Herrenschmidt
2019-07-12  2:53 ` [PATCH v2 08/12] usb: gadget: aspeed: Remove unused "suspended" flag Benjamin Herrenschmidt
2019-07-12  2:53 ` [PATCH v2 09/12] usb: gadget: composite: Clear "suspended" on reset/disconnect Benjamin Herrenschmidt
2019-07-12  2:53 ` [PATCH v2 10/12] usb: gadget: mass_storage: Fix races between fsg_disable and fsg_set_alt Benjamin Herrenschmidt
2019-07-12  2:53 ` [PATCH v2 11/12] usb: Add definitions for the USB2.0 hub TT requests Benjamin Herrenschmidt
2019-07-12  2:53 ` [PATCH v2 12/12] usb: gadget: aspeed: Implement dummy " Benjamin Herrenschmidt
2019-07-12  2:59 ` [PATCH 00/10] usb: gadget: aspeed: Bug fixes Benjamin Herrenschmidt

Reply instructions:

You may reply publically 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=bac94289bf8fb79c495418b810e434bd18758c26.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=balbi@kernel.org \
    --cc=joel@jms.id.au \
    --cc=linux-usb@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=stern@rowland.harvard.edu \
    /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

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org linux-usb@archiver.kernel.org
	public-inbox-index linux-usb


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/ public-inbox