From mboxrd@z Thu Jan 1 00:00:00 1970 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 09649136358 for ; Tue, 2 Jun 2026 04:34:29 +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=1780374871; cv=none; b=n0JNNZyWCFsFMNpDU1cwhYeIXDJPvGpYWBVRB4Q7GEPD/ob5VkK9mRjSA0r8yg6moBaipCqP9x9BTvpt4HCrKXYfDLxH6Wwl96IVuH47H546h6CsLJtvhAFUV04xZsEdlD9ZUgoJGNFmOx64jRU/31LNk6RP/azyMhhFF5HCpu0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780374871; c=relaxed/simple; bh=ty+HAAsHAxkUJXff9F+TEX/K6iMhWXyTR1OBcpL/1fE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=N1D4XnJmqTBwekuOK+my6X88WqEhYjiwa0Yz6sKsRmZPfSDUJb9lxb100Cfcr09FsHIIK7neKvQlTdP9jB4tNDtYuEg416nd9++qUBBroNuuqY2OSp5JbFY32uCA8/+1LuOatzFFI4Gu8fay+lKJNiEUut5ew7Cq76TLt1f9I5k= 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=FV6dGG8I; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=aRspB8lT; 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="FV6dGG8I"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="aRspB8lT" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65245gVM2691969 for ; Tue, 2 Jun 2026 04:34:29 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= ehXOCZHzAdL2E3/HvP4lXm7p39a6i3gpcELOmcTa4Lg=; b=FV6dGG8IuMFpF+pS MumxC+FMJW4eQmnrKCs7cfPWR2FwYBp7kggCWgcpjN7UBoj/MLhh8lOhXLSO0N6d I2FU02qo5iFX0hbGjnl+YmRVX5vFjhNAcqhR2fIsCoiSick4eSoy90zdTFaKlf++ ZA5XcPfaqcmZXklbpoXpXBe4ZKoa3zaUMvlcwG+Di+dAO/ddgwpeVhfJI825Vk/+ o2q25duMRUNhOlT7/BmxpOHYCoa1QW0lKSEc1DCg0qpScEK7OhbCrfhbAKSr6Bpn 7X6EnO9GcQWeSzlraltJNCAPRP0QEL87RGiiK9P5RpZEfDh5DrXhDX46tyYhOYPd iFhS+A== Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ehqumg2vb-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 02 Jun 2026 04:34:29 +0000 (GMT) Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-c85a2c665easo1982760a12.1 for ; Mon, 01 Jun 2026 21:34:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780374869; x=1780979669; darn=vger.kernel.org; h=content-transfer-encoding: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; bh=ehXOCZHzAdL2E3/HvP4lXm7p39a6i3gpcELOmcTa4Lg=; b=aRspB8lTqRjj+xQJMBkLdc0usKolUlmxrQ6QpkShpmElPuRFQKHFd9PRWtuFn5uByu X6wWNfwrfVtRclIWk2MldAe9oPtqSSC5JO0CKmLjFPXoAFZByvbadQNpKDIr+DmZaP8+ H8B3CJXJBHI/kzlp/L95HqhX02UWddg9TP5SdDuqftwTF20Bu3Mot56/G9XexAhRhtM0 809On6yg1F5PRVhMlaeLN46ozjntuHhmC/QhXCLmDDMUcLk82Dqc14DAgLHIGoOCEdAi tuNv81YJQfUV0Y2+MwcZuHPA+z3l+9n6uaPAAELnq7HmKdkTCwXyhbFoonUknjKriybh 9+PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780374869; x=1780979669; h=content-transfer-encoding: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; bh=ehXOCZHzAdL2E3/HvP4lXm7p39a6i3gpcELOmcTa4Lg=; b=sdAjUHXbctDyCbxcjPz3o8LUhF+HX26ymfMVIVma1id+KuS/zFuKlA4Kh8B1/iDR1B misF6d1MZ53CtquO6IPG2g2TYEKOcuAXstGKXZ3N8cGPmMR1bKaZ4ogV/DCvA0KJ963U BkkbbiE6hwNverOwecFxT7sBbseyBYnW4+1zj9KGHQObhYO1hgiF3LQm3e1ex4+v0PuZ k6IYo4Pwtg/bE2YzJjEcZUHeo9nv5iu5z/CqOUQJWBBLDXIyvin0Dg+v4FWBiNXkKQH1 H97bAX2hUlBYFgr9YO7UqLRu7T4c6ayP4h+FhKSE05lZabkbuoEu8n6fnLZbDOoJJXME vh6w== X-Forwarded-Encrypted: i=1; AFNElJ/eI0QLF54UwgTSW5jVZwymrvWziKpQ+kjc09h4ziVOiPiQjNcuQnD+sNhajDWeWTHXBO+ugYaNFLsiMRM=@vger.kernel.org X-Gm-Message-State: AOJu0Yz6R0u/Qf802NxUC76MVb/kaJnIbaQyBQRZuwKG2oE8qBWz3WK2 f0UJs1i96dlfbq7oJX8hskTwUwy5j2wZQ1NklDnu5ziELuRSZ2qaVBbANGHyXcI1+wiinMyoxst +fh6NLfoDliwAdMhe9QLZsP/qLAW65arl9+oApN/vBygn2rjhBjcfBxF0x8jqvSCwoi8= X-Gm-Gg: Acq92OHBuxt4FoXNPsglHd6SMGQuCQXBhNfwM6D2kYoz3PnUZGwl+tRnwptj3AHzxkQ 2JYBeQoWhjSd8FtPzb93+rdfg809AoVEcnLgDc8IJmvMjOD0DnNWt3OmjNe86Ydo6I3v6HoXMWR DZTrqgHWrL9V0u0VJaWtXfw2IfqKccCczc3TBur6mnMXBzh+ms5TnYSDIV4r/zKxP0Mth2/hZjI DsYpl2oZfH0q1ZluM9YghJaVHvDUNagrutLHv81JaXtdNbo74awiuuqC1H+65bjLFGrLA0HDCi2 E3/aE8ktsobcakXFU2eQPWi9QN3/yFX072BvYog23/H7T/321/3MIq3U3nLijoxccHtuhOCycf9 D6R5Nipo0QNE9EQsuLMX5kngnvsk2Wg7yYGTSi9sKYd3S7NjyqQ9CvT8E3uLU1nsR0guNTt3plZ vO X-Received: by 2002:a05:6a21:a34c:b0:3b2:b1ed:d1df with SMTP id adf61e73a8af0-3b427f2cff8mr16397475637.29.1780374868609; Mon, 01 Jun 2026 21:34:28 -0700 (PDT) X-Received: by 2002:a05:6a21:a34c:b0:3b2:b1ed:d1df with SMTP id adf61e73a8af0-3b427f2cff8mr16397437637.29.1780374868135; Mon, 01 Jun 2026 21:34:28 -0700 (PDT) Received: from [10.151.37.217] ([202.46.23.19]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-842222e2394sm9874515b3a.2.2026.06.01.21.34.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Jun 2026 21:34:27 -0700 (PDT) Message-ID: <0bd70e70-68fe-436b-8366-8a497861e21d@oss.qualcomm.com> Date: Tue, 2 Jun 2026 10:04:22 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] PCI: qcom: Handle mixed PERST#/PHY DT configuration To: Dmitry Baryshkov , Qiang Yu Cc: Manivannan Sadhasivam , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam References: <20260508-mix_perst_phy_dts-v1-1-9eff6ee9b51a@oss.qualcomm.com> Content-Language: en-US From: Kathiravan Thirumoorthy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjAyMDAzOCBTYWx0ZWRfXyxpoOp9DpC72 rz8QemA2h2W4zP0Az+Wc2xdPwv44RWicnSil3VDvOW9M6IXhQs+NdJewTxy4MlelGOzyur5PIMT wTm6Q8g3J1FejKGQn2bfa+gOw+PZDFR9RFwlzXUswWpahE/gfAH2jZhss63/h7cphicLhaRYPCT X3FgvY86HaxLdQAQmDxvTv7R6rNiqq6ocebFjGQhdWyzCeVhpkb0S0xji4+gUSaP7lte2zBr3V4 Q4nQBL9Dq6ztm1Yj97e4ZQiSDGgBkMZDPGunwRNJZjjS3/L5sAlpv/zWrx29VKUonGCIZc7aJvQ oyH++l/CrQMw0+6VJDDap1WcwEcyJil2mIgag+l8Ylyq3721Veb60r8Dg7s9vdYdW0SEEJHzwGW H3L8x1jjIcWrE6gP92e9DFl6B695/PfAhZNgdABg1g/O3QhWhEiDa+Boi2E3OEcQX5gTAD4Cr/k AoGCOydg6aNM3Xh2ySw== X-Proofpoint-ORIG-GUID: 0EjdAkON3jhfUWbzvE73MVe4WgVfxp2Q X-Proofpoint-GUID: 0EjdAkON3jhfUWbzvE73MVe4WgVfxp2Q X-Authority-Analysis: v=2.4 cv=Rrv16imK c=1 sm=1 tr=0 ts=6a1e5d55 cx=c_pps a=rz3CxIlbcmazkYymdCej/Q==:117 a=j4ogTh8yFefVWWEFDRgCtg==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=YW_819I0oaYKz_JYO2kA:9 a=QEXdDO2ut3YA:10 a=bFCP_H2QrGi7Okbo017w:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-01_07,2026-05-28_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 suspectscore=0 impostorscore=0 phishscore=0 priorityscore=1501 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606020038 On 5/31/2026 4:37 PM, Dmitry Baryshkov wrote: > On Fri, May 08, 2026 at 02:54:19AM -0700, Qiang Yu wrote: >> 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 >> --- >> drivers/pci/controller/dwc/pcie-qcom.c | 15 +++++++++++++++ >> 1 file changed, 15 insertions(+) >> >> @@ -1778,6 +1785,14 @@ static int qcom_pcie_parse_ports(struct qcom_pcie *pcie) >> struct device *dev = pcie->pci->dev; >> int ret = -ENODEV; >> >> + if (of_find_property(dev->of_node, "perst-gpios", NULL)) { >> + pcie->reset = 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 fixed!\n"); > This patch breaks legacy DTs (I stumbled on it on SM8350 HDK), because > now devm_gpiod_get_optional() in qcom_pcie_parse_legacy_binding() > returns -EBUSY (as the GPIO is already requested here). I'll send a > patch fixing the issue, but it's sad to see existing platforms being > broken for the sake of undeclared "mixed" case. Dmitry, I have sent[1] fix for this issue and it is squashed with the offending commit itself[2] and part of controller/dwc-qcom in the PCI tree. [1] https://lore.kernel.org/linux-arm-msm/20260526-fix_perst_gpio_handling-v1-1-9170507bb4e9@oss.qualcomm.com/T/#u [2] https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?h=controller/dwc-qcom&id=1a23bcb452d95f099e530414504c0d99ee076b3f