From: Alan Stern <stern@rowland.harvard.edu>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Felipe Balbi <balbi@kernel.org>,
linux-usb@vger.kernel.org, kernel@pengutronix.de
Subject: Re: refcount underflow on stm32mp1
Date: Thu, 17 Mar 2022 12:07:51 -0400 [thread overview]
Message-ID: <YjNc1yCrbMenBkOP@rowland.harvard.edu> (raw)
In-Reply-To: <20220317104949.ln75wh2a22vekwj2@pengutronix.de>
On Thu, Mar 17, 2022 at 11:49:49AM +0100, Uwe Kleine-König wrote:
> On Wed, Mar 16, 2022 at 10:44:37PM +0100, Uwe Kleine-König wrote:
> > The problem is that after usb_add_gadget_udc() failed in
> > dwc2_driver_probe(), dwc2_hsotg_remove() -> usb_del_gadget_udc() ->
> > usb_put_gadget() -> put_device() results in that underflow.
> >
> > With that information I'd expect that someone understanding how
> > reference counting works with usb gadgets should be able to come up with
> > a fix.
>
> The problem is that usb_add_gadget_udc() failing already calls
> usb_put_gadget() and so dwc2_hsotg_remove() must not call it again when
> called from dwc2_driver_probe.
>
> I don't understand that udc stuff enough to be confident that a patch I
> create for that will do the right thing.
You should CC: the maintainer of the dwc2 driver. That's the best
person to know how to fix dwc2_hsotg_remove().
Alan Stern
prev parent reply other threads:[~2022-03-17 16:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-16 16:47 refcount underflow on stm32mp1 Uwe Kleine-König
2022-03-16 17:09 ` Greg Kroah-Hartman
2022-03-16 21:44 ` Uwe Kleine-König
2022-03-17 10:49 ` Uwe Kleine-König
2022-03-17 16:07 ` Alan Stern [this message]
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=YjNc1yCrbMenBkOP@rowland.harvard.edu \
--to=stern@rowland.harvard.edu \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel@pengutronix.de \
--cc=linux-usb@vger.kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
/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