From nobody Mon Sep 28 09:59:13 2026 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 7D7893B14C9 for ; Mon, 24 Aug 2026 05:35: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=1787549717; cv=none; b=OOLrbRS25t5Oz58g/XpyD4XZECxCR9kA9wTFkbVsb7svdVqL8RfkEhBB1/TnCqLd6r+3F5JZzhUtAn34EfnOcsoTJSF4/+lRWHLA2s1PyOyfSPGlZaGfCDub8uKwMY5eGMBJbdSP7ojC9cvKad2fq8QyHnqnJ0y4p7wQ8nzL+q8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787549717; c=relaxed/simple; bh=i18DXA1UuvFFxlInAjMEmK2CjnCD979tKCem1E4xy6c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=s7pT4hGS5fAgNvQEEqwHPQ/uMRb9pwROnm4AUR2032XckrNHPA2CXSzvXd+UxuBpFTxE8dDpGjJ3OkGaBlky1VpSVS4wzXgltGWyByfbzBM7bygy0Uz8F/ZQsRMCUK+xph0H81M4zD8BRjsGZh1/eHYriog+raADca4VX708e5Y= 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=DmIdoIZv; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ZT867f8+; 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="DmIdoIZv"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ZT867f8+" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67O5RCIx1477849 for ; Mon, 24 Aug 2026 05:35:12 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= tsfm3B2VKYEmQm7+WBrIBL7ccJpws7BXCiuSJtGpd8g=; b=DmIdoIZvetS5t4QR P9MduT6G7urPR0JuhgcuxNIUuzrRRr8RGhpkqqWMz409U+4T/47HHL4HLhDUy0pC 3zk26oXRYFrPcFKJljSkx/OS8+6x/7vtL1XlkrrPe9s5RbuVbkzcTYSjB63KHVeY diF7uHyku+pSjwxVSb0xgbkivysCrdlejaV5jFxfsxUfwRVT/IuiTfz+mostGBKP pYg/ww+GEgTeYoMxJuFYyiZ4zzP9dBpkVVKCK0uCm71o7mQHSvFvOF7EMlcDEqEw xkWU6gQhpPFwtI3ZzToqfbwMnguzN0091S4uYpGl84cwAKI6oicJzKp73u8DRNTn gDySqg== 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 4g7528n9dc-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 24 Aug 2026 05:35:12 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-38f5ac7354dso4401022a91.1 for ; Sun, 23 Aug 2026 22:35:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1787549712; x=1788154512; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=tsfm3B2VKYEmQm7+WBrIBL7ccJpws7BXCiuSJtGpd8g=; b=ZT867f8+skwwLb6AtWZFGdOsAgBctSnDJjoqlzQFN24+HkIuNErFV2PUTii8yyniJr jz5lHPV8znMnzVXWmcOtmz/BwjHduw0RHPh0I25nHXWwYGegGaO9nMr5Ii862R2WrjC3 Qw9uKv9o6SA/DL0cBrvfIQar9btvEEwhoVhjci68GxPUxvicm8VaFGvsQJs15gbn89Sv 7xhe20+Eaw+7qPmXv3fhyrgOslXH06nKjrlG8hoOEKRAixpNuNfIfpK8BdlJa1vddjN3 2RtrPUIfg3oaBVWFdyplGbztq2gghUqrtHXsIVUERTNG80mqoFoiGnnTyp4vBd/QbXQX TS6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787549712; x=1788154512; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=tsfm3B2VKYEmQm7+WBrIBL7ccJpws7BXCiuSJtGpd8g=; b=kyub1L72uT3LZlsNsfphTiCjw+XQnPJc1doLNu8idVBWSxezPnWEtXOlpQfEtoDNrZ H3qdAdgQU2CmIzDaS1dKkJ5ZyXVGXW4V2vYd6EcwLmyVHnYs4YVuSZqwK3/PY/aO93dd 1Cjcj8dZCuNKnSwW/bU0P2ppJlymQAmP3p4NL5LXXI5CNUT04BTROMGiAErM6Dtg8Kyz XBCIj7pgUBwQoXQXZBjU0nZT2Hq2HY0phusHFyHvQ5RimEV7mqeOvIJU90bY6Xi9q/sa G6z5J4hLLi6noneEZx/wT+1HxwE23yi2/7wHR6kiJY20iMci/YGXNfRtA16H5noTMh0q lhcw== X-Forwarded-Encrypted: i=1; AHgh+RoN7Ll+4UMYQQEexpFPv32aAJS8DGsl42yb+5/PbsroBEwZA88crVYOJlzYwJ+sZxxC96MObb6TGruB/ak=@vger.kernel.org X-Gm-Message-State: AFuF++nfVtU6BaVbgcHhzivvMemFSRsYgIMXTSkwsYkdluPjORiuUjzm Squ1jnL6dI4z8vBi9yVCEC2arZoeIFQ1fSLGsqjR8LzmvXT5s5kiZValzKO7ubLSAenvRnn8Izz rkUcA5RKNTYra2q8fzdvlrbKVgfcwGdZidF5Sn96uorSPgSFh7lx5fl9tqSjUC0b4Js8= X-Gm-Gg: AR+sD13S93kXfMHe56f506RLsrXe2AGtf+vY/KROnIGZtzH2f4EBQkDe5L1bTRr/BiX iRD9dx8lhHlLsvoIXJqpq6LAC7ZL5Ysboa4V405jo756nNztQE9qXQxeOsr9cLnIOIYhIaosuT7 wrNjWF6E1swgysqzp6wFmuqvo7mqyRZ6qHP1j1K8wS68ksTGf0VogelGeECqZshItgz1UYU/3+r k/0cyV4AXfDD0vMDhOqwLUcYw6d5gEHO8lxYSADuK3NHsGiZ/T/nfnWdUZdVnFtmLIQlw175fV/ 7QaHjhqbOnGLOl1VnHamrVN7X17M2rspKkixNFyrs+cGbrfsPSvPlgfjDY37F005Iqu0nxeW/Aa 64IHbq1/SiCeuvu1BKHmU+B0fcgBnUlCd+h0= X-Received: by 2002:a17:90b:3d85:b0:392:c80b:8eff with SMTP id 98e67ed59e1d1-395c3573af2mr41879347a91.11.1787549712008; Sun, 23 Aug 2026 22:35:12 -0700 (PDT) X-Received: by 2002:a17:90b:3d85:b0:392:c80b:8eff with SMTP id 98e67ed59e1d1-395c3573af2mr41879275a91.11.1787549711613; Sun, 23 Aug 2026 22:35:11 -0700 (PDT) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-327ff728ca7sm20166492eec.3.2026.08.23.22.35.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Aug 2026 22:35:11 -0700 (PDT) From: Krishna Chaitanya Chundru Date: Mon, 24 Aug 2026 11:04:59 +0530 Subject: [PATCH v3 1/2] PCI: dwc: Force L2 link entry on shutdown/reboot without D3cold check 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: <20260824-shutdown-v3-1-81c14bb7a1af@oss.qualcomm.com> References: <20260824-shutdown-v3-0-81c14bb7a1af@oss.qualcomm.com> In-Reply-To: <20260824-shutdown-v3-0-81c14bb7a1af@oss.qualcomm.com> To: Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Krishna Chaitanya Chundru X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1787549703; l=2654; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=i18DXA1UuvFFxlInAjMEmK2CjnCD979tKCem1E4xy6c=; b=IEzzy6r5Nd5xEiu6vni6gbGOnON3InhmtJy1xbHXNRmiOzPlbkPTCbb+WhTd6vAlhqzygWEps mNniI/E/eEiD0E76k2Ykcl+cgDcNux+szymd75ur5TnV26IeNikkCyE X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Authority-Analysis: v=2.4 cv=DsJmPm/+ c=1 sm=1 tr=0 ts=6a8bd810 cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=yeOUdISH2rptVKx3L3YA:9 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-GUID: Xauw7Xd97YQXyF6Aua1Y0GTD4FUlCJAb X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODI0MDA0NiBTYWx0ZWRfX2ylqoarHsDcG w8hIkjk6EB4QCbeNMrHtovKHOcU9+ioRFpyTdS5wTuBkAQTv/QihpFOSsD8abITK+LtvtbFRTQc HXpq8O7Ioj9rBARBgMWQ/IGd9uR/ZcdHTIrMljh/6tia84YwYMgTknOFG8c1xJ5KnAOlmMOBWTm pebJMqSFl0iOfHlByNVZq121kcIxtQZecmkoEdfgT9L3wlFZ7iR0QxzziXauxxAZxgmnusXbl+j 7uVazewuOpKGeCwNlkU2ulwjRxkMLliyT2P54bhaOPVov56o48tczeRJj58MQydjbG32Fk97Idl Vk2KmlUy3cm66hMbajgW1LdRV9fMzYo7/QUASA1P8azjYpqHF9s8qc15Ccx8Bv4A0mERuq3WLAS fNWbojz6PgK1/BmJ9cNo5NPOTsXQSHinAdLsrkBGTpNT2q24lZUr9ZIhUOwVHh9cQGuozBgTaPE nyl9Cs56NH83g2Z+ybA== X-Proofpoint-ORIG-GUID: Xauw7Xd97YQXyF6Aua1Y0GTD4FUlCJAb X-Proofpoint-Spam-Info: AW1haW4tMjYwODI0MDA0NiBTYWx0ZWRfX8EG9QQK5d5TO Vtw3Bmj3Qk6kevsFf3KK4d07eXNmLCEn7Q70hjtwz+T52FNn9iHifpD0nDAtu60FrEzj1cJ2u2Q +u5uM6D9sfOWDEjGZcTcgyNeHqZz63c= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-24_02,2026-08-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 clxscore=1015 adultscore=0 suspectscore=0 malwarescore=0 bulkscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608240046 dw_pcie_suspend_noirq() normally calls pci_host_common_d3cold_possible() to check whether every downstream endpoint can be put into D3cold before bothering to move the link to L2. If no endpoint supports it, the function returns early and leaves the link up. Querying D3cold support during shutdown is actively harmful, not just slow: pci_host_common_d3cold_possible() requires every active endpoint to already be in PCI_D3hot, and returns false otherwise. If any endpoint is still in D0 -- which is common, since endpoint drivers aren't guaranteed to have suspended by the time the host's shutdown path runs the check fails and dw_pcie_suspend_noirq() returns early without ever moving the link to L2, leaving it up right up to the point where the system cuts power/clocks to the controller. Detect the shutdown/reboot case via system_state and skip straight to forcing the link into L2, the same sequence used for the D3cold-capable case. Signed-off-by: Krishna Chaitanya Chundru --- drivers/pci/controller/dwc/pcie-designware-host.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pc= i/controller/dwc/pcie-designware-host.c index 06722259d2e3..98cd9dd2c7d7 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -1222,16 +1223,29 @@ static int dw_pcie_pme_turn_off(struct dw_pcie *pci) =20 int dw_pcie_suspend_noirq(struct dw_pcie *pci) { - bool pme_capable =3D false; + bool shutdown =3D system_state =3D=3D SYSTEM_HALT || + system_state =3D=3D SYSTEM_POWER_OFF || + system_state =3D=3D SYSTEM_RESTART; + bool d3cold, pme_capable =3D false; int ret =3D 0; u32 val; =20 if (!dw_pcie_link_up(pci)) goto stop_link; =20 - if (!pci_host_common_d3cold_possible(pci->pp.bridge, &pme_capable)) + /* + * During reboot/halt/poweroff the link is going away regardless, so + * force L2 entry without checking whether endpoints have transitioned + * to D3hot -- there's no point walking the bus to find out. + */ + if (shutdown) + goto d3cold; + + d3cold =3D pci_host_common_d3cold_possible(pci->pp.bridge, &pme_capable); + if (!d3cold) return 0; =20 +d3cold: if (pci->pp.ops->pme_turn_off) { pci->pp.ops->pme_turn_off(&pci->pp); } else { --=20 2.34.1 From nobody Mon Sep 28 09:59:13 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 BA9973B388A for ; Mon, 24 Aug 2026 05:35:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787549722; cv=none; b=lAyawUuMDzmdxpR9wI7jVMb9qboQEghpt7Q1VuIqo1H3AZhgR3p/BnG8wcMDsiPKmK48lczqUBqFzqEUB5/GFFy4lqFJgJSBr3ijxY2s5D5PD2Zv6h261DPKzZ+4he7VvwP+gCzV328NPyAj08PdKR/gMy1139FjaCWiUl8SgqE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787549722; c=relaxed/simple; bh=Gr3j/bc4r8i0ncFhXrYatBEkauE3ZXxaz9dWnL/CP58=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jvG5h1XZ2ehmHMe5mzkF2THgLPICAmso2ROyMQOajVnLUYwtRwS3XvAflsXbY+vz9HzUqRxMTQsXOHGpJbVEhK/9RRq75Rrh8btVTVzVNRn1jbuB9IM7FE/JnFp8JO8u1xLchswmrT5QFAJOvJdNRlBXOPd9Qv9v6fHYGwZVChs= 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=XLRkxMXE; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=RtQ5RWkD; arc=none smtp.client-ip=205.220.180.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="XLRkxMXE"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="RtQ5RWkD" 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 67O5RAx21574287 for ; Mon, 24 Aug 2026 05:35:17 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= G7gnxc0Y7AdzTUkeyoIh5jJdd1ZA5WK6Avh0PA7l99A=; b=XLRkxMXESNVs6pTJ DvBTXyVCIKFhhrx6KTOnyrkGvTEWyjKWDcviICjOhvFcYEzH2MI6iPl6F/XVWXJp fH4AJ4pIcQLx+9Luqe6MJSTg9nqtzuHlChXmyV7q1iFet1X0P/AtO+LNhUpk8UIz lX2NXbSS10s/1DRoBl8lvJNvn2cWjKdP1li6R9ZHKaU8SDIvrnCd2ZSSt2CI8CMf 20MEinB1o4S3t8dIh3TpV8WRxBVByl4iir3Euj/kMKON0xFFJlKzZP8BVQpTJPq8 wa2ndeo49WiFO9CMvQByc8bZ3tudz9jg42zAmgrMbgbE+W5+vS8EF4fGQMToCNFw g8tHAg== 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 4g7456wju6-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 24 Aug 2026 05:35:16 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-385d2703b64so4359176a91.1 for ; Sun, 23 Aug 2026 22:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1787549716; x=1788154516; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=G7gnxc0Y7AdzTUkeyoIh5jJdd1ZA5WK6Avh0PA7l99A=; b=RtQ5RWkDP7/Bs/N5B4NVC0NdgLYXWzRN0bpLFk2kisLUsbSnhhQ1QOXEOM+9FEPchH UMxj9TUtFfIYGm5xOMJxt87Cpmki+yidsVSrrRef+lCWELk93RqdDST1Ual7dEclrhxD /5Yhw7TjtMbLyhvbGy7AuoqkwkG0FClCa3Cd6HuNbTDw8SNA/fuG3vwDaPD+HDLOUjDu gNJI+gSGyWvP/peyLhpdELuJvj3p4L7Q7/no6Wbe3TFK5CpyjJ86kvU3RDI9K9uOFSak I/iVwIRsEV9WlZ6YisjK0yKMDCxsVK+KpjD8BlPhJVFSV0o/uvd/XnQCKilEutw4g2fG ycrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787549716; x=1788154516; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=G7gnxc0Y7AdzTUkeyoIh5jJdd1ZA5WK6Avh0PA7l99A=; b=FNfQA0o4wDlC4chOqChNXMf0mNy+iDmzpPbh2k9jSfptnU6MEN0W6c4caNLHDvu1j9 BfrygOK8WydGMPU8veXuF0B+2Ys9PQqbhpjjP61Xc4HTYf70cOHpoXHi5RhFeuXjhHqc 9JLVXhsbzJBCoWggqG3bH8RxXb2blrCYIRiXOVI+nwR/DfaJ4GXMjwUhA47P6hkU+Og0 eNiXO0O0oy3Lf81AnDCJNdW/M+w7N8USNx+/U7jX0phL22WYwtzvjmp34sZLqN5beGQL DpkmlSVuhY4NF/W0KyBYIAPg3Vel5BipL8iriQ3fqE9kktEjrGAzeRnWDWP36NSHV9bC mVKA== X-Forwarded-Encrypted: i=1; AHgh+RohW9cZoeAOemVhAXjjFh2mL+luHWeMsTiZeJyvH1/cZTOo44x+ogramEuZL+g00180iBzlyX7UklAEMUs=@vger.kernel.org X-Gm-Message-State: AFuF++nPzgOwDV4IQUBQ/ze0BGxGxQ0jGSYMfqVIkoX+DQb2ipGX8njE AhremKdMFR1a7gK0cQ35/H9RNHQR21vdejF56B59+vAfJ5nveOOw8SW51M40uG0l9JWKoZ3QuLJ YqlKRp41Ya6zlWKxWVp2IUuJp8oIcLwCI96PUfn3MNED9HzEFKO9V3cK7Tb+BkRdbH6k= X-Gm-Gg: AR+sD11RRNBd2b3ZSB5Fr3YNJ476TnAOMF6vgU9ezqCG+q0i1vqI/WjvPqh1duXVMyk 1RjpbmEMTlX7tALYClv9nTpX9cw+mizXuhYQU3X9JW5bVxn5aTv00DvVqzF4uN270mQuYAZyM49 MUf0cODsbbEOTlDyE/DrhnfsqjJE0TH0Zq5WFu6tLViGufem1Az4WJt59cWdCo4k4WsILzpNsQE LeU3Yy0y2TRkbA2DlxJr8JAqlFUBpl4DDcnbzyIXqJcyJj0eO/0TFX7l9XVMVNk7QdyAF69DTdJ pVB3/Q9UTunBj+DjXU2V3WFw/7DYzmvpfut9FMK+ek5CLO3ocpLy4cExBfLoa5J9HO5oFdVeaaa rnDnX+dvEG3r7w+SIFNCrIQwSeNZMvxuTSxs= X-Received: by 2002:a17:90a:d40e:b0:38f:a81:15b1 with SMTP id 98e67ed59e1d1-395a071b857mr37436817a91.19.1787549716011; Sun, 23 Aug 2026 22:35:16 -0700 (PDT) X-Received: by 2002:a17:90a:d40e:b0:38f:a81:15b1 with SMTP id 98e67ed59e1d1-395a071b857mr37436750a91.19.1787549715545; Sun, 23 Aug 2026 22:35:15 -0700 (PDT) Received: from hu-krichai-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-327ff728ca7sm20166492eec.3.2026.08.23.22.35.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Aug 2026 22:35:15 -0700 (PDT) From: Krishna Chaitanya Chundru Date: Mon, 24 Aug 2026 11:05:00 +0530 Subject: [PATCH v3 2/2] PCI: qcom: Implement shutdown() callback 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: <20260824-shutdown-v3-2-81c14bb7a1af@oss.qualcomm.com> References: <20260824-shutdown-v3-0-81c14bb7a1af@oss.qualcomm.com> In-Reply-To: <20260824-shutdown-v3-0-81c14bb7a1af@oss.qualcomm.com> To: Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Krishna Chaitanya Chundru , Manivannan Sadhasivam X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1787549703; l=1611; i=krishna.chundru@oss.qualcomm.com; s=20230907; h=from:subject:message-id; bh=0cHTaxCZhYijIaWac3FDVreKAhduxOIxg24XX1VGE0w=; b=La6xvZgrg53OkQBdhXJXN3dWr7kVxRj/tk2n1HR8Vs6RVyUql38BNbLRgN8czTXxn0bR/oo0B 9nVL6LA8o4ZBkD1u2m7iFDbNqRb7fhKUYf6w91MndAR8I/MTcDroyL4 X-Developer-Key: i=krishna.chundru@oss.qualcomm.com; a=ed25519; pk=10CL2pdAKFyzyOHbfSWHCD0X0my7CXxj8gJScmn1FAg= X-Proofpoint-Spam-Info: AW1haW4tMjYwODI0MDA0NiBTYWx0ZWRfXxdxTL27zk2Ro Vis35/5eZ5gAtdxqrKfbEKAol3AcQLWbA7u3+2SIqoztogZmzjoHtf54kLG5S/NwUFk7kybpGQd UImtt+dKFqIZdHeVKTHGuRlyhD4sGfM= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODI0MDA0NiBTYWx0ZWRfXxV4rW60JyWVV iAPtHXrMRV/LndfGQr5TzLm5LHEmmPeLGUbOUNLxvS9NEmo8zZ017IlDOMFegayCvGkjw7JcAYR OIerV9S5zxWoq0nlk/6hU+QcWfURuE9u5onPXhdyuQ3iBQmXUM3UZGWDuvc/9yc+Yg8RnQg5SVK CwThckn0LQ0sjsnIeBWiCpQaMxYULFKW9stwB8tydXh/TTReKpnUNSBDk7R1oNlIZTSgroHNXCI o+vvlEyaXu6PogNTKoUGq+z21ngAKsyCxLbJlfsR+x3HB5NC9aFQ0jW3U4kztve61QtK/6NNho1 c1AIthNdaT40Jwhe8Dns1exteMVSwqLb1QvdfA7Huxx/OUCl8mMzaW9KkQR24kQvCEdlNUrgxpe DPJTZNIOsbRI5NDUjm8AuhkC1sL9QKc09n2dxQSul48Fv0gH8z+PueEZQRIk3KHQh4PwcMQCa+1 ZvtrAEoFlbeMCTQGl/g== X-Authority-Analysis: v=2.4 cv=RtL16imK c=1 sm=1 tr=0 ts=6a8bd814 cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=VwQbUJbxAAAA:8 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=Py5lcOcq67Lbq8UMOfUA:9 a=0bXxn9q0MV6snEgNplNhOjQmxlI=:19 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: fcoQ6Ri_wCdeWHjSvplBnUSSuHAZa-di X-Proofpoint-GUID: fcoQ6Ri_wCdeWHjSvplBnUSSuHAZa-di X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-24_02,2026-08-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 adultscore=0 malwarescore=0 phishscore=0 impostorscore=0 priorityscore=1501 suspectscore=0 bulkscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608240046 From: Manivannan Sadhasivam PCIe host controllers should bring the link down cleanly before system shutdown/reboot proceeds to remove power/clocks from the controller. Without this, the link may still be up and endpoints still have transactions in flight when power/clocks are cut, which can trip SMMU translation faults or NoC protocol errors. Reuse dw_pcie_suspend_noirq() in the shutdown path to force the link into L2, putting it into D3cold. Signed-off-by: Manivannan Sadhasivam Signed-off-by: Krishna Chaitanya Chundru --- drivers/pci/controller/dwc/pcie-qcom.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controlle= r/dwc/pcie-qcom.c index d8eb52857f69..a4284c64de27 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -2156,6 +2156,17 @@ static int qcom_pcie_probe(struct platform_device *p= dev) return ret; } =20 +static void qcom_pcie_shutdown(struct platform_device *pdev) +{ + struct qcom_pcie *pcie =3D platform_get_drvdata(pdev); + + if (pcie) + dw_pcie_suspend_noirq(pcie->pci); + + pm_runtime_put_sync(&pdev->dev); + pm_runtime_disable(&pdev->dev); +} + static int qcom_pcie_suspend_noirq(struct device *dev) { struct qcom_pcie *pcie; @@ -2337,5 +2348,6 @@ static struct platform_driver qcom_pcie_driver =3D { .pm =3D &qcom_pcie_pm_ops, .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, }, + .shutdown =3D qcom_pcie_shutdown, }; builtin_platform_driver(qcom_pcie_driver); --=20 2.34.1