From nobody Tue Apr 7 14:41:24 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 3C2253AA4E6 for ; Thu, 12 Mar 2026 19:26:16 +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=1773343577; cv=none; b=pk+thhRYk4TQoMrzQTpF2aXHMfzV5OMsBRa+X2RnRSCcKpBV6NUKllpls7lD5weagEAroc1QbX6vlYT7pBK7IIIWMhnR6MwIIVQMlhnQouTEOpvKwOLvAtdBAZCTHXVMZPGIfgyS9bOVF0qRVY5kNE6YTwoqJ5hyl4L4vDBivMY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773343577; c=relaxed/simple; bh=/hMWBgMjP5n6iQfPHc9rakNu0jJhgcqrY1OgBCwwNcY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TmmTuaA90jl3n2qWp5lsfcy+BtqRmEydYJ7qnZis/YpVVBJQv/QFSm4c4GeynZ+Op9AyM5PykXIDUIKzb85vLaIhfLa+1gNVECYqMquRGy9RWS2IRrVqKEDdqDhncS1Xth+2UomVstEjdMPQOHOxantT6Eqs1fye/4VUbxsNiWA= 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=jYoESiRB; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ijD3zj92; 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="jYoESiRB"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ijD3zj92" 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 62CJN3Cd3136561 for ; Thu, 12 Mar 2026 19:26:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=rYgB/G2VwJz4ODO+hOn7U+DtZ5xKr8XPIXx 5IU7AIX4=; b=jYoESiRB9Q6T7WboIjaPSHo9Z8LCGgNJzOsIEZKLR3qhSmpIdvH qNhihRAz81+zs5QZJoZQt1s90pqQaSd5jM6AVzAT0Ggzj/I+rio+P3Uj3SRevXAr Fo/+vrb7AmiE07l/iQpJndnm9dkM9dN06e2PRqwbvhD8t/LnXWBt8pwxlo/1N8bW xk3OlGhIHMeGmlDGh69uZKgAav4QI86E+MgdwAk/FABEhalfAjBPMRWDqyyGDN99 BahOey0CTbWhB78cFbmsEQWPQjhpYDmDMnxIQVustghQb9WKz9va5P057Qu4F8xt cn7P+F06yGq3wd45sgmjJhilPvnRypk63Mw== Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cuh4wbaj1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 12 Mar 2026 19:26:15 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-5093787e2fdso179493361cf.2 for ; Thu, 12 Mar 2026 12:26:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773343574; x=1773948374; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=rYgB/G2VwJz4ODO+hOn7U+DtZ5xKr8XPIXx5IU7AIX4=; b=ijD3zj92ESYwS5p+cGhg4/vdwrTEau1rgi2lecYPuAxWLXtRHUffhQI00ZhV7alMtW G4gjoB8HucTK3CTnhacElq80YoUV6Z3dAUtRjM91shOY2WpP15JwcJEsO1hRGECbBlXc mNGtGvMOQJBTnZGKbDlNINz0BQ2wv47DRfmeNxTphEIlUNqjZKONmaMRa1JZEfZ/rz4D JzZMxZkTJPUuFDyRokslXXpS1dpEEUouRRknFbkIQoiQr+AUWtAZBcLqtDdWVpZ0HfFj A0L0q4yK6vNrGlkAwr/HFkhVtcbhDI0L5dCwKFAysVa9L2KMaHlRQQZ26GSChLWYFK05 mmFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773343574; x=1773948374; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=rYgB/G2VwJz4ODO+hOn7U+DtZ5xKr8XPIXx5IU7AIX4=; b=n/zNqiieth8XEUcAmKgidYE+90SJeAfSSUV+UiDD+d32eFCjNFwyV2wHGYNxk4S0lq Mcnz7l4N+g4ix8pHeutbpuaT7fhmdNUmphs2aiqm4bXIv1sk/TYCLdlCjvc/GIDSiNMR +p4s0AVeK72ZcfjZQZyPPWIW2PTqJ9tGT0gTbB0rGESNRH7vKjGdzN9fqTyzvd/r0P1b mhPlQQMAy1U93CzrOkeKYc4/uBn+ylDuivdiCbNyL74BI/cdzbUsSuuGLawCG6KQpMwW z8QCyoydAa5LIi/aQanC74dvXUkG0TJ3ThT3knJVokTTxLkVccJ8PUbxCg7Abp1FDKh7 4teA== X-Gm-Message-State: AOJu0YzhJAkMy2y38EVNlcG2dBOE77lnbIrSSAb5YoNrf/QLvMh7vu/4 xaaAuW6ptKbtAPsUvhrUOvPxl8b3OBRLOtHRMRA5brSOMSoFVeiv4dzqUWO94OcuVjyOsGkx4nk C0g5W/RefULeUsm5ckER0wqkbbsDIC3uVZGovhQWdxrJ8BqyhLqcFoKGZlZozKJtMG2sarl3adX o= X-Gm-Gg: ATEYQzxHq06Gp64ZweUqMdVAYZF2xew1QaT0jtw7N9C2xouTGpXnYcVlC0eqPauUt5i JRU0W1kBjFOck99/R3D/64nfc/+1HZuenQN13YDGlWqpkI+j7iwWoIdKeqT03chF9I80wU+a80R lLA2LQqade9MBtrbjQFjPfmpnmsbN1yErYxzw/SVN9d+IeRV0rVy/Cyt/aT5ApkL+CM471sob1u sSkuFKqD4n2DJY2+KvE2jxsQi7/wmRBLIapyMC+BDFfPxS6Ow6+0gn8dzWqOKYpIhgonu7EbSuH jHov5Dsx8liNHDwoadfYSTi7y6ANaPixaCNZaTiCzIdCjEmvTsNlPDmlp0WJEW4bRqTlWXyCtTx pOxrJn1n+7aYFXDgla9yJXqoxFJNWRpqyhEmK X-Received: by 2002:a05:620a:1706:b0:893:2ba8:eec8 with SMTP id af79cd13be357-8cdb5bfbac2mr127226985a.79.1773343574196; Thu, 12 Mar 2026 12:26:14 -0700 (PDT) X-Received: by 2002:a05:620a:1706:b0:893:2ba8:eec8 with SMTP id af79cd13be357-8cdb5bfbac2mr127224385a.79.1773343573735; Thu, 12 Mar 2026 12:26:13 -0700 (PDT) Received: from quoll ([178.197.219.94]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439fe1abf84sm10323257f8f.14.2026.03.12.12.26.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2026 12:26:12 -0700 (PDT) From: Krzysztof Kozlowski To: Tom Rini , u-boot@lists.denx.de Cc: linux-kernel@vger.kernel.org, Krzysztof Kozlowski Subject: [PATCH RFT] pci: imx: Properly support upstream Linux reset-gpios property Date: Thu, 12 Mar 2026 20:26:05 +0100 Message-ID: <20260312192605.131132-1-krzysztof.kozlowski@oss.qualcomm.com> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: NzrEAWxNJF-QWF5XD4nRMCa2I154J73o X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzEyMDE1NyBTYWx0ZWRfX62QHZjL3r0b1 qF8S6IN4Swq76J2QG+FMCccfvx9PG3b1Cy8xahMLB/Wy86cs+WuWrqgIwy4G9gZqwEfVHwgkqOy ZjIc7S0lW9jW2PY9HDz2/4ES5aRwJRxZfWPO6/UBsviuCASpKCE955pKwVhVZEv9qHcjFMD+n5H pxMw9jz7Xrosrfv/Uyq2xRTZHGkYzWO7kJ8N+HKCsRj5BX973JJgzj+ikCfO5OsNnS6a+A0l61q jr+jNjudKKwKdhznLfBQhYQ+fxiIgucpNCmlNVURcnfNRJU2TuJHvjuMusyqMF0Me6Ld0YzOYTk s3TDmcdH8FIcoa+l7KFHXtqF8cFzqdUcyru0oeRlaUo4bAbSKjdg8VQST/HNDY7SpqQUkRzbG9s oD8y+GLMngVL4sn8Qw7I82laAJw3mu4FqDiSWjdNr5rwm4EHIhtKpg61rH2sjo4x+anoNrKpbeA JMfidknNFIyyD+y/tDQ== X-Authority-Analysis: v=2.4 cv=YucChoYX c=1 sm=1 tr=0 ts=69b31357 cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=gOEeR9iKwsj33Yj5oN/cWg==:17 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=ey_WZIOhSlKW_4Ed53gA:9 a=a_PwQJl-kcHnX1M80qC6:22 X-Proofpoint-GUID: NzrEAWxNJF-QWF5XD4nRMCa2I154J73o 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-03-12_02,2026-03-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 phishscore=0 clxscore=1015 priorityscore=1501 adultscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603120157 Content-Type: text/plain; charset="utf-8" The driver requests explicitly "reset-gpio" property, not the one with "gpios" suffix but upstream Linux kernel deprecated it in 2021. Existing upstream Linux kernel DTS is being changed to "reset-gpios" property, thus update the driver to read that one too. Note that driver is probably broken already, because it parsed GPIO in standard way respecting the flags and on top of that applied the "reset-gpio-active-high" flag, thus "reset-gpio ACTIVE_LOW" with the "reset-gpio-active-high" property would be double inverted. Signed-off-by: Krzysztof Kozlowski --- 1. https://lore.kernel.org/linux-devicetree/20260312-dts-snps-reset-gpios-v= 2-12-0d5040eb4a1e@oss.qualcomm.com/ 2. See Linux kernel commit 42694f9f6407 ("dt-bindings: PCI: add snps,dw-pci= e.yaml") --- drivers/pci/pcie_imx.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/pci/pcie_imx.c b/drivers/pci/pcie_imx.c index 11c4ccbfc555..8d853ecf2c22 100644 --- a/drivers/pci/pcie_imx.c +++ b/drivers/pci/pcie_imx.c @@ -728,15 +728,31 @@ static int imx_pcie_dm_write_config(struct udevice *d= ev, pci_dev_t bdf, static int imx_pcie_dm_probe(struct udevice *dev) { struct imx_pcie_priv *priv =3D dev_get_priv(dev); + int ret; =20 #if CONFIG_IS_ENABLED(DM_REGULATOR) device_get_supply_regulator(dev, "vpcie-supply", &priv->vpcie); #endif =20 /* if PERST# valid from dt then assert it */ - gpio_request_by_name(dev, "reset-gpio", 0, &priv->reset_gpio, - GPIOD_IS_OUT); - priv->reset_active_high =3D dev_read_bool(dev, "reset-gpio-active-high"); + ret =3D gpio_request_by_name(dev, "reset-gpio", 0, &priv->reset_gpio, + GPIOD_IS_OUT); + if (!ret) { + /* + * Legacy property, invert assert logic based on + * reset-gpio-active-high. This won't work if flags are not + * matching the reset-gpio-active-high. + */ + priv->reset_active_high =3D dev_read_bool(dev, "reset-gpio-active-high"); + } else { + /* + * Linux kernel upstream property, assert active level based on + * GPIO flags, thus leave priv->reset_active_high=3D0. + */ + gpio_request_by_name(dev, "reset-gpios", 0, &priv->reset_gpio, + GPIOD_IS_OUT); + } + if (dm_gpio_is_valid(&priv->reset_gpio)) { dm_gpio_set_value(&priv->reset_gpio, priv->reset_active_high ? 0 : 1); --=20 2.51.0