[PATCH] PCI: dwc: meson: Fix reset GPIO initial state

Ronald Claveau via B4 Relay <[email protected]>
Newsgroups org.infradead.lists.linux-amlogic,org.infradead.lists.linux-arm-kernel,org.kernel.feeds.b4-sent,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci
Message-ID <[email protected]>
From: Ronald Claveau <[email protected]>

Commit 4d3186a525b3 ("PCI: amlogic: Fix reset assertion via gpio
descriptor") inverted the reset assertion logic to use proper gpio
descriptor semantics, and moved the polarity configuration to the
device tree as GPIO_ACTIVE_LOW. However, the initial GPIO state
"GPIOD_OUT_LOW" was not updated accordingly.

Change GPIOD_OUT_LOW to GPIOD_OUT_HIGH to get the right behaviour.

With GPIOD_OUT_LOW:

    ahci 0000:01:00.0: enabling device (0000 -> 0002)
    ahci 0000:01:00.0: SSS flag set, parallel bus scan disabled
    ahci 0000:01:00.0: Controller reset failed (0xffffffff)
    ahci 0000:01:00.0: probe with driver ahci failed with error -5

With this fix:

    ahci 0000:01:00.0: enabling device (0000 -> 0002)
    ahci 0000:01:00.0: AHCI vers 0001.0300, 32 command slots, 6 Gbps,
                       SATA mode
    ahci 0000:01:00.0: 1/1 ports implemented (port mask 0x1)
    ahci 0000:01:00.0: flags: 64bit ncq led clo only pio ccc

Fixes: 4d3186a525b3 ("PCI: amlogic: Fix reset assertion via gpio descriptor")
Signed-off-by: Ronald Claveau <[email protected]>
---
 drivers/pci/controller/dwc/pci-meson.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
index 0694084f612b7..15ed59b8764fb 100644
--- a/drivers/pci/controller/dwc/pci-meson.c
+++ b/drivers/pci/controller/dwc/pci-meson.c
@@ -400,7 +400,7 @@ static int meson_pcie_probe(struct platform_device *pdev)
 		return PTR_ERR(mp->phy);
 	}
 
-	mp->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
+	mp->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
 	if (IS_ERR(mp->reset_gpio)) {
 		dev_err(dev, "get reset gpio failed\n");
 		return PTR_ERR(mp->reset_gpio);

---
base-commit: abe651837cb394f76d738a7a747322fca3bf17ba
change-id: 20260616-fix-meson-pcie-reset-gpio-2b9e188668c5

Best regards,
-- 
Ronald Claveau <[email protected]>



_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.