From nobody Fri Dec 19 17:30:36 2025 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 A976526FA7E for ; Mon, 19 May 2025 09:42:37 +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=1747647759; cv=none; b=jBeiaZEBRNBamLaVQ008rE1aIXIIo+oHC/zlZ5DBJr95oTjDl/jrLxjWugB+SZE2s8jzfP33QlhW0w21m54gLoZSGgFAXeI4F7rilOaG+OMjhKj3dIweDRjgEHdWts/0hZ8UaZP7CDqMnOTCcRz5f8pNczi/aYLtZWwrr8Mu43Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747647759; c=relaxed/simple; bh=uFH7gvcXfq8PXUbSnW4zFmBHt5LxnpwhDzcE1X+yWFo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=q6YFoOHVWUh+1r/JjXmKVrLHy54G/1EN+jMoL7Pqc43x0xQFqwp4p1zYtNUrdk3h0MUR6SOSh2BvXsDDFBSdpqUBgYvSAPPULsAcma28o0dn5SwL50ko1m/AHB5xKVF+Pbi+LnNqrZRkeSs3kG3E/11FSzsXfK3i/amOJJjTaug= 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=JsMyobqf; 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="JsMyobqf" 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 54J8fhhv003169 for ; Mon, 19 May 2025 09:42:37 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= uU7PofubsUvHU2URxMpgS+EVNoeW1gK8KIbpSjZ8wvs=; b=JsMyobqftJleRTbj B11FC/2JAVgMNtjie8qW+mRAiSMr00ZwBIKJaCtY3K7PJC1hvmlA+odTItz9mkCP GIU5Beb95mBvQF1MoNpLuAZAKckt3FHFHBhceDgDSiLuQSndTkJrh3vfHvxrVIyp 5Y+5+bEuE1WQC5majbNemPAgNASOi3DER8bcp3B5C0fCH4hSP1TxY/fEQJYUKzPF uXoHW6oUhwk4bFr8uqL/aKBxxmsApl1JfFXI1U6EDfPjcYkiq/nG3RWA99sCIJtj ZtvMxwTMCxFSyfvqeexb0VY2onCr+1/JBfnbs5Tb36ISaKeTEGQGtL6FR/1P+pCX 4KULVQ== Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46pkr9uun1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 19 May 2025 09:42:36 +0000 (GMT) Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-742c9c92bb1so858487b3a.3 for ; Mon, 19 May 2025 02:42:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747647756; x=1748252556; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uU7PofubsUvHU2URxMpgS+EVNoeW1gK8KIbpSjZ8wvs=; b=BqUfW3beIyw0T9BgyaVk2U05BAahvVo//GB5ptN9L/0yZ820ZixmM/5W6WRvn/pF6y OyrgV+vbxlAuoMbVVrDY5uBD/16k8QTvogrnt8CjLeVIKWNFlq9IK40lTkki3ZuWIojH pPWROyFViyKgCvhT222Dy/BnIYVFHFfEVyj7+WmDkbj6r/6Ev1h9KnmAo+EVq3HWHzVr xe1yKYoNwQ0xuqYk2ZYkbkVAIPLXhALoczXWCStOHNQQ2RJ/Nn9RUmc44OylnNNEIcko SVSoJ9lL3sCzPeM2mplGX9205GCkGP7Vw/skumnh4PsjMhkxN2CsG+8/uZmy+7u/6Q22 9gPQ== X-Forwarded-Encrypted: i=1; AJvYcCXB6oazBist7XwO0gacKKJUbG2zaYPZS1gOWeqjzQLGgq51YgScfIEX2ZgrCfq6sf7BTL6ZgWZ8uOh6dPM=@vger.kernel.org X-Gm-Message-State: AOJu0YyKX4MXjnlC9LTT7wuNSmpmRP7mIt7HdMtujm46Kwlup0PNEiuZ fZfB6aBMIptgye+UNNUFO5UMWja1ucSmVSj2vLuU2U8OzkSdt0VlpYPVOTeJsVdV1TfJqH+eHNr 2cHwMI9yf+LKAfq6jatjcGi2fAMFbOAhIxnhpJ6ld+gIeiidtXgU5eZvFeeBkTUjSBI4= X-Gm-Gg: ASbGnctUBwN9zdtfe3LfK4mKVl/SlRAZYnJvZ6xNkbnlKBGPjeTEQnUQMN+y4vS9WtF k20mXntFfGKIRsyBXfl6JmnCmigfxhIfVLkoTlZzITwiVHF4GXd3QL1TrE65yuTupUmYqdyUihJ DrHEs4ZJ90kMmwm7N87q9Zx4F1zslVMZeVRAlHwlnAwhW/Kpmr/BDbzUu7LjePfwIhYDNnutPco XmE3zq8hh1tDlOfENw+Pw+l6j71gWY9XauDW0eTaZKTEDoHmMmRlPlQTc0x0mvJJMb5pwyDm9W5 C0i3pVq5aVoxZ76bb1DSMwgChn3oj+PdZ+wVbhoh+C/lWhk= X-Received: by 2002:a05:6a00:ae1c:b0:742:b3a6:db10 with SMTP id d2e1a72fcca58-742b3a6dc2bmr11994278b3a.18.1747647755745; Mon, 19 May 2025 02:42:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE99iUQ+YVc/maiKCsxdLZP8n8nikcwdzK+f/VpTPSVQgsMwchfjJqT1QzUS2xVouHmoYvWTQ== X-Received: by 2002:a05:6a00:ae1c:b0:742:b3a6:db10 with SMTP id d2e1a72fcca58-742b3a6dc2bmr11994251b3a.18.1747647755364; Mon, 19 May 2025 02:42:35 -0700 (PDT) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-742a97398f8sm5809092b3a.78.2025.05.19.02.42.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 May 2025 02:42:35 -0700 (PDT) From: Krishna Chaitanya Chundru Date: Mon, 19 May 2025 15:12:14 +0530 Subject: [PATCH v3 01/11] PCI: Update current bus speed as part of pci_pwrctrl_notify() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250519-mhi_bw_up-v3-1-3acd4a17bbb5@oss.qualcomm.com> References: <20250519-mhi_bw_up-v3-0-3acd4a17bbb5@oss.qualcomm.com> In-Reply-To: <20250519-mhi_bw_up-v3-0-3acd4a17bbb5@oss.qualcomm.com> To: Bjorn Helgaas , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Johannes Berg , Jeff Johnson , Bartosz Golaszewski Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, mhi@lists.linux.dev, linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, qiang.yu@oss.qualcomm.com, quic_vbadigan@quicinc.com, quic_vpernami@quicinc.com, quic_mrana@quicinc.com, Krishna Chaitanya Chundru , Jeff Johnson X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1747647743; l=1353; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=uFH7gvcXfq8PXUbSnW4zFmBHt5LxnpwhDzcE1X+yWFo=; b=lXyiRKWe2dUM/NoKi98YA2ST4iD+GyJH/JWFyhdLHqiaIoNSFdOEcmMxv7oVHUvW2lVe0h7ZL UYVeLSPwgrlBOdS2f0m/xziM1YsPsEV3QKXX1cYho1bhDVgeJ3/rrYA X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Proofpoint-GUID: NEjYbnRUvtmOXEtvzMb73vXw4IuVrOWE X-Proofpoint-ORIG-GUID: NEjYbnRUvtmOXEtvzMb73vXw4IuVrOWE X-Authority-Analysis: v=2.4 cv=DdAXqutW c=1 sm=1 tr=0 ts=682afd0c cx=c_pps a=WW5sKcV1LcKqjgzy2JUPuA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=dt9VzEwgFbYA:10 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=3phiJa3m8EW-4BHYHVwA:9 a=QEXdDO2ut3YA:10 a=OpyuDcXvxspvyRM73sMx:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTE5MDA5MSBTYWx0ZWRfX89uTI7uAwsc4 pncC4UGMlUwtPte8YDD6LXuW7kKMu2LIu0by8qzXs7LoGxquoEoEHnRe4DLv2AlUS++WFqB30jO 2QZREwlyeDdyw0lPWSWCcnHEwV1XMNo6cYyNfjZUQxMdA6u6ynZU010BcwX622UVHm2L5PpQiqn jjHb6gIq4dGI7x1uw4oX8RbTeclF783hsIFcklqCFZa3Yq3p4FW5QJNjukVIROdGswWqJ73PiUO lV8rhMNmBAnYskCMOh36r2jY+A4i+qIMUwrWJs8wvBkZNwO0mwuTf2TstPXoZpCtCmFfP1+2Sre zFDzK0++zGlWfk5nP/LRLxIZsQPQy+ShTKvLHDK6jJgsJTX1E65vlUkuighnunTL6TuimOwp/J7 y6Rjs0UiMMMrGImrD0iu5llBbNtPmnjeH9ywAPFC7GIsQ6KnFcb/TUn1xTatTx3orS2VBO05 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-19_04,2025-05-16_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 clxscore=1015 phishscore=0 adultscore=0 mlxscore=0 spamscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 bulkscore=0 impostorscore=0 lowpriorityscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505070000 definitions=main-2505190091 If the link is not up till the pwrctl drivers enable power to endpoints then cur_bus_speed will not be updated with correct speed. As part of rescan, pci_pwrctrl_notify() will be called when new devices are added and as part of it update the link bus speed. Suggested-by: Manivannan Sadhasivam Signed-off-by: Krishna Chaitanya Chundru --- drivers/pci/pwrctrl/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/pci/pwrctrl/core.c b/drivers/pci/pwrctrl/core.c index 9cc7e2b7f2b5608ee67c838b6500b2ae4a07ad52..034f0a5d7868fe956e3fc6a9b7e= d485bb69caa04 100644 --- a/drivers/pci/pwrctrl/core.c +++ b/drivers/pci/pwrctrl/core.c @@ -10,16 +10,21 @@ #include #include #include +#include "../pci.h" =20 static int pci_pwrctrl_notify(struct notifier_block *nb, unsigned long act= ion, void *data) { struct pci_pwrctrl *pwrctrl =3D container_of(nb, struct pci_pwrctrl, nb); struct device *dev =3D data; + struct pci_bus *bus =3D to_pci_dev(dev)->bus; =20 if (dev_fwnode(dev) !=3D dev_fwnode(pwrctrl->dev)) return NOTIFY_DONE; =20 + if (bus->self) + pcie_update_link_speed((struct pci_bus *)bus); + switch (action) { case BUS_NOTIFY_ADD_DEVICE: /* --=20 2.34.1