Skip to content

Commit d713379

Browse files
Victor Shihstorulf
authored andcommitted
mmc: sdhci-pci-gli: A workaround to allow GL9750 to enter ASPM L1.2
When GL9750 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 GL9750 to enter ASPM L1.2. Signed-off-by: Victor Shih <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 3b7eee6 commit d713379

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/mmc/host/sdhci-pci-gli.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
#define GLI_9750_WT_EN_ON 0x1
2626
#define GLI_9750_WT_EN_OFF 0x0
2727

28+
#define PCI_GLI_9750_PM_CTRL 0xFC
29+
#define PCI_GLI_9750_PM_STATE GENMASK(1, 0)
30+
2831
#define SDHCI_GLI_9750_CFG2 0x848
2932
#define SDHCI_GLI_9750_CFG2_L1DLY GENMASK(28, 24)
3033
#define GLI_9750_CFG2_L1DLY_VALUE 0x1F
@@ -536,8 +539,12 @@ static void sdhci_gl9750_set_clock(struct sdhci_host *host, unsigned int clock)
536539

537540
static void gl9750_hw_setting(struct sdhci_host *host)
538541
{
542+
struct sdhci_pci_slot *slot = sdhci_priv(host);
543+
struct pci_dev *pdev;
539544
u32 value;
540545

546+
pdev = slot->chip->pdev;
547+
541548
gl9750_wt_on(host);
542549

543550
value = sdhci_readl(host, SDHCI_GLI_9750_CFG2);
@@ -547,6 +554,13 @@ static void gl9750_hw_setting(struct sdhci_host *host)
547554
GLI_9750_CFG2_L1DLY_VALUE);
548555
sdhci_writel(host, value, SDHCI_GLI_9750_CFG2);
549556

557+
/* toggle PM state to allow GL9750 to enter ASPM L1.2 */
558+
pci_read_config_dword(pdev, PCI_GLI_9750_PM_CTRL, &value);
559+
value |= PCI_GLI_9750_PM_STATE;
560+
pci_write_config_dword(pdev, PCI_GLI_9750_PM_CTRL, value);
561+
value &= ~PCI_GLI_9750_PM_STATE;
562+
pci_write_config_dword(pdev, PCI_GLI_9750_PM_CTRL, value);
563+
550564
gl9750_wt_off(host);
551565
}
552566

0 commit comments

Comments
 (0)