From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from www537.your-server.de (www537.your-server.de [188.40.3.216]) (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 1A77E13A3ED for ; Fri, 13 Mar 2026 08:12:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=188.40.3.216 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773389564; cv=none; b=FM3dwG98W4VSL3AOtMaE1wQYjRFycFmoW25jHZgLksSwh15kWJhx2dsYPqaKwLDQ0+kQ5w+IrcxlDmkxIayAADW4sRhQjckk0JFg6FCvCSkps92ve57/VK0d4q+lbWBNiO77jc+/rp71B0G9c09XpoBwKO1M7pZRMCGvg/VhIzs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773389564; c=relaxed/simple; bh=8YS+ovrHxa9503QrS5jgmdKqO0qEwG0kmpNqnGi8lEY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=sJOmVkTiS3TzfbhKlrLBOJFZUJ9zgTaXNLAc78+/6V9u276e+sgy4KSZOO3O3dYj6yXt8gdxFUB3AWyG5LqvtfJdgNmQ4q32a36pJW+FzatlqV/sYG0aHv6Q57p3d63KpZabtBwDk3XePeSJEzVqVtED2r6QP6g4byXmUxObeg8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=CVjbEnrk; arc=none smtp.client-ip=188.40.3.216 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="CVjbEnrk" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ew.tq-group.com; s=default2602; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=bzFCcaQeVRH/JLP5q7SDI1tdKQkk+kVDOvKGPONFXgE=; b=CVjbEnrkpJQcBcRFSb7d9XvB0p 9C/Yeh7aa6Xz95SfUkRINXspeaCN2WLCcJuZ0sADmoG0c4AgBcPGfw8SnRUd9EBfvOCvWjtKMdxSv lcFV9Evasrpq80H6ppHUvAwKkHhuEPmEiipHLjQ8jusI5Sc1CtKpJpppNTuitFMEcqxyzB0s5VdpT P/tqBQspDzqGoxsO/blu99mJSmyaR6ejhXfvTKMCQxXaHFt0BoeBeVSe5zzxlFquU7EyS+D03PpK/ idp2JwiNE5R62Nvu50ZghuiUKpemI9kYdNaXaQq9OkKz7uCh19OB4S7v2jd8dgIX1s2YoNlSzwG8j e6ay+YBg==; Received: from sslproxy03.your-server.de ([88.198.220.132]) by www537.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1w0xdP-000Pl9-0v; Fri, 13 Mar 2026 09:12:39 +0100 Received: from localhost ([127.0.0.1]) by sslproxy03.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w0xdP-00016K-08; Fri, 13 Mar 2026 09:12:39 +0100 Message-ID: <9e8aa4e7-72ab-4b1a-b324-4c78b13b9741@ew.tq-group.com> Date: Fri, 13 Mar 2026 09:12:38 +0100 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 RFT] pci: imx: Properly support upstream Linux reset-gpios property To: Krzysztof Kozlowski , Tom Rini , u-boot@lists.denx.de Cc: linux-kernel@vger.kernel.org References: <20260312192605.131132-1-krzysztof.kozlowski@oss.qualcomm.com> Content-Language: en-US From: Max Merchel In-Reply-To: <20260312192605.131132-1-krzysztof.kozlowski@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Clear (ClamAV 1.4.3/27939/Fri Mar 13 07:24:42 2026) On 3/12/26 20:26, Krzysztof Kozlowski wrote: > 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-v2-12-0d5040eb4a1e@oss.qualcomm.com/ > 2. See Linux kernel commit 42694f9f6407 ("dt-bindings: PCI: add snps,dw-pcie.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 *dev, pci_dev_t bdf, > static int imx_pcie_dm_probe(struct udevice *dev) > { > struct imx_pcie_priv *priv = dev_get_priv(dev); > + int ret; > > #if CONFIG_IS_ENABLED(DM_REGULATOR) > device_get_supply_regulator(dev, "vpcie-supply", &priv->vpcie); > #endif > > /* 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 = dev_read_bool(dev, "reset-gpio-active-high"); > + ret = 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 = dev_read_bool(dev, "reset-gpio-active-high"); A warning should also be issued when using the deprecated "reset-gpio" property.             dev_warn(dev, "reset-gpio property deprecated, use reset-gpios\n"); > + } else { > + /* > + * Linux kernel upstream property, assert active level based on > + * GPIO flags, thus leave priv->reset_active_high=0. > + */ > + 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); -- Best regards, Max TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany Amtsgericht München, HRB 105018 Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider http://www.tq-group.com/