From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B2B733F390 for ; Wed, 29 Apr 2026 17:52:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777485178; cv=none; b=OcSxB+Wfdhw3wvcse+uYNmMZo0mCXYJKl8da0MgkuNkzl6BskxovljeweCKUMZXvK4LY8pIlPjqIzyjY4OW0HFjSmCi6HqxNc1ei+dFm6ow2CkF1EkmCL/eLMIjdr7j/jphq6rgL9gApDUBzJZo975EL65s2XYdrV1mXOWTE9/Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777485178; c=relaxed/simple; bh=9tUvGreN/jzc8dUgMypS7VOK2O0dvFJsYzLLXf7V/X0=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=bUHJZwu8/Uc4/u7xyaitWHI9Yr/XMMWvf0ZzmnojjytgFeYh9647ctizNLeeVRVu4YhB9j7aENLErx6r2ooueM16SyGy4hwSttYeudWCDC/+t5itXD5K87Kp5C95NtvAC6sigF8TVSLxgniAwC+/AoLM0pZet6SESTDO1juJMGA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=UGSwPo79; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Sbq4CObu; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="UGSwPo79"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Sbq4CObu" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63THTGqI2127321 for ; Wed, 29 Apr 2026 17:52:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= eW+nOS0yaVrRDy95sqZ0Yxy8KhK0nrYWKOhmgEMXYf4=; b=UGSwPo791QA9RbNw 2Zz7QbO78zN5hCDd5VbvL1F8wZ0Uk8qoWoFJvmPrzEuQW1R3+qKCKNTOPWR7jaeB Pvo2XgTZIe+fmvOsqwn/mbmDsk57EdC2hNrdme358cTKK/Z4vUOJu5EJPdmmHXs9 0t2613pKeDnsGGIDn8w0C8r93GhBT5Oj6W8bUxWfExJSfdvc0w67wsdKmhOELUJC 9VC7jv0xQw+HpQB/mUmbe2QohGK2xv7+356PhiY8+Hf2c9YIJz5au5xpJpdZr0td wGte7fN0t4mppb78nPb9Ch1T0CkkYzSK0XGq0B/aTh5X5HkntkAL7EPoareS87jn YS4Bfw== Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dupe902s2-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 29 Apr 2026 17:52:56 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-2d8a677cdfaso75987eec.1 for ; Wed, 29 Apr 2026 10:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777485175; x=1778089975; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=eW+nOS0yaVrRDy95sqZ0Yxy8KhK0nrYWKOhmgEMXYf4=; b=Sbq4CObuCUwfIHth9jUT5QYUAaxVFvol2SZvtV9qjm6CLEGL1D3sB81G9WGcL85071 aCSj7Ud/3BSKsvgmx4CU8EfnL+ThOK0eW/AJiJ4jLHWsmrGwuGXx86Xr8+ErKOu4HO1u M3CgbvbHHdVhMEaa2/t3QzQ21QmFCgLHWbSeWM9I2XMDIfp85i/9kDOMH+6y46qHjvFL XXfDpXrE1+UHl8yy9HSzSaDFWuRFuh0ME4fxjLPmakg82HsGIk7DfLKUx3A8qvJED1Gy T0DUD5/6iaA42Fe8HtKtfASPIm/qG+/M4oMKsNtK/bS2HTjs6bFibr71ZW9BlfzEMwwr 9qgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777485175; x=1778089975; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eW+nOS0yaVrRDy95sqZ0Yxy8KhK0nrYWKOhmgEMXYf4=; b=mOuiDhzulfNQ4wfI7LVOHbMlDECsuHpcuS6oEpDYgFlpe+jbR/QE8yc4lAE9YDsEWl RnFCdLAgpiCd/40rbHtBSSJO8cpNzHkWimwIeB86uGRfOeQto89mDLuRXlsFhv5OdYIU 4gP78fM+b7iZoUf7gwJkv4zWVv2RIU2N+Q7o4TPqgjiJ40Y5iAMtjYvJYQbzVN98jD2R xOmnlTtAx6h0IgqJEitgaPPF4kPmWTOv6tWfrbttVE5Hh0A9nH325Z3MjCFwoafcExCV FTV08aYdaMymo/6ZCDLp44v3ZneiTK+Q7AKmrmvHU0hAP5UYtzwsC6TRCv3iYkw1d3lG y8Uw== X-Forwarded-Encrypted: i=1; AFNElJ9aEf9gKKv9InyRRfDp/gAz/9Kl5JPXlNMpaq1TFk9sqdvqZA7bh2xHBdOeuDFMS0Xr/IXDKYfnttNxoCc=@vger.kernel.org X-Gm-Message-State: AOJu0Yzy9TEV+KnE0YeakzG4BDxH0MS0TimlQvrG2ElkPKNhlftVKpsl fhfpizRwIM+KAuxuDTYHWZSm/2wASe4rqgFe7f5DNjaLI3mpwvA3TDnC4t32f71qHEDT3Ps091t FGHGw1UMmpvveSSCnuQaBMyTV388OG9oW213I2XzEw0Ka2tsYG/hDBcg85EViztPFaJY= X-Gm-Gg: AeBDiesrzVyZUMJBrBRdMqkrpeIh7D0P3cMM4BcAocM8lm1Em4VVLCA6eOEY+DT3tqW 0X6oS+z7aM02R2Rsh+ihWKAn6DoUCBzjhhfBeHh+APM+Y8fK6uiyoa/ndXwnyfeSi0G06itd++Z cx+Q2zNAfHBwUPWan9SdopMeQDRQviagv23hkVD5b9A1glm44ieznNsNeD7vqyN0AXH/Lf/Vy/r kv4xfcCkveFV+toL5ygopykGkNZvIU46p4LUkq6f9fFdzyKC9IYisD37+gmjVxVPEyj0OJJclNH mGUq3/RgEHoNc/BpjJ/1S2SFbLj3XK5XsKScgXXss06/COEkOj45eWHA8q54P3fNFdpIAmk10aA JydmUcW6qgiQN4TYawvVUD3aqrfrARoTs4+eZYgjA/GyWql5MFwZpvCPOdX4mZw== X-Received: by 2002:a05:7300:fb87:b0:2da:45f8:1b41 with SMTP id 5a478bee46e88-2ed198bf34amr2219528eec.19.1777485174947; Wed, 29 Apr 2026 10:52:54 -0700 (PDT) X-Received: by 2002:a05:7300:fb87:b0:2da:45f8:1b41 with SMTP id 5a478bee46e88-2ed198bf34amr2219510eec.19.1777485174404; Wed, 29 Apr 2026 10:52:54 -0700 (PDT) Received: from [192.168.1.133] ([70.95.199.79]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2ed1bf6d52fsm3149803eec.4.2026.04.29.10.52.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Apr 2026 10:52:53 -0700 (PDT) Message-ID: Date: Wed, 29 Apr 2026 10:52:52 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] usb: dwc3: avoid probe deferral when USB power supply is not available From: Elson Serrao To: Thinh Nguyen , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, jack.pham@oss.qualcomm.com, wesley.cheng@oss.qualcomm.com References: <20260407232410.4101455-1-elson.serrao@oss.qualcomm.com> Content-Language: en-US In-Reply-To: <20260407232410.4101455-1-elson.serrao@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: 1ZFoJuanjnwQ3vT7II53R6jp7Rv2OMv_ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI5MDE4MCBTYWx0ZWRfX4VSF5Yp0NMTl +k8nt7yk8DAQfraxDKZ1TTrg3NENEcUwCBfYI2TlPiI1IHeRw9XtRqE3HUe5RmjKVIA3A8YNbrh 8+VyyVRoglxiTNxQNxTrylD5L6pu6frhdr+VOC3YXUSYqrg5GBPYQq7pdYQgpAs0F2btQ3OUqTz U/8VTYir/EWmQ/M+aAd3y5pAMhWPOKgEbzEwyYYzTvTm6DZMfWh7tpWcGUS6FVrK2K5UjXec1D7 F1Wtg7nM8KgBMRfXT23CdbG2h8XlFiRon54rZcE10JoR2ZlHSJHNPjgpfJxxYSJJdzUOO8YEB1S dNACJqTKSFWeu/q+10lFBtnYrMDzYynr9XFRFtB+htKB9S2wbUmu+D46+5v+PtVazRBjwF2clgR umlqWMyOQPLas4ILt3IbJb0yaqy0iyY/WSsHQ4RXocHEYWmB1p9aFhb3LhyutCMENEvmUx7Su9E 94oW70KGx4sxxRIXIaQ== X-Proofpoint-ORIG-GUID: 1ZFoJuanjnwQ3vT7II53R6jp7Rv2OMv_ X-Authority-Analysis: v=2.4 cv=PvmjqQM3 c=1 sm=1 tr=0 ts=69f24578 cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=uHxescsG3rBdxcXwcPaeSg==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=76KTEkCVzLvc39UprA4A:9 a=QEXdDO2ut3YA:10 a=scEy_gLbYbu1JhEsrz4S:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-29_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 spamscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 phishscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604290180 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 > --- > 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; > }