From: Peter Chen <hzpeterchen@gmail.com>
To: Peter Chen <peter.chen@nxp.com>
Cc: balbi@kernel.org, USB list <linux-usb@vger.kernel.org>,
linux-imx@nxp.com
Subject: Re: [PATCH RESEND 2/2] usb: gadget: core: do not try to disconnect gadget if it is not connected
Date: Tue, 1 Dec 2020 14:45:30 +0800 [thread overview]
Message-ID: <CAL411-qOjz+Ut1de8VLS2miM7JEJ4s6x-AhYqhcSxDou6DU-jg@mail.gmail.com> (raw)
In-Reply-To: <CAL411-rS0Fa4Z7emwAC6wcMnBGJ9+y8X_-64Q7XB_BOz_DGOgQ@mail.gmail.com>
BR,
Peter Chen
On Thu, Oct 29, 2020 at 6:45 PM Peter Chen <hzpeterchen@gmail.com> wrote:
>
> On Tue, Oct 13, 2020 at 8:01 PM Peter Chen <peter.chen@nxp.com> wrote:
> >
> > Current UDC core connects gadget during the loading gadget flow
> > (udc_bind_to_driver->usb_udc_connect_control), but for
> > platforms which do not connect gadget if the VBUS is not there,
> > they call usb_gadget_disconnect, but the gadget is not connected
> > at this time, notify disconnecton for the gadget driver is meaningless
> > at this situation.
> >
> > Signed-off-by: Peter Chen <peter.chen@nxp.com>
> > ---
> > drivers/usb/gadget/udc/core.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c
> > index 215ecbe8b692..8ad4203dea8c 100644
> > --- a/drivers/usb/gadget/udc/core.c
> > +++ b/drivers/usb/gadget/udc/core.c
> > @@ -672,6 +672,9 @@ int usb_gadget_connect(struct usb_gadget *gadget)
> > goto out;
> > }
> >
> > + if (!gadget->connected)
> > + goto out;
> > +
> > if (gadget->deactivated) {
> > /*
> > * If gadget is deactivated we only save new state.
> > --
> > 2.17.1
> >
>
> A gentle ping.
>
ping again.
Peter
next prev parent reply other threads:[~2020-12-01 6:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-13 9:27 [PATCH RESEND 1/2] usb: gadget: core: change the comment for usb_gadget_connect Peter Chen
2020-10-13 9:27 ` [PATCH RESEND 2/2] usb: gadget: core: do not try to disconnect gadget if it is not connected Peter Chen
2020-10-29 10:45 ` Peter Chen
2020-12-01 6:45 ` Peter Chen [this message]
[not found] ` <CAL411-pgUVSieBSCa1D8CLL+qSJ8SHTVWt998XgJp0UVNWp1Mg@mail.gmail.com>
2020-12-29 10:17 ` Greg Kroah-Hartman
2020-12-01 6:46 ` [PATCH RESEND 1/2] usb: gadget: core: change the comment for usb_gadget_connect Peter Chen
[not found] ` <CAL411-pcwrRyPCnq79JHZRH4db39Ke31E4tNH2W3vAbwJc=2xA@mail.gmail.com>
2020-12-29 10:17 ` Greg Kroah-Hartman
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=CAL411-qOjz+Ut1de8VLS2miM7JEJ4s6x-AhYqhcSxDou6DU-jg@mail.gmail.com \
--to=hzpeterchen@gmail.com \
--cc=balbi@kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-usb@vger.kernel.org \
--cc=peter.chen@nxp.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;
as well as URLs for NNTP newsgroup(s).