Skip to contentSkip to conversation

mmc: sdhci-pci-gli: A workaround to allow GL9755 to enter ASPM L1.2

PATCH RESEND In review Ben Chuang 3 participants 4 messages Apr 14, 2022 – Apr 25, 2022

Subsystems (2)
lore
Share & tools
lore

Ben Chuang

author
#0 lore raw

PATCH RESEND 1/1 mmc: sdhci-pci-gli: A workaround to allow GL9755 to enter ASPM L1.2

From: Ben Chuang <[email protected]>

When GL9755 enters ASPM L1 sub-states, it will stay at L1.1 and will not enter L1.2. The workaround is to toggle PM state to allow GL9755 to enter ASPM L1.2.

---
 drivers/mmc/host/sdhci-pci-gli.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/mmc/host/sdhci-pci-gli.c +10 -0
index 97035d77c18c..52230857388f 100644
@@ -137,6 +137,9 @@
 #define PCI_GLI_9755_SerDes  0x70
 #define PCI_GLI_9755_SCP_DIS   BIT(19)
 
+#define PCI_GLI_9755_PM_CTRL     0xFC
+#define   PCI_GLI_9755_PM_STATE    GENMASK(1, 0)
+
 #define GLI_MAX_TUNING_LOOP 40
 
 /* Genesys Logic chipset */
@@ -597,6 +600,13 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot)
 			    GLI_9755_CFG2_L1DLY_VALUE);
 	pci_write_config_dword(pdev, PCI_GLI_9755_CFG2, value);
 
+	/* toggle PM state to allow GL9755 to enter ASPM L1.2 */
+	pci_read_config_dword(pdev, PCI_GLI_9755_PM_CTRL, &value);
+	value |= PCI_GLI_9755_PM_STATE;
+	pci_write_config_dword(pdev, PCI_GLI_9755_PM_CTRL, value);
+	value &= ~PCI_GLI_9755_PM_STATE;
+	pci_write_config_dword(pdev, PCI_GLI_9755_PM_CTRL, value);
+
 	gl9755_wt_off(pdev);
 }
 
Signature · 1 line
2.35.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Ben Chuang

From: Ben Chuang <[email protected]>

When GL9755 enters ASPM L1 sub-states, it will stay at L1.1 and will not enter L1.2. The workaround is to toggle PM state to allow GL9755 to enter ASPM L1.2.

Quoted 32 lines
---
 drivers/mmc/host/sdhci-pci-gli.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/mmc/host/sdhci-pci-gli.c +10 -0
index 97035d77c18c..52230857388f 100644
@@ -137,6 +137,9 @@
 #define PCI_GLI_9755_SerDes  0x70
 #define PCI_GLI_9755_SCP_DIS   BIT(19)
 
+#define PCI_GLI_9755_PM_CTRL     0xFC
+#define   PCI_GLI_9755_PM_STATE    GENMASK(1, 0)
+
 #define GLI_MAX_TUNING_LOOP 40
 
 /* Genesys Logic chipset */
@@ -597,6 +600,13 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot)
 			    GLI_9755_CFG2_L1DLY_VALUE);
 	pci_write_config_dword(pdev, PCI_GLI_9755_CFG2, value);
 
+	/* toggle PM state to allow GL9755 to enter ASPM L1.2 */
+	pci_read_config_dword(pdev, PCI_GLI_9755_PM_CTRL, &value);
+	value |= PCI_GLI_9755_PM_STATE;
+	pci_write_config_dword(pdev, PCI_GLI_9755_PM_CTRL, value);
+	value &= ~PCI_GLI_9755_PM_STATE;
+	pci_write_config_dword(pdev, PCI_GLI_9755_PM_CTRL, value);
+
 	gl9755_wt_off(pdev);
 }
 
#2 lore raw
In reply to Ben Chuang
Quoted 8 lines · Ben Chuang

From: Ben Chuang <[email protected]>

When GL9755 enters ASPM L1 sub-states, it will stay at L1.1 and will not enter L1.2. The workaround is to toggle PM state to allow GL9755 to enter ASPM L1.2.

This didn't apply cleanly, I fixed it up this time. So, applied for next, thanks!

Kind regards
Uffe

Quoted 35 lines
---
 drivers/mmc/host/sdhci-pci-gli.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/mmc/host/sdhci-pci-gli.c +10 -1
index 97035d77c18c..52230857388f 100644
@@ -137,6 +137,9 @@
 #define PCI_GLI_9755_SerDes  0x70
 #define PCI_GLI_9755_SCP_DIS   BIT(19)
 
+#define PCI_GLI_9755_PM_CTRL     0xFC
+#define   PCI_GLI_9755_PM_STATE    GENMASK(1, 0)
+
 #define GLI_MAX_TUNING_LOOP 40
 
 /* Genesys Logic chipset */
@@ -597,6 +600,13 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot)
                            GLI_9755_CFG2_L1DLY_VALUE);
        pci_write_config_dword(pdev, PCI_GLI_9755_CFG2, value);
 
+       /* toggle PM state to allow GL9755 to enter ASPM L1.2 */
+       pci_read_config_dword(pdev, PCI_GLI_9755_PM_CTRL, &value);
+       value |= PCI_GLI_9755_PM_STATE;
+       pci_write_config_dword(pdev, PCI_GLI_9755_PM_CTRL, value);
+       value &= ~PCI_GLI_9755_PM_STATE;
+       pci_write_config_dword(pdev, PCI_GLI_9755_PM_CTRL, value);
+
        gl9755_wt_off(pdev);
 }
 
--

2.35.1

author
#3 lore raw
Quoted 9 lines · Ulf Hansson
Quoted 7 lines · Ben Chuang

From: Ben Chuang <[email protected]>

When GL9755 enters ASPM L1 sub-states, it will stay at L1.1 and will not enter L1.2. The workaround is to toggle PM state to allow GL9755 to enter ASPM L1.2.

Quoted 7 lines
Quoted 1 line

This didn't apply cleanly, I fixed it up this time. So, applied for next, thanks!

Kind regards
Uffe

I forgot to rebase to v5.18rc. I will pay more attention next time. Thank you.

Best regards,
Ben

Quoted 37 lines
Quoted 37 lines

---
 drivers/mmc/host/sdhci-pci-gli.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/mmc/host/sdhci-pci-gli.c +10 -1
index 97035d77c18c..52230857388f 100644
@@ -137,6 +137,9 @@
 #define PCI_GLI_9755_SerDes  0x70
 #define PCI_GLI_9755_SCP_DIS   BIT(19)
 
+#define PCI_GLI_9755_PM_CTRL     0xFC
+#define   PCI_GLI_9755_PM_STATE    GENMASK(1, 0)
+
 #define GLI_MAX_TUNING_LOOP 40
 
 /* Genesys Logic chipset */
@@ -597,6 +600,13 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot)
                            GLI_9755_CFG2_L1DLY_VALUE);
        pci_write_config_dword(pdev, PCI_GLI_9755_CFG2, value);
 
+       /* toggle PM state to allow GL9755 to enter ASPM L1.2 */
+       pci_read_config_dword(pdev, PCI_GLI_9755_PM_CTRL, &value);
+       value |= PCI_GLI_9755_PM_STATE;
+       pci_write_config_dword(pdev, PCI_GLI_9755_PM_CTRL, value);
+       value &= ~PCI_GLI_9755_PM_STATE;
+       pci_write_config_dword(pdev, PCI_GLI_9755_PM_CTRL, value);
+
        gl9755_wt_off(pdev);
 }
 
--

2.35.1