Message ID | 1677142665-8686-3-git-send-email-quic_prashk@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp213406wrd; Thu, 23 Feb 2023 01:12:17 -0800 (PST) X-Google-Smtp-Source: AK7set8rXFBnrUrguwlqRf/ywmFyZVE5rFyrpA3sf2AM0hmjK79EACJpOSUgNbk6+ZKjkTBc+3dJ X-Received: by 2002:a17:906:256:b0:8b1:4141:8a30 with SMTP id 22-20020a170906025600b008b141418a30mr20324935ejl.6.1677143537477; Thu, 23 Feb 2023 01:12:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677143537; cv=none; d=google.com; s=arc-20160816; b=a3TJYR4ih75C+oKGlbTh4ZpbEWXzEk6hSe6yT+E8dCV6AlqbGlRKmQCZAtgezzrEuO mEIMa9aT1FFTl8dT3K++uwiJ6Gz4cS4B9LTCAyGq+KlZI06z6b+GcUOp560kzESnpfiZ +BHmv8MPtw1K+/iH5Sz5CwsQp+aT/iONvdkN6sqoI4rOxIarFtEk1NcpbQVC8z+D+ebb Ar43AiczDOoz0vFqD3Ixicsp5irl10JLtGCFdFC1mwuTXQvnSUTLXVLS6p9W23ZaVCQG DC6WDiRs+9B+Zop65/nJ1iv6cKUesOBtNoJmnXWGlzc8fH0+BM3beVmoB8807fSv10cF m/Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=2K+C8HMS9npx4Hhjm7Ocj7wuGl6LtUkhYA+q3Bkv+oQ=; b=UUqfZYCPl5PJudQbFm7e/jQH6Dc11iyKMbcK+BrebooywQHSYaphCT9JiVF1i4ZGZH aRS3IguGKb4ctLboM1iwfKIiotiEs89/Sw37GCefJxse+InwLZ0pN+gANdzxRylGk6gN 2psXOkG7vrlZSeN1Eb5hlxofF2VPmyU+cSMdQoHfVGoke9F5XYDIcZrPbw2FmjYs/GtH /FvKXXRiQPWuWwqXnZP3cTeBmjx+yCOiEyqfbwCBpKcQEzU+Xh2+ZZ54Fr+rfTBPZQH5 BrqsUL0RUNxsZFozMrvb6oWtPFQj4u2w9zhH/MvIAdCKT+wAmOrXMB9Dn38V17APZRO5 cDBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=HH+d6JmL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fn11-20020a1709069d0b00b008b17b101083si18741830ejc.45.2023.02.23.01.11.53; Thu, 23 Feb 2023 01:12:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=HH+d6JmL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233056AbjBWI6J (ORCPT <rfc822;cambridge8321@gmail.com> + 99 others); Thu, 23 Feb 2023 03:58:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233763AbjBWI6G (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 23 Feb 2023 03:58:06 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B35564E5FD; Thu, 23 Feb 2023 00:58:05 -0800 (PST) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31N5A1hP023409; Thu, 23 Feb 2023 08:58:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=2K+C8HMS9npx4Hhjm7Ocj7wuGl6LtUkhYA+q3Bkv+oQ=; b=HH+d6JmLDWZ67zbCGKMIuiaMcl2DkdkbJjc4qmwqn50cb1Ag9ED8o5XoCJjblwgOskgA 1+ENU1FdX8e7It3QxBpTdbjFXo+z8Ph3UwkcT2/JvKmybtCeDProqw7EIMK3bS4z9iTm 4y2fhMlb6GF/bZTuXq39ctRJ5IVBgtGykPq3i7s7iJo5rZxXyNJH/DVsczX3gGoEE/NZ zo72UNB0XjAC47dCZy+H+mQAb1JaG7n+v039L/gSLy7vfNIP8pPSUxyiZCh2nGb5ITVx wSWkIytRfEzNKFGcQAVHAOl77r4b+ygLJyH5dOw+tckz0mW48RLNbtqvkRrSnDCBBMSi Fw== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3nwy9a0tku-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Feb 2023 08:58:02 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 31N8w1Zn016477 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Feb 2023 08:58:01 GMT Received: from hu-prashk-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 23 Feb 2023 00:57:57 -0800 From: Prashanth K <quic_prashk@quicinc.com> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Thinh Nguyen <Thinh.Nguyen@synopsys.com>, Jakob Koschel <jakobkoschel@gmail.com>, =?utf-8?b?SsOzIMOBZ2lsYSBCaXRzY2g=?= <jgilab@gmail.com>, Alan Stern <stern@rowland.harvard.edu> CC: Pratham Pratap <quic_ppratap@quicinc.com>, Jack Pham <quic_jackp@quicinc.com>, <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>, Prashanth K <quic_prashk@quicinc.com> Subject: [PATCH v2 2/2] usb: gadget: composite: Draw 100mA current if not configured Date: Thu, 23 Feb 2023 14:27:45 +0530 Message-ID: <1677142665-8686-3-git-send-email-quic_prashk@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1677142665-8686-1-git-send-email-quic_prashk@quicinc.com> References: <1677142665-8686-1-git-send-email-quic_prashk@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 34TsFu1mA0ppEYHxSzBTPPcWCaIFQXn8 X-Proofpoint-ORIG-GUID: 34TsFu1mA0ppEYHxSzBTPPcWCaIFQXn8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-23_04,2023-02-22_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 malwarescore=0 spamscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 mlxscore=0 mlxlogscore=621 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302230077 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758612462024577990?= X-GMAIL-MSGID: =?utf-8?q?1758612462024577990?= |
Series |
Fix vbus draw of dwc3 gadget
|
|
Commit Message
Prashanth K
Feb. 23, 2023, 8:57 a.m. UTC
Currently we don't change the current value if device isn't in
configured state. But the battery charging specification says,
device can draw up to 100mA of current if its in unconfigured
state. Hence add a Vbus_draw work in composite_resume to draw
100mA if the device isn't configured.
Signed-off-by: Prashanth K <quic_prashk@quicinc.com>
---
drivers/usb/gadget/composite.c | 3 +++
1 file changed, 3 insertions(+)
Comments
Hi Prashanth, Thank you for the patch! Yet something to improve: [auto build test ERROR on usb/usb-testing] [also build test ERROR on usb/usb-next usb/usb-linus linus/master v6.2] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Prashanth-K/usb-dwc3-gadget-Change-condition-for-processing-suspend-event/20230223-165955 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing patch link: https://lore.kernel.org/r/1677142665-8686-3-git-send-email-quic_prashk%40quicinc.com patch subject: [PATCH v2 2/2] usb: gadget: composite: Draw 100mA current if not configured config: hexagon-randconfig-r005-20230222 (https://download.01.org/0day-ci/archive/20230223/202302231910.xs35xNcG-lkp@intel.com/config) compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project db89896bbbd2251fff457699635acbbedeead27f) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/19beaeb0554fc9c1556e8f7da85011f4267bd8fc git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Prashanth-K/usb-dwc3-gadget-Change-condition-for-processing-suspend-event/20230223-165955 git checkout 19beaeb0554fc9c1556e8f7da85011f4267bd8fc # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/usb/gadget/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> | Link: https://lore.kernel.org/oe-kbuild-all/202302231910.xs35xNcG-lkp@intel.com/ All error/warnings (new ones prefixed by >>): In file included from drivers/usb/gadget/composite.c:19: In file included from include/linux/usb/composite.h:27: In file included from include/linux/usb/gadget.h:24: In file included from include/linux/scatterlist.h:9: In file included from arch/hexagon/include/asm/io.h:334: include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __raw_readb(PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu' #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) ^ In file included from drivers/usb/gadget/composite.c:19: In file included from include/linux/usb/composite.h:27: In file included from include/linux/usb/gadget.h:24: In file included from include/linux/scatterlist.h:9: In file included from arch/hexagon/include/asm/io.h:334: include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu' #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) ^ In file included from drivers/usb/gadget/composite.c:19: In file included from include/linux/usb/composite.h:27: In file included from include/linux/usb/gadget.h:24: In file included from include/linux/scatterlist.h:9: In file included from arch/hexagon/include/asm/io.h:334: include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writeb(value, PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ >> drivers/usb/gadget/composite.c:2535:14: warning: comparison of distinct pointer types ('typeof (2) *' (aka 'int *') and 'typeof (100U) *' (aka 'unsigned int *')) [-Wcompare-distinct-pointer-types] maxpower = min(CONFIG_USB_GADGET_VBUS_DRAW, 100U) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:67:19: note: expanded from macro 'min' #define min(x, y) __careful_cmp(x, y, <) ^~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp' __builtin_choose_expr(__safe_cmp(x, y), \ ^~~~~~~~~~~~~~~~ include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp' (__typecheck(x, y) && __no_side_effects(x, y)) ^~~~~~~~~~~~~~~~~ include/linux/minmax.h:20:28: note: expanded from macro '__typecheck' (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ >> drivers/usb/gadget/composite.c:2535:52: error: expected ';' after expression maxpower = min(CONFIG_USB_GADGET_VBUS_DRAW, 100U) ^ ; 7 warnings and 1 error generated. vim +2535 drivers/usb/gadget/composite.c 2504 2505 void composite_resume(struct usb_gadget *gadget) 2506 { 2507 struct usb_composite_dev *cdev = get_gadget_data(gadget); 2508 struct usb_function *f; 2509 unsigned maxpower; 2510 2511 /* REVISIT: should we have config level 2512 * suspend/resume callbacks? 2513 */ 2514 DBG(cdev, "resume\n"); 2515 if (cdev->driver->resume) 2516 cdev->driver->resume(cdev); 2517 if (cdev->config) { 2518 list_for_each_entry(f, &cdev->config->functions, list) { 2519 if (f->resume) 2520 f->resume(f); 2521 } 2522 2523 maxpower = cdev->config->MaxPower ? 2524 cdev->config->MaxPower : CONFIG_USB_GADGET_VBUS_DRAW; 2525 if (gadget->speed < USB_SPEED_SUPER) 2526 maxpower = min(maxpower, 500U); 2527 else 2528 maxpower = min(maxpower, 900U); 2529 2530 if (maxpower > USB_SELF_POWER_VBUS_MAX_DRAW) 2531 usb_gadget_clear_selfpowered(gadget); 2532 2533 usb_gadget_vbus_draw(gadget, maxpower); 2534 } else { > 2535 maxpower = min(CONFIG_USB_GADGET_VBUS_DRAW, 100U) 2536 usb_gadget_vbus_draw(gadget, maxpower); 2537 } 2538 2539 cdev->suspended = 0; 2540 } 2541
Hi Prashanth, Thank you for the patch! Yet something to improve: [auto build test ERROR on usb/usb-testing] [also build test ERROR on usb/usb-next usb/usb-linus linus/master v6.2 next-20230223] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Prashanth-K/usb-dwc3-gadget-Change-condition-for-processing-suspend-event/20230223-165955 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing patch link: https://lore.kernel.org/r/1677142665-8686-3-git-send-email-quic_prashk%40quicinc.com patch subject: [PATCH v2 2/2] usb: gadget: composite: Draw 100mA current if not configured config: x86_64-randconfig-a012 (https://download.01.org/0day-ci/archive/20230223/202302231957.9Vfsa8ln-lkp@intel.com/config) compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/19beaeb0554fc9c1556e8f7da85011f4267bd8fc git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Prashanth-K/usb-dwc3-gadget-Change-condition-for-processing-suspend-event/20230223-165955 git checkout 19beaeb0554fc9c1556e8f7da85011f4267bd8fc # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/usb/gadget/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> | Link: https://lore.kernel.org/oe-kbuild-all/202302231957.9Vfsa8ln-lkp@intel.com/ All error/warnings (new ones prefixed by >>): >> drivers/usb/gadget/composite.c:2535:14: warning: comparison of distinct pointer types ('typeof (2) *' (aka 'int *') and 'typeof (100U) *' (aka 'unsigned int *')) [-Wcompare-distinct-pointer-types] maxpower = min(CONFIG_USB_GADGET_VBUS_DRAW, 100U) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:67:19: note: expanded from macro 'min' #define min(x, y) __careful_cmp(x, y, <) ^~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:36:24: note: expanded from macro '__careful_cmp' __builtin_choose_expr(__safe_cmp(x, y), \ ^~~~~~~~~~~~~~~~ include/linux/minmax.h:26:4: note: expanded from macro '__safe_cmp' (__typecheck(x, y) && __no_side_effects(x, y)) ^~~~~~~~~~~~~~~~~ include/linux/minmax.h:20:28: note: expanded from macro '__typecheck' (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ >> drivers/usb/gadget/composite.c:2535:52: error: expected ';' after expression maxpower = min(CONFIG_USB_GADGET_VBUS_DRAW, 100U) ^ ; 1 warning and 1 error generated. vim +2535 drivers/usb/gadget/composite.c 2504 2505 void composite_resume(struct usb_gadget *gadget) 2506 { 2507 struct usb_composite_dev *cdev = get_gadget_data(gadget); 2508 struct usb_function *f; 2509 unsigned maxpower; 2510 2511 /* REVISIT: should we have config level 2512 * suspend/resume callbacks? 2513 */ 2514 DBG(cdev, "resume\n"); 2515 if (cdev->driver->resume) 2516 cdev->driver->resume(cdev); 2517 if (cdev->config) { 2518 list_for_each_entry(f, &cdev->config->functions, list) { 2519 if (f->resume) 2520 f->resume(f); 2521 } 2522 2523 maxpower = cdev->config->MaxPower ? 2524 cdev->config->MaxPower : CONFIG_USB_GADGET_VBUS_DRAW; 2525 if (gadget->speed < USB_SPEED_SUPER) 2526 maxpower = min(maxpower, 500U); 2527 else 2528 maxpower = min(maxpower, 900U); 2529 2530 if (maxpower > USB_SELF_POWER_VBUS_MAX_DRAW) 2531 usb_gadget_clear_selfpowered(gadget); 2532 2533 usb_gadget_vbus_draw(gadget, maxpower); 2534 } else { > 2535 maxpower = min(CONFIG_USB_GADGET_VBUS_DRAW, 100U) 2536 usb_gadget_vbus_draw(gadget, maxpower); 2537 } 2538 2539 cdev->suspended = 0; 2540 } 2541
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 403563c..23b7347a8 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -2449,6 +2449,9 @@ void composite_resume(struct usb_gadget *gadget) usb_gadget_clear_selfpowered(gadget); usb_gadget_vbus_draw(gadget, maxpower); + } else { + maxpower = min(CONFIG_USB_GADGET_VBUS_DRAW, 100U) + usb_gadget_vbus_draw(gadget, maxpower); } cdev->suspended = 0;