From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796149288; b=YR1LVVpsL5zj/hiDtya8ZuUf22le4r2AtIro/imN0ivN/443s13GWyGieYHeLEr57UAb yy+f6Rk0eKSMg6MaVI0M/LxbPUlVjNtP6ucfA2kHpbdh8YZmySkAzXnScSykCVJp2+vU9 tmTcaKCPv7BnofYROjjg9/CVhVdVssKNiXilNqz6Gf68wh0snc9df5XLGljXNNWN/KNa2 MLobJxZto+pFpC5w03xWmm6MrIftHv3WakAUqJU+Se3BgoR5r1uFvm1BisGLQuZD48HFy VFwwNr6cAiycoMbqWnvjvgo459GMX0drmfF4xDPtlRjkYr9neo/YVGpbeHg1n7QPFzA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796149288; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Message-ID: Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-Authority-Analysis:X-Proofpoint-GUID: X-Proofpoint-ORIG-GUID:X-Proofpoint-Spam-Info: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=48nWN32OF/2V19W9P0+zCra5DuCkp4LlzCQ0q29tIig=; b=T9m6wWXPKZUcb/xU+qTMShO/d7egLNyqprmE2Xj6k8WflqDbIFMXtS3hAD9OFbKKeVJ/ PZRJDHuEnP0T7/04A5GK10ieILQ0IMimozCa6uUB3AzbmlpQaYlO1AcEt+dRSU3vx8qQV 3HbhMGfp6fQrNLQ0k49GldIDXM4UkjNuClemBZsij9mpCBNDoGIGA3jb9trbrF1VjgdZx xSijU7j/QU0LJuDXaiyeczbfYLMZrpq3GiIQHTmn5R3pIdBEoVujlqPFeif0gPvXL5U8S sLeeo4d/GRYOmPDIKPyhN6y7JrTtKsG6VnzFq5zhgUV3VmW6+D6YfTpG7N7zvOfq02w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=XNP3wMSE; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=bFTDVj1S; arc=none smtp.remote-ip=205.220.180.131 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB38F606A325 for ; Tue, 1 Dec 2026 18:21:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AB38F606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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.a=rsa-sha256 header.s=qcppdkim1 header.b=XNP3wMSE; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=bFTDVj1S Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B1F6mOP1575197 for ; Tue, 1 Dec 2026 18:21:26 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= 48nWN32OF/2V19W9P0+zCra5DuCkp4LlzCQ0q29tIig=; b=XNP3wMSEtyJ89+8t 1GeWldOIkFbaDYpC52Ep41Wfh1b9WqEX6EW6wtOUlM1B9vViUczw/OU5SL53iZl5 LTXir/vO4tBP9FzjgOOKAPbp40BQft+91MANvXKF7ME/kXyAbV+7Uv2WdavNo2Kv 8Dqxx2CToxc7hAno1mUxK9VStmRHUepW9uXiPtplTbQTjTr6FLUypoxBX2EyvnWk 8RzbQf5SRLtG9AVAuMdlV40pdyQBD9UOuGNbofY3an9RSM1/eG3XtyKLtB5k/DAZ 0CXjxbrPq5Q+wV7g5ybQgX0Y9WnoEcmdWAHAnBQQlUb6Y1gwWZ5cx9e7yySHuY7A bMVXbA== 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 4j9sa230ek-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 01 Dec 2026 18:21:26 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-3b42ebf632cso9253302a91.2 for ; Tue, 01 Dec 2026 10:21:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796149285; x=1796754085; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=48nWN32OF/2V19W9P0+zCra5DuCkp4LlzCQ0q29tIig=; b=bFTDVj1SlMWND8YVmMpfHjvXaz6E5YjM7TCOKAJswttfNFZSAkfZyD/wKsa5Er2A5S Wx37R4+SWBttuVoEnkGbF4dTie1oEhaVVVfAv1jqrqF5jdesaEgNtKSTrRoKQGOCy4ac EFx9f6QXk95pb574AVh+MyMHNwapR3bXvWopXFOXFQigRpuYjET6aJEC+WHiGHKX7Kel VvCk9/Z+R0q7qwAP6qZdjD8BaUg1SBi4RVFQS8CU3/nSZvDQHC8izaI0SN7K3NwsT9An TTiVWm6AlGomLEdeFMu35cU07RSUkKeo0FuSh16ZQ05kLkdpiIqJC8CMLRR+4x/67m0O JZoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796149285; x=1796754085; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=48nWN32OF/2V19W9P0+zCra5DuCkp4LlzCQ0q29tIig=; b=TFImzpIdLnFfvbgyd2CAWDmcCxestWsGa+t25hlhqCOndp67RuJVUrd2NIrbT9P/Jy WKuXINtnKX4uy9tfzA9I8L2NzdTIgomx3nWAA1YvJv144DbxclPxBGwBO5ZPS+s8NDl+ iZiHswYpr/isPQJvMnpopXcriw1bOh5lCzgt+cnyvLalxdIYcXFMXGJyf5L9r5kiB2lh 3OcxB7i22Hx7uNtUnMDmWkdKzooxQSAPrm7UWIx3bcAflt1hh95zrAd+cm9w+PF6K8LJ VijXJahrEA6tVTpgoomyfEhNiCW5kl5moro5G6uFpYfIhfi3mCBM5F8a9Vy70QHtt7Zk ZZag== X-Forwarded-Encrypted: i=1; AL+hErFKM1EJBY+PI00Aj2e7cZy7orNxgaJCnNwKpWKNETYuA9/a9UIrWoJxa8yc8Xw/m3mnnosQXceugtTT8Aw=@vger.kernel.org X-Gm-Message-State: APuU4Z84rvXYh0m2noOTkbamK5eDoOXsGWWNdDgdV+vsIfZAkeJiA8uy 92k/upaCqQNIUp/mIj1TLDwcUU/y4fSGQlFmfUwGV5HO2wB4Cd/fuZ+ryS2yg0Brg5hOOhS/i2p D4VpYbWx/PCVInZSo3PQGpiyKGImb/IQFiHgPWfyY56W8x5VnNElhPwTF/bO7a+cYkMs= X-Gm-Gg: AZFdTZcawbGUwAwB5UPePHe6MsXr/OlT98qKpR+sjuETMeEHaS0hNaHK1WWveA4Jc0h dBttRTL81CDsDeacd0uoP5kBhIoFE6G56TlO9mqHRrx4WhIpmKoEK4y1J4cN6B311SyMwR4F+l7 XxhHgKWsdFUDjmQ4m27Jh952ARjhXN52ju0kuWCJLRvG3Z29f1B/rtuEl8IOa8ZuQlKE4a/z+9y 0ItKHII/oTF67rzs5TEqu4zs6aCU3001WvpDOxl9mJqjdfUPxdWsn3mhZ8FbUyuhxrbDqMrJcT/ hc0MGrFYXj8cxScI/+9BjVdllbywgTLby/Awm+iT5vEctnw37CVaW1FJQGWHdF/byFxIhiK/2Au r7ADZhrkznaF3/r6N6d0WBBikf8DLTqmDZvGPJRe1KLphBCpZuSur5diZqObrSOKkqVNqB8pkMA KkTqSzcnc51kRulEjf2idRXIvfuvaGEh2b9DwAYWc= X-Received: by 2002:a17:90b:17cd:b0:3ac:9599:a689 with SMTP id 98e67ed59e1d1-3b41c9d3111mr33182297a91.34.1796149285305; Tue, 01 Dec 2026 10:21:25 -0800 (PST) X-Received: by 2002:a17:90b:17cd:b0:3ac:9599:a689 with SMTP id 98e67ed59e1d1-3b41c9d3111mr33182272a91.34.1796149284794; Tue, 01 Dec 2026 10:21:24 -0800 (PST) Received: from [192.168.1.8] ([122.177.245.224]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b44b2156c2sm27003066a91.0.2026.12.01.10.21.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Dec 2026 10:21:24 -0800 (PST) Message-ID: Date: Tue, 1 Dec 2026 23:51:17 +0530 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC 2/2] usb: dwc3: qcom: Vote ICC DDR bandwidth based on connected device speed To: Val Packett Cc: Thinh Nguyen , Greg Kroah-Hartman , Pratham Pratap , Jack Pham , Wesley Cheng , Peter Chen , linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20261130-dynamic-icc-voting-v1-0-1a05a5320adc@oss.qualcomm.com> <20261130-dynamic-icc-voting-v1-2-1a05a5320adc@oss.qualcomm.com> <8ce228b8-b148-4454-866f-64099c34e9ac@packett.cool> Content-Language: en-US From: Krishna Kurapati In-Reply-To: <8ce228b8-b148-4454-866f-64099c34e9ac@packett.cool> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Authority-Analysis: v=2.4 cv=A8/5rKWG c=1 sm=1 tr=0 ts=6b0f1026 cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=+ByU4qXqoMMfN2DNRaUv8w==:17 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=0P3_T1nupSFQdCrnJ7kA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-GUID: 77pSlF-Wq47LdRxoqqym-sosxUeG4wcE X-Proofpoint-ORIG-GUID: 77pSlF-Wq47LdRxoqqym-sosxUeG4wcE X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAxMDA3MyBTYWx0ZWRfX+cgfEJnYHoWB bVzpUUFWeKX8irj58W1gnVgEItF8LnfKuL5QpOQCkrSi0vbop+hsnqh/TveNrFE4ZLUUc1dfPRZ p4ny6OdvvTRRI0U6rAZn3wg2XTFKqEU= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAxMDA3MyBTYWx0ZWRfX9tzc4XK5jDSX e8+l0i03Fh2QHCmMsIZCcuoN/dKCfMPMnhbWcsOu0UUxXbxSTQxG0kGzbC5KY3Ln0Lsf3xgAu67 gwrhrJuBrntrW1YwP41vzOJ1k6fXwOYktRHw3W5cePII0+yqbZsqyXPMMtq6knUK6mPvIlfEKyI eVZ7H3nyVcbNfeyayLxIfQQkCcEFgGINe+u9eLSacC43Qpoatdo2dpJZ/oNcVoq0Gs7tqILLW3t 3r7Z8cV7xWhXg0XbxKX3iNAv1rXxqwik9g270DPUFdxXhkHxsfQnmscp3G8rOc2LBgRwfXnu92Y esEHBlp6RQxxgU0m0o9WjCSEnh64JsBQbR0g832ZHG7uxWW4VYn5+1TM9bTPLmjVGTGA8KXZkF4 +4Z206HYaxWIuOxbhSqEf5SjA+b9btMI2k1AqrmIs4KqBHM4JPk4cfaXwyxOhd2VEP+7Yrc2LvN VMLahbJRJ3KWcDwXbHA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-01_03,2026-12-01_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 priorityscore=1501 bulkscore=0 spamscore=0 malwarescore=0 clxscore=1015 adultscore=0 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612010073 On 12/1/2026 11:28 PM, Val Packett wrote: > Hi, > > On 11/30/26 2:41 PM, Krishna Kurapati wrote: >> In host mode the actual transfer speed is not known at probe time. The >> DDR interconnect bandwidth has historically been voted at the maximum >> (SuperSpeed) value unconditionally, wasting power when only a >> Full/High-Speed device is attached. >> >> Add a USB notifier that fires on USB_DEVICE_ADD / USB_DEVICE_REMOVE for >> devices directly attached to the DWC3 root hub.  On addition, inspect >> all USB 3.x root-hub ports via xhci_portsc_readl(). If at least one >> SuperSpeed connection is active, vote SS bandwidth, otherwise vote HS >> bandwidth. On removal, drop the vote back to the idle/unknown level. >> >> [..] >> @@ -749,8 +828,12 @@ static int dwc3_qcom_probe(struct platform_device >> *pdev) >>               qcom->current_role = USB_ROLE_DEVICE; >>       } >> -    qcom->dwc.glue_ops = &dwc3_qcom_glue_ops; >> +    if (qcom->current_role == USB_ROLE_HOST) { >> +        qcom->host_nb.notifier_call = dwc3_qcom_host_notifier; >> +        usb_register_notify(&qcom->host_nb); >> +    } >> +    qcom->dwc.glue_ops = &dwc3_qcom_glue_ops; >>       qcom->dwc.dev = dev; >>       probe_data.dwc = &qcom->dwc; >>       probe_data.res = &res; >> [..] > > Seems like it might be registering with a NULL function ptr or something? > > CONFIG_DEBUG_NOTIFIERS's `!func_ptr_is_kernel_text(nb->notifier_call)` > check fires when busses are probed upon booting: > > > [   17.606811] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller > [   17.606825] ------------[ cut here ]------------ > [   17.606826] Invalid notifier called! > [   17.606833] WARNING: kernel/notifier.c:80 at > notifier_call_chain+0x80/0x1b0, CPU#0: kworker/0:0/10 > [   17.607029] CPU: 0 UID: 0 PID: 10 Comm: kworker/0:0 Tainted: G     W >          7.4.0-rc5-next-20261130-uwu+ #250 PREEMPT(full) > [   17.607034] Tainted: [W]=WARN > [   17.607035] Hardware name: Dell Inc. Latitude 7455/0FK7MX, BIOS > 2.13.0 09/19/2025 > [   17.607037] Workqueue: events_freezable __dwc3_set_mode > [   17.607045] pstate: 61400009 (nZCv daif +PAN -UAO -TCO +DIT -SSBS > BTYPE=--) > [   17.607091] Call trace: > [   17.607093]  notifier_call_chain+0x80/0x1b0 (P) > [   17.607097]  blocking_notifier_call_chain+0x4c/0x80 > [   17.607100]  usb_notify_add_bus+0x28/0x40 > [   17.607105]  usb_register_bus+0x88/0xb8 > [   17.607111]  usb_add_hcd+0x144/0x4b0 > [   17.607115]  xhci_plat_probe+0x4f4/0x6f0 > I did hit a NULL ptr deref when I was testing this but i fixed it before sending. I did test this on standalone (dr_mode==host) and (dr_mode==otg). Will try to repro this particular crash and fix it before sending next version. Thanks for reporting this. Regards, Krishna,