* [PATCH v2 2/4] misc: rtsx: modify and fix init_hw function
@ 2020-12-02 6:32 ricky_wu
0 siblings, 0 replies; only message in thread
From: ricky_wu @ 2020-12-02 6:32 UTC (permalink / raw)
To: arnd, gregkh, bhelgaas, ricky_wu, vaibhavgupta40, kdlnx, linux-kernel
From: Ricky Wu <ricky_wu@realtek.com>
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>
---
drivers/misc/cardreader/rtsx_pcr.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/misc/cardreader/rtsx_pcr.c b/drivers/misc/cardreader/rtsx_pcr.c
index c87f791bdcb5..3612063cab09 100644
--- a/drivers/misc/cardreader/rtsx_pcr.c
+++ b/drivers/misc/cardreader/rtsx_pcr.c
@@ -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)
@@ -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);
@@ -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.
*/
--
2.17.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-12-02 6:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-02 6:32 [PATCH v2 2/4] misc: rtsx: modify and fix init_hw function ricky_wu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.