From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.168.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796179436; b=rpv5xC8IOTcdF6gC3FiqyyCozJWoKJ763XGRJ0A+l97zRF/suK56dSeu4zWb6yMQz8tr 8F1G1BmIuzxOZMJfemQz8BAP+6N5suCyaqQkqb7HRrXXnFP+OWNHmTFXTupOzYRaKuEBX fHHPUh83tRouUf/WnhqVgfi953xW3Z5OVP0onpj3R2EOglw1xaLsEye0Hjg/B6QeKy6nO 6bx3o2y6v17TCCfJ5ZLmA4kxTvKy3tqjX5PPl7SpoSC/fVOA5kjPJZ2y2lWEQ3/7GzESj WiJN8sPf0ulXogpE02qheQ9Mb0DaT+i+jo2GtCaiKzJxaTwjW1WBqwN93tI170eahSQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796179436; 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:Date:From: To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:Content-Transfer-Encoding:In-Reply-To: X-Proofpoint-Spam-Info:X-Authority-Analysis:X-Proofpoint-GUID: X-Proofpoint-ORIG-GUID:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; bh=tKyk7IEtQyNrk7AIm29TXshGbJjnqG5Dga1/MnODXQU=; b=sjVk+Z/aC9ouYDDvZtMonUq2qd3bG4Jzpw1tfvBIxh69mexm5udSK1HKt2xj5wFCgfXv 5Cy7gaMRhiBScs19c2OiYbHj2YfgMu/vUazkRqHZIdbM+jMNfZ7DeUmOHruhr1/hSvNd4 YUc0fh/PxSVmshkGqpf0QanSI4gLT/P0IKEmvbgg/wT9DNEnRNTaxhFzVf6IlG39D4URP 7DVkl71DtpR6b45py1RAdCS68USSlHKDAaffEGl6NVg4+cbqo+yf4P+/WfvWkHm7Ts4LH nXZqqlG7nFRcyF+YUOoI8aSNVIMiB27K1uALfDO0yFwA3LPBEYzh2bWjv7WQW7V9f9Q== 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=DuWCMp53; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=LoD1+f8q; arc=none smtp.remote-ip=205.220.168.131 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 70A2E606A322 for ; Wed, 2 Dec 2026 02:43:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 70A2E606A322 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=DuWCMp53; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=LoD1+f8q Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B1NUx5G3481905 for ; Wed, 2 Dec 2026 02:43:54 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= tKyk7IEtQyNrk7AIm29TXshGbJjnqG5Dga1/MnODXQU=; b=DuWCMp53BLRPBqA6 QoUioT1ALTwFkjxrC75Z7Rr+dTAW/bYX2+jWcEPsK/ac/uTY6uG6o+b+ywP5KrJr Pjh0FlLIpAFHn7HuK3MWQC1cUQylqQjp6KnY0hw4p/MqqJhUi2rlcUeoDU2p3076 fh6uHOT/P2lRbnkdixv+rYPcunA7HdWo9G7cnqBlmONeO2JKNKCTUBuumuOn//E+ IMK7U8IHkYZTRFZOZk9uO7faqb3lTbxdPJshYIL+uRSmlIp2jGyRqzIgLsGoMHbt SVVyRqzRp7+eFLzFoznBSZKBJDe6uMwn+SCBBZb+hbr+T0z2+ebsd8t9IvLtG39d Z9KYpA== Received: from mail-dl1-f71.google.com (mail-dl1-f71.google.com [74.125.82.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ja3ax1qn1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 02 Dec 2026 02:43:54 +0000 (GMT) Received: by mail-dl1-f71.google.com with SMTP id a92af1059eb24-1383723dfddso521055c88.0 for ; Tue, 01 Dec 2026 18:43:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796179434; x=1796784234; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=tKyk7IEtQyNrk7AIm29TXshGbJjnqG5Dga1/MnODXQU=; b=LoD1+f8ql0DI2A1mduQDcTe1+jP4klcuHzV9wy41UJTn7E3Xp2iHQmEipTxSH5FC00 NUKCSHHjVr4BNPO0EjgcWoyRaAV6p9G08kePDpz2jX+Yag0prR+9oW4yODHArKEyqdPw VcjT/6BMfBiPzASEYltm1vVibICJgz57ss839YtCuz6iKSw6pnTbgr5OnnE60O4bza6E 7aRzziPqrByAXRPvTNYg5I0V/hAKheFjH1d7w4wQW+Non8nDBHg6hwThmqsnjXFG3RUY LwUbPEAKuhV4RNA/7R+9AZl5zbNv/0J4k+1qirZQOnR+erui43WiCU1owDYmZkjGEnWZ SyFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796179434; x=1796784234; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=tKyk7IEtQyNrk7AIm29TXshGbJjnqG5Dga1/MnODXQU=; b=JKS2C8k1X0YN0V4tyx9kF156mVjqKkcR2IcmbhuOfcSJwHGOdbCGw67nLRL1OBwQFA 6LhJ8QClNhbFRUXJ5C4i66cIrbcHUFP1k+44UkjUPkaL/m+fBOBX/hpwyB/C1t7BLi5l 41kUPXsEMPl8qgVY059fCL9l7IBpk5rY+DbUAMcVgWRxhem+pGQc3YhYpDnID9ikamxu 55tcErKvbNTcoKm95rcQxqxiyIrz4zrYfJgOgR9LxLZsbULKK/q38mbZzApQyq1h2/d2 KAb3X/ApiSDrZm4N/8RkkB5SheWEgho88Mr7zCN8Vri+wuKDMS3r4w1qYoCIv583a66c K/sA== X-Forwarded-Encrypted: i=1; AL+hErEcmxl8YgZlqAzl5FjLPJ7mB3dc5hwr0CwB3zEnhrZtrF0FJCIy+C/hXIfFHJuc8iO311qtfEJBb+OK9fw=@vger.kernel.org X-Gm-Message-State: APuU4Z8mfvMvJEAAKiDJnjmsXbRmzi1S8f4i83cok2wng47v6ap6TC83 QVq0KHoCISwNhqurYzQiPivu8+DSIngLtwLi/TErMXsDac/tcmR9Isvf/8t1uY4Ul8YBjrKNr7R u0WUuhc8hIt2n9AP0LuFVQ2sOiGjD+wy7G/iV8SrlmwiM9NuTwHdzIQ770ogTV5LBJBA= X-Gm-Gg: AZFdTZeskhazuO8er7Q7oTnHIF9Sx03y66a55jsYWqduwOMBiUnjaw7CCMc4kbccL9p MljscsP0kNBgSlctoZZhZUezXoh9KUGahghFnfJgAltgT5liAjaV4rBCH3+bqI1U5bMrmM8fmvU rOP9CUTQIDpORY2MhSDLi0ueD9LiK3B1kl0Se5YIL/gL/BlX1NfYM+2rXVdfgO5Eafa37zwJFbJ kZTSP6Ds2sn5MF4onCxXpO7DxwP/Z2k26uge5ZOq2Q8ogZl+SPdCc2hMM7HNiQSJMWkwMnmnTwD hXQmfvTHLtR3SvOQItROd2l8hB6l8n0ihu0BwMIsQ4JQWQH4oC/FdEW1v3xEm8rexA+dRcenH/w VKrdtIv1/N7eZCHTtkSQNrUFMl+KKop1xkYZBcJeAMRF8QkPk4hrtnKi0wJ9e301fyltIJLM10w K6TxLaxpxZMxavcorCm6KY X-Received: by 2002:a05:7023:a47:10b0:1b5:c3a2:fe2 with SMTP id a92af1059eb24-1b5c3a211b2mr1882661c88.17.1796179433900; Tue, 01 Dec 2026 18:43:53 -0800 (PST) X-Received: by 2002:a05:7023:a47:10b0:1b5:c3a2:fe2 with SMTP id a92af1059eb24-1b5c3a211b2mr1882635c88.17.1796179433344; Tue, 01 Dec 2026 18:43:53 -0800 (PST) Received: from hu-petche-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b55682d301sm91573305c88.10.2026.12.01.18.43.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 18:43:52 -0800 (PST) Date: Tue, 1 Dec 2026 18:43:51 -0800 From: Peter Chen To: Krishna Kurapati Cc: Val Packett , Thinh Nguyen , Greg Kroah-Hartman , Pratham Pratap , Jack Pham , Wesley Cheng , linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC 2/2] usb: dwc3: qcom: Vote ICC DDR bandwidth based on connected device speed Message-ID: 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> 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 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDAxMCBTYWx0ZWRfX2zSEZKw4RTMQ XO2brbEQfo+3zzTE17JyOJRBuDtpb6B3fxwnv19A/DLTJ1gGspTd8pOsjU4/xIMLehVR5InoG41 +EPrLzeIWUJ1D1Kn7U5Tv4RtTlaDKvU= X-Authority-Analysis: v=2.4 cv=J5s/fwnS c=1 sm=1 tr=0 ts=6b0f85ea cx=c_pps a=JYo30EpNSr/tUYqK9jHPoA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=8nJEP1OIZ-IA:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=KCRZXUQsBYKcnWTNLfwA:9 a=3ZKOabzyN94A:10 a=wPNLvfGTeEIA:10 a=Fk4IpSoW4aLDllm1B1p-:22 X-Proofpoint-GUID: 84Dhdrlyc4cH54WFd1XEY_XcRgj2fSlZ X-Proofpoint-ORIG-GUID: 84Dhdrlyc4cH54WFd1XEY_XcRgj2fSlZ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDAxMCBTYWx0ZWRfX/CT3nS8qfN5L RL/9WW7kETFbCB/mm8O3n+6t5S6dBw80ckyVO7C4+0FaL0qyxSWCc3ePgSYawHe8fhmNWeX8yRo 8s5jhHZwHYCzDfg7q+lDNAuMmHMUJsRfeSrm62h36lEzplOYCKLQlqHr5Os9y4u0YezNIhu6d/j s5+JincBCRxztnUNrLZnq+ARoYERsr24XydOsMMde+/0IaeN+vZNh15tAfxNSYL4NsXSRqTzhzl sQok7C0VCQoxU8yiAk2vgY+I4f2L33fp0NT5y69nHTWLDEvOm3R3ZqXkczqC6+E/TYNDN7vMjAC 6d3GdVePZKv/YKhLB+iGWsxcfTAaLyxllXPspWZxX2l7wHBeHmBl8E8Ivuxf9bF04Nn3Ibh79Z2 4tfCOAqLR0kvrnlcCnqlAlywOxO/nN75LBhh8SyYbmzS/MiXoXgh0dtwLgaqFDS/NFJ3Pj4HPZJ OO90+pRxIP9cJjO7SXw== 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_05,2026-12-01_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 spamscore=0 clxscore=1015 bulkscore=0 malwarescore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612020010 On 26-12-01 23:51:17, Krishna Kurapati wrote: > > > 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. > It probably dues to Bot's comment: - [High] usb: dwc3: qcom: use-after-free of host_nb on dwc3_qcom_probe() error paths If the 1st time Qcom USB probe fails, it leaves a stale entry for block notifier chain, and when the 2nd time Qcom USB probe executes, it will visit that stale entry. -- Thanks, Peter Chen