From nobody Sat Jun 13 09:39:41 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 E60B73590C3 for ; Fri, 8 May 2026 09:54:40 +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=1778234082; cv=none; b=dMaB9eHd8ypIbzoFngTC6txbbSLdbWF91+WRTWIur0wX0zWCZhAfujkkMd3dFCdDwKy+ycLlbqaWiH9dmXJFRabsaA4+c4BbtGDH7NJ/HzrtRI2dgQ060z4IdnnoimXu0qgxOBkGbuRuh5sn5wHH2e4CJTlBfGjK554J2srcCZM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778234082; c=relaxed/simple; bh=HjEDykLJX6Jt9S9QvlQhNfndBFcUdtpN/AUoX4hVNMk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=L+sL7hcDtdWWGdNE2j4wa60Mnu4ncsfwQeuQW4Q5Xdecli26Es42n4RTOx5URoFkcsfPIG0nEehh1TBbvBA9OOKDT9HGDJt+gqHzW7hDdXG4lwRbQ1GR6YC4Xm2Q5KW/vp0QRPM8XzZwDn2qCNYd1tZEGUQB18bEPSZeNz3DyX8= 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=fDEzoqEs; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=TMCqrkuy; 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="fDEzoqEs"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="TMCqrkuy" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6486jJ8h258202 for ; Fri, 8 May 2026 09:54:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=TiJIdCtRF8sPp8DTAw7sCi AkaeIBCqQtT+HrST28lLw=; b=fDEzoqEspPuMo/PcO1ct4OOEGOYWxy1fjn1bWl qlbZAimEryrvD+q78Jg6VwIKVC4UivO6jaEKCZyTFm/17Fg5hQyA1s8ayDNhIDg8 Ik+6RBDkvF4FCMPV/J6A8ripnyRS4NATE+usCZJTRYRotcsxnBwJWNVw+VJDvr1S YQvmKiS4P+TLI8oU5LsMZsBDHupzDsGsBikXPcZSxdEO1psLHRxMhsLZ9vhnkVFq 7ifcINVUPVOPeSgkTq+iopX9RhPS9XYZp9oPiOIi9mabNDIwUPcjo695TEr/Yg8R 9LcXV4wPzLxydZCg4o98NQqpwIync/4NTNuhBPN47/ZTAJ6w== Received: from mail-dy1-f198.google.com (mail-dy1-f198.google.com [74.125.82.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e1auegpx3-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 08 May 2026 09:54:39 +0000 (GMT) Received: by mail-dy1-f198.google.com with SMTP id 5a478bee46e88-2ee34588671so2589084eec.0 for ; Fri, 08 May 2026 02:54:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1778234078; x=1778838878; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=TiJIdCtRF8sPp8DTAw7sCiAkaeIBCqQtT+HrST28lLw=; b=TMCqrkuy0oZ5ji+hWTvuBiX/jjcY7vyGgG1e1LkWfzFIE3NLwuSTf0dF+MEmd3sWbv bp9RC0GxSA6NtdoP/f2Mdt/TAvhRAGVrMfqlMMs5t4gucNFl7dwuIOhMSMmC9aUjsH2v iwOCQoMquN3o6hWYYdIZ5qmJp4hMZ84kssyymEw8YjwtQzZluhVEwJQIa/p0/pNIMrAn IWf5izOPwc6az0esdaJwtm63fQMeRVIfQMDHN0Dt+elS0F+MtYc8XtBIZDZLCO6Zm2wj i8VhyHdxLZ74T4VaYqFJfvu2zX/4R9BvasqmzT+1jyZ5ymDq0q/jEH8L3JYZP/XIPdFA cGmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778234078; x=1778838878; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=TiJIdCtRF8sPp8DTAw7sCiAkaeIBCqQtT+HrST28lLw=; b=fjQm4fWPJqbvigPsEQ5dfIjC7eGxwXZlXa4OuUljystDY5Vw860OG3e/ePX8lCj7aq Tq+DT6mRtKB7UsokEhQdy2es/7hrEbjBjZT+nK1sG5egg9tkUGwK30gSHvXMYzt7ocPq H2kKecb7qrQrT/rzTst+7fY1JPuNr0N2mSkdxgHEm1zWOnxfeW0gC1HrKST4Zq78Gede z7KziaZG9uB9ZUuM3ooxbYc6RZsXvJz8VuDfLi98vaFC9g13HRmtMMRByeeSQcHzJOtv aNijaT1TG9/Zo31ZHY7tj5/xMp4YVOToO6nHVVcrMOnTWrYHVQObfT+oADSIWGsjdiU7 Hn5A== X-Forwarded-Encrypted: i=1; AFNElJ/ww+PwMldZVovt6lCHTfc3yGpB9WZker7QCxkjrGWuxgJYVs0gg4GRFEADc2VgeCEcSzYK05shTuWkIJM=@vger.kernel.org X-Gm-Message-State: AOJu0YxW5nVnK/YxS47GpqwfGelojtdKljpsJWSAZz5w2QhgsEej8Qdb F208f6JX4TfL52jqF8b++mgZJzNd0H/rv0qkuOLS4rrPU8NfcILqKWTD4KuRWS9h3L2EcVa6Jz3 T+VlHZmIUO2i/LiKgDd1HsbUWk5WpryFR47d7GebqdCstYhS4L8nYRluq4XMpSNc/KnxGm1icxX P+QA== X-Gm-Gg: Acq92OE4l4QXwjrcYOSP46K0zm69au7dCfvA1icUIkxN3VZFuhOVSJRdC+aZFiUDmIA qP+FuFSD7tvraAnXU+Mkg1s1wMYHHLD/yn8pWnM7Fi5rP9r3cIzOHtqOO5IBXmUAUOB6fAbyQNl +Drg7FoNj2RJEp1RLG7jsYdZcOuHgQwF3K7DX2sAF0JrWdd+Gp4ZjAbjIT1h0yiotAmQ638NqDi DiHgRUObcQPdq2u1SDLJwVT3fmUJ8VIztUPu5xOEpyQo3nQia3KYBuWzUsRIJEgg7ElGbLea1le 6p6MHHoasYW1dXN6E8q6YhV3b6R+M7+gbLYOo3cJwu97l6ZT2LHTkzdJDZyqv1eMKhvspwEp8zh 66M2wzzkk3TqkgYt9vUOoJXutfckkBBvY/zunaujgBZrpfyIyMel9Bq2uXOc7biRLflao X-Received: by 2002:a05:693c:2c93:b0:2da:a813:a5fd with SMTP id 5a478bee46e88-2f549f7c2fcmr5978686eec.22.1778234078485; Fri, 08 May 2026 02:54:38 -0700 (PDT) X-Received: by 2002:a05:693c:2c93:b0:2da:a813:a5fd with SMTP id 5a478bee46e88-2f549f7c2fcmr5978665eec.22.1778234077926; Fri, 08 May 2026 02:54:37 -0700 (PDT) Received: from hu-qianyu-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2f88924af95sm1459176eec.30.2026.05.08.02.54.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2026 02:54:37 -0700 (PDT) From: Qiang Yu Date: Fri, 08 May 2026 02:54:19 -0700 Subject: [PATCH] PCI: qcom: Handle mixed PERST#/PHY DT configuration 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: <20260508-mix_perst_phy_dts-v1-1-9eff6ee9b51a@oss.qualcomm.com> X-B4-Tracking: v=1; b=H4sIAMqy/WkC/yXMQQ7CIBBA0as0sy4JbVGJV2kaIjDKmFgJQ00N4 e6iLt/i/wKMiZDh3BVI+CKm59ow9B24cFlvKMg3wyjHozxILR60m4iJs4nhbXxmYU9qsFpJPU0 WWhcTXmn/Peflb97sHV3+jqDWD7zZ6oR1AAAA X-Change-ID: 20260508-mix_perst_phy_dts-b741b840833b To: Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas Cc: linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam , Qiang Yu X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1778234077; l=2895; i=qiang.yu@oss.qualcomm.com; s=20250513; h=from:subject:message-id; bh=HjEDykLJX6Jt9S9QvlQhNfndBFcUdtpN/AUoX4hVNMk=; b=ZFbD9kJPg9Z/CSnes5kNmNpry/Acsc17UJzeDMdNuFXVFH2WaQsdDcwVGn0FhI2+eA636JUUc YYYkQ6353NYALPswRbWrBfqVNamuWbGR9ni7x/DRvywQLwxq5ChO+Aw X-Developer-Key: i=qiang.yu@oss.qualcomm.com; a=ed25519; pk=Rr94t+fykoieF1ngg/bXxEfr5KoQxeXPtYxM8fBQTAI= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTA4MDEwMSBTYWx0ZWRfXyxmki0N0+iQO Ry+r5xjTY5nDoBvTQmSZpSub7+33Ac/1GaaVK4o2qGXkkC9Jb3vuPOGwK0n/fzrOFwzrhukwfKo gi3tYaQl9jR1w6twjzxgwTFzlBQnU/9vfZmhwsZv/qQsaNftKG8+LNWploG9aoWSuIpYztAwzhz Avok3MfbMFgPdQgVqSe1kphW1Sp5vlq2Ekj0/hZbLXPENME72sWXzqi7sf9EgsbntG+f2aqWMxk InUajE14mdRoep8QbEzuw1amWA2bG2gB0TvwHuRR8GSBy+EFPiHr44olZHHHzd0qXEtPkGv6nfV GQQkd7r0fCDBi0ekA7+lmP13skiQWhgpmUQdDIe61rmowbtKVWwRxJQQ2RPmly+pRsRCt6LPUge NUwoMOpOk1fmtJOqA6bks1K+tKbBkzTYiXkEdqk8+CukoV5oOpMw54M67MtjVnXf0jDmUNjSvti zT8jnN+gOJ2S787fYkg== X-Proofpoint-GUID: qekBY9k9sC4GAiY3XVxTFWvyHMQFq8Sl X-Proofpoint-ORIG-GUID: qekBY9k9sC4GAiY3XVxTFWvyHMQFq8Sl X-Authority-Analysis: v=2.4 cv=fcydDUQF c=1 sm=1 tr=0 ts=69fdb2df cx=c_pps a=wEP8DlPgTf/vqF+yE6f9lg==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=jtNwtCWPJ1kYkMuoZKUA:9 a=QEXdDO2ut3YA:10 a=bBxd6f-gb0O0v-kibOvt:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-07_02,2026-05-06_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 impostorscore=0 adultscore=0 clxscore=1015 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605080101 The driver currently supports two PERST# and PHY DT configuration. In one case, PHY, PERST#, are described in the RC node. In the other case, they are described in the RP node. A mixed setup is not supported. One common example is PHY on the RP node while PERST# remains on the RC node. In that case the driver goes through the RP parse path, does not find PERST# on RP, and does not report an error because PERST# is optional. Probe can then succeed silently while PERST# is left uncontrolled, and PCIe endpoints fails to work later. This silent probe success makes debugging difficult. Handle this mixed case in the RP parse path by checking whether PERST# is present on RC and, if so, using the RC PERST# GPIO for RP ports while keeping RP parsing for PHY. Emit a warning to indicate mixed DT content so it can be fixed. This keeps mixed systems functional and makes the configuration issue visible instead of failing later at endpoint bring-up. Suggested-by: Manivannan Sadhasivam Signed-off-by: Qiang Yu Reviewed-by: Konrad Dybcio --- drivers/pci/controller/dwc/pcie-qcom.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controlle= r/dwc/pcie-qcom.c index 9fdfc88ac151..8235961d692f 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -282,6 +282,7 @@ struct qcom_pcie { const struct qcom_pcie_cfg *cfg; struct dentry *debugfs; struct list_head ports; + struct gpio_desc *reset; bool suspended; bool use_pm_opp; }; @@ -1703,6 +1704,11 @@ static int qcom_pcie_parse_perst(struct qcom_pcie *p= cie, struct gpio_desc *reset; int ret; =20 + if (pcie->reset) { + reset =3D pcie->reset; + goto skip_perst_parsing; + } + if (!of_find_property(np, "reset-gpios", NULL)) goto parse_child_node; =20 @@ -1721,6 +1727,7 @@ static int qcom_pcie_parse_perst(struct qcom_pcie *pc= ie, return PTR_ERR(reset); } =20 +skip_perst_parsing: perst =3D devm_kzalloc(dev, sizeof(*perst), GFP_KERNEL); if (!perst) return -ENOMEM; @@ -1778,6 +1785,14 @@ static int qcom_pcie_parse_ports(struct qcom_pcie *p= cie) struct device *dev =3D pcie->pci->dev; int ret =3D -ENODEV; =20 + if (of_find_property(dev->of_node, "perst-gpios", NULL)) { + pcie->reset =3D devm_gpiod_get_optional(dev, "perst", GPIOD_OUT_HIGH); + if (IS_ERR(pcie->reset)) + return PTR_ERR(pcie->reset); + + dev_warn(dev, "Reusing PERST# from Root Complex node. DT needs to be fix= ed!\n"); + } + for_each_available_child_of_node_scoped(dev->of_node, of_port) { if (!of_node_is_type(of_port, "pci")) continue; --- base-commit: 33a76fc3c3e61386524479b99f35423bd3d9a895 change-id: 20260508-mix_perst_phy_dts-b741b840833b Best regards, -- =20 Qiang Yu