From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 54FAE15C0 for ; Tue, 21 Jan 2025 04:20:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737433217; cv=none; b=FAGsJLeq0L0c7dNznjD+aGxIzPuWnQGVxdYUh/vpfKqWi5hfOJdnV1UP3Gz2tbi6wqvIbIlkNWzXKcFGvxWN+Ww1nxzC9d02Ki/cWNVM6VkB3I3lGT2DEofPzk2uJ5I5zN1zcAx6xnmuxSRpZ4klctZK+EpZ69GKEq229IbjZ5U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737433217; c=relaxed/simple; bh=WtNseL/4ux+w4KqLgQWzWM6xsYjXs4B9v86pjNSLAVE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=OJ0rw3wV+FXfJTXUGhYEIlmtJ2ojdzUY+pC7n+FhmTAeZ7O5fkLFLibRdKMnub3WRcTXRrASsSq0XHuA2wj7sWoostmBUWxMmq4hRVilwEe9NLwoGSI8FlmbKqehD2NuDvZ0KcFdLG0clgqOwpS/dkQYiJpva2qPhPsGs2kGFjE= 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=dbIGMZ+j; arc=none smtp.client-ip=205.220.168.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="dbIGMZ+j" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50L2JZKu017911 for ; Tue, 21 Jan 2025 04:20:14 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= EnJ8550TGSZJxXunYDeoj9cQwxmwwmeTmd5HHzXnzus=; b=dbIGMZ+jaKY3f+g4 AjVoo6YSMwEWMsuMzmk1cRlHv+1CUER+OdiOJuhD+qdP/SYRYh+Wm/IMK6sK/0+A MJM3mcZNjQKUecYZhSd/tWVxkkrB9bXJDyVQt6mZ3baJRE89qPvsqRvyV9PB6TNW gqpTy61zuI47QpPe6ISkifJaZQO3exXJQhW8YdMWKH3jkiIABddyv3E0zReEujBH 6L/6vuuLPUy57RHJpSNaN73+YjxsnAjOaglr+92lm5Ye9JhqshDCDtnGGJ6h07GG 3xoM+Fs1Ws/KTKw/wL1ARfDStvf0f2ifL+8hG6NGaR92hdyPyIt2D8nug2uRFFr4 0u4sWg== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 44a2pug7ca-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 21 Jan 2025 04:20:14 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-2ef909597d9so14548266a91.3 for ; Mon, 20 Jan 2025 20:20:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737433213; x=1738038013; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EnJ8550TGSZJxXunYDeoj9cQwxmwwmeTmd5HHzXnzus=; b=gc+Ab+pOEaw2E2hpzHa35IdQRLjoHZ9kpaxojkt3VTjm+F+WH5EEZHNNCB3KsIcouW FdSru1Wsr3Y5f4XtOEr6/Bm80Vw1qE2Lm00rlZqbukicl6/9K8Gki/R+sP3Mj86gzeum y591Zwd5Lf821Bk9CihizKcwkoUAp+8eN8MDgOa2lXrFUufW0WYrTSy98eOiOkpug27/ 361Ev6fWHTWswzIJmG9MyFvwQESXgukPgQ1viUieYz0qNw0YKf3iHam9wwMWnPO4JEhg xW4/FGsl6SKVqVUU35TMYrdsbUilFcMEgV8uaKR5ZNOhgz0DsOQOwAQgN9az5N2kksmB 9w/A== X-Forwarded-Encrypted: i=1; AJvYcCWRkwAXnXaTFSnIeFoGZwssZwzV0skXZ41EoMSPdGNVTaQGkdbzIYQybbM/1/cHMBPbnbhZM7KnpuYJxbw=@vger.kernel.org X-Gm-Message-State: AOJu0YwwhPJiW+gmo3iSZlEIe5TfupEAGZ33HryPe6dfyvweBR4A818c O1mk5zYv0CZ1eTV0/9vAnntj+9432e8kCQ/v7lCDtjxya8HsiR+DX1irXQYGZlHJJMbe0oxVuV4 kRlzTzQG3jaO6rk79yIEH1Pr0Vuqt2VbiqHTd5thZZc9x1zVYvZsaFxWX9qurolg= X-Gm-Gg: ASbGnctPeRSA/YTeK8Cd++hkuyUuptXJAlMqjigXXVfIunmUyV1LkkpCAEfBXKvu7KR PHEt6BH337zbJOOIjFCE4vZtzY4rRMk8g1qGmlSI+rBi/KzA07hXWpC7sBRduDjyhSsnfTQey7W Ssp4hrhdTTAn7dZCbOU4VUaIZR1rPQF+wxAOIataT+ezgrr41lB2GYoFf7CHKdnkyyE9KTtgVoT 2Yb22ecfbe/4KlnvKXYaO8Bpg/za9qSSBV3H4aQGQnfVweWEWSXaYdh7YWHn2E0nFesUrJoR73u nZFOP5YgMxLVhgOb6rs= X-Received: by 2002:a17:90b:2e4b:b0:2ea:9ccb:d1f4 with SMTP id 98e67ed59e1d1-2f782afebd6mr28121773a91.0.1737433213468; Mon, 20 Jan 2025 20:20:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IHzuu+UMw6dxadVPS9Dl69yNaWc5EQ1KUib72aIqfm+b75fFvwCWDZZxholjsCWJKBU8jL8mw== X-Received: by 2002:a17:90b:2e4b:b0:2ea:9ccb:d1f4 with SMTP id 98e67ed59e1d1-2f782afebd6mr28121744a91.0.1737433213103; Mon, 20 Jan 2025 20:20:13 -0800 (PST) Received: from [10.218.35.239] ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f72c2bb2cdsm11901421a91.34.2025.01.20.20.20.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Jan 2025 20:20:12 -0800 (PST) Message-ID: <1b1587e8-5c38-4138-a27a-1de71ff07ce3@oss.qualcomm.com> Date: Tue, 21 Jan 2025 09:50:08 +0530 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: gadget: Increase the limit of USB_GADGET_VBUS_DRAW to 900mA To: Alan Stern Cc: Greg Kroah-Hartman , Simona Vetter , Takashi Iwai , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20250120111702.3738161-1-prashanth.k@oss.qualcomm.com> <894f42a7-50a5-401e-a705-a06eafd6161d@rowland.harvard.edu> Content-Language: en-US From: Prashanth K In-Reply-To: <894f42a7-50a5-401e-a705-a06eafd6161d@rowland.harvard.edu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: 7faRMYcpWtwjf4aTMidvWJybbA5Vzt9I X-Proofpoint-GUID: 7faRMYcpWtwjf4aTMidvWJybbA5Vzt9I X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-21_02,2025-01-20_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=601 clxscore=1015 lowpriorityscore=1 malwarescore=0 phishscore=0 impostorscore=0 priorityscore=1501 suspectscore=0 adultscore=0 spamscore=0 mlxscore=0 bulkscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2501210033 On 20-01-25 08:17 pm, Alan Stern wrote: > On Mon, Jan 20, 2025 at 04:47:02PM +0530, Prashanth K wrote: >> Currently CONFIG_USB_GADGET_VBUS_DRAW limits the maximum current >> drawn from Vbus to be up to 500mA. However USB gadget operating >> in SuperSpeed or higher can draw up to 900mA. Also, MaxPower in >> ConfigFS takes its default value from this config. Hence increase >> the allowed range of CONFIG_USB_GADGET_VBUS_DRAW to 900mA. > > Is this the sort of thing that really needs to be a Kconfig option? Why > not make the decision at runtime, based on the needs of the gadget or > function drivers and the connection speed? > > Alan Stern > Right, set_config() in composite.c does this in runtime based on the values of MaxPower (from configFS), VBUS_DRAW defconfig and speed. If we don't set MaxPower from configFS, this config helps to set it during compile time. In fact MaxPower in configFS takes its default value from CONFIG_USB_GADGET_VBUS_DRAW . Sent this patch because Kconfig has this limitation where it's only allowing values upto 500mA. Regards, Prashanth K