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

From: Greg KH
Date: Wed Sep 11 2024 - 09:31:23 EST


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.

thanks,

greg k-h