Skip to content

Commit

Permalink
misc: rtsx: modify and fix init_hw function
Browse files Browse the repository at this point in the history
changed rtsx_pci_disable_aspm() to rtsx_disable_aspm()
do not access ASPM configuration directly

changed pcie_capability_write_word() to _clear_and_set_word()
make sure only change PCI_EXP_LNKCTL bit8

make sure ASPM disable after extra_init_hw()

Signed-off-by: Ricky Wu <ricky_wu@realtek.com>
Link: https://lore.kernel.org/r/20201202063228.18319-1-ricky_wu@realtek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Ricky Wu authored and gregkh committed Dec 9, 2020
1 parent d928061 commit 121e9c6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/misc/cardreader/rtsx_pcr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ static int rtsx_pci_init_hw(struct rtsx_pcr *pcr)
/* Wait SSC power stable */
udelay(200);

rtsx_pci_disable_aspm(pcr);
rtsx_disable_aspm(pcr);
if (pcr->ops->optimize_phy) {
err = pcr->ops->optimize_phy(pcr);
if (err < 0)
Expand Down Expand Up @@ -1363,8 +1363,8 @@ static int rtsx_pci_init_hw(struct rtsx_pcr *pcr)
rtsx_pci_init_ocp(pcr);

/* Enable clk_request_n to enable clock power management */
pcie_capability_write_word(pdev, PCI_EXP_LNKCTL,
PCI_EXP_LNKCTL_CLKREQ_EN);
pcie_capability_clear_and_set_word(pcr->pci, PCI_EXP_LNKCTL,
0, PCI_EXP_LNKCTL_CLKREQ_EN);
/* Enter L1 when host tx idle */
pci_write_config_byte(pdev, 0x70F, 0x5B);

Expand All @@ -1374,6 +1374,8 @@ static int rtsx_pci_init_hw(struct rtsx_pcr *pcr)
return err;
}

rtsx_pci_write_register(pcr, ASPM_FORCE_CTL, 0x30, 0x30);

/* No CD interrupt if probing driver with card inserted.
* So we need to initialize pcr->card_exist here.
*/
Expand Down

0 comments on commit 121e9c6

Please sign in to comment.