Linux USB
 help / color / mirror / Atom feed
From: Elson Serrao <elson.serrao@oss.qualcomm.com>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	jack.pham@oss.qualcomm.com, wesley.cheng@oss.qualcomm.com
Subject: Re: [PATCH] usb: dwc3: avoid probe deferral when USB power supply is not available
Date: Wed, 29 Apr 2026 10:52:52 -0700	[thread overview]
Message-ID: <ed8566ad-2a98-43c1-8d89-d4ddc37e273e@oss.qualcomm.com> (raw)
In-Reply-To: <20260407232410.4101455-1-elson.serrao@oss.qualcomm.com>



On 4/7/2026 4:24 PM, Elson Serrao wrote:
> The dwc3 driver currently defers probe if the USB power supply is not yet
> registered. On some platforms, even though charging and power supply
> functionality is available during normal operation, there may exist
> minimal booting modes (such as recovery or diagnostic environments) where
> the relevant USB power supply device is not registered. In such cases,
> probe deferral prevents USB gadget operation entirely.
> 
> USB data functionality for basic operation does not inherently depend on
> the power supply framework, which is only required for enforcing VBUS
> current control. The configured VBUS current limit is typically enforced
> through the charger or PMIC power path. When charging functionality is
> unavailable, applying a current limit has no practical effect, reducing
> the benefit of strict probe-time enforcement in these environments.
> 
> Instead of deferring probe, register a power supply notifier when the
> USB power supply is not yet available. Cache the requested VBUS current
> limit and apply it once the matching power supply becomes available, as
> notified through the registered callback.
> 
> Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
> ---
>  drivers/usb/dwc3/core.c   | 82 ++++++++++++++++++++++++++++++++-------
>  drivers/usb/dwc3/core.h   |  4 ++
>  drivers/usb/dwc3/gadget.c | 10 ++++-
>  3 files changed, 80 insertions(+), 16 deletions(-)
> 


Hi Thinh,

Just a gentle reminder about this patch.
Please let me know if any changes are needed.

Thanks,
Elson

[...]

> +	if (!dwc->usb_psy) {
> +		spin_unlock_irqrestore(&dwc->lock, flags);
> +		dev_dbg(dwc->dev, "Stored VBUS draw: %u mA (power supply not ready)\n", mA);
>  		return -EOPNOTSUPP;
> +	}
>  
> -	dwc->current_limit = mA;
>  	schedule_work(&dwc->vbus_draw_work);
> +	spin_unlock_irqrestore(&dwc->lock, flags);
>  
>  	return 0;
>  }

  reply	other threads:[~2026-04-29 17:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-07 23:24 [PATCH] usb: dwc3: avoid probe deferral when USB power supply is not available Elson Serrao
2026-04-29 17:52 ` Elson Serrao [this message]
2026-04-30  7:43   ` Thinh Nguyen
2026-05-02  0:55 ` Thinh Nguyen
2026-05-06 22:59   ` Elson Serrao
2026-05-07 23:02     ` Thinh Nguyen
2026-05-08  0:28       ` Elson Serrao

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=ed8566ad-2a98-43c1-8d89-d4ddc37e273e@oss.qualcomm.com \
    --to=elson.serrao@oss.qualcomm.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jack.pham@oss.qualcomm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=wesley.cheng@oss.qualcomm.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