Re: [PATCH] usb: dwc3: Runtime get and put usb power_supply handle

From: Thinh Nguyen
Date: Wed Sep 11 2024 - 18:20:13 EST


Hi Greg,

On Wed, Sep 11, 2024, Greg KH wrote:
> On Mon, Jul 15, 2024 at 10:58:27AM +0800, Kyle Tso wrote:
> > It is possible that the usb power_supply is registered after the probe
> > of dwc3. In this case, trying to get the usb power_supply during the
> > probe will fail and there is no chance to try again. Also the usb
> > power_supply might be unregistered at anytime so that the handle of it
> > in dwc3 would become invalid. To fix this, get the handle right before
> > calling to power_supply functions and put it afterward.
> >
> > Fixes: 6f0764b5adea ("usb: dwc3: add a power supply for current control")
> > Cc: stable@xxxxxxxxxxxxxxx
> > Signed-off-by: Kyle Tso <kyletso@xxxxxxxxxx>
> > ---
> > drivers/usb/dwc3/core.c | 25 +++++--------------------
> > drivers/usb/dwc3/core.h | 4 ++--
> > drivers/usb/dwc3/gadget.c | 19 ++++++++++++++-----
> > 3 files changed, 21 insertions(+), 27 deletions(-)
>
> Did this get lost somewhere? You might need to resend it now that Thinh
> is back from vacation.
>

You're looking at the outdated patch. Here's where we left off from the
last discussion on v3 of this:

https://lore.kernel.org/linux-usb/20240810005634.6ig2e3hdsgx3wkan@xxxxxxxxxxxx/#t

BR,
Thinh