mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
To: Peter Chen <peter.chen@nxp.com>
Cc: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Robert Baldyga <r.baldyga@samsung.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: gadget: f_acm: don't disable disabled EP
Date: Fri, 29 May 2020 15:55:24 +0200	[thread overview]
Message-ID: <20200529135524.GA14614@qmqm.qmqm.pl> (raw)
In-Reply-To: <20200529081104.GD32755@b29397-desktop>

On Fri, May 29, 2020 at 08:10:40AM +0000, Peter Chen wrote:
> On 20-05-28 20:30:28, Michał Mirosław wrote:
> > Make debugging real problems easier by not trying to disable an EP that
> > was not yet enabled.
> > 
> > Fixes: 4aab757ca44a ("usb: gadget: f_acm: eliminate abuse of ep->driver data")
> > Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> > ---
> >  drivers/usb/gadget/function/f_acm.c | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/usb/gadget/function/f_acm.c b/drivers/usb/gadget/function/f_acm.c
> > index 200596ea9557..46647bfac2ef 100644
> > --- a/drivers/usb/gadget/function/f_acm.c
> > +++ b/drivers/usb/gadget/function/f_acm.c
> > @@ -425,9 +425,11 @@ static int acm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
> >  	/* we know alt == 0, so this is an activation or a reset */
> >  
> >  	if (intf == acm->ctrl_id) {
> > -		dev_vdbg(&cdev->gadget->dev,
> > -				"reset acm control interface %d\n", intf);
> > -		usb_ep_disable(acm->notify);
> > +		if (acm->notify->enabled) {
> > +			dev_vdbg(&cdev->gadget->dev,
> > +					"reset acm control interface %d\n", intf);
> > +			usb_ep_disable(acm->notify);
> > +		}
> 
> But it does not fix any issues, the usb_ep_disable checks 'enabled' flag.

It generates spurious trace events if you enable them.

Best Regards,
Michał Mirosław

  reply	other threads:[~2020-05-29 13:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 18:30 Michał Mirosław
2020-05-29  8:10 ` Peter Chen
2020-05-29 13:55   ` Michał Mirosław [this message]
2020-05-30  1:03     ` Peter Chen
2020-05-30 17:15       ` Michał Mirosław
2020-06-01  3:53         ` Peter Chen
2020-07-01  6:54         ` Felipe Balbi
2020-07-01  6:53       ` 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=20200529135524.GA14614@qmqm.qmqm.pl \
    --to=mirq-linux@rere.qmqm.pl \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@nxp.com \
    --cc=r.baldyga@samsung.com \
    /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

Powered by JetHome