Skip to content

Commit 31b0810

Browse files
Ricky Wugregkh
authored andcommitted
misc: rtsx: init value of aspm_enabled
make sure ASPM state sync with pcr->aspm_enabled init value pcr->aspm_enabled Cc: [email protected] Signed-off-by: Ricky Wu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Fixes: d928061 ("misc: rtsx: modify en/disable aspm function") Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b11f623 commit 31b0810

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/misc/cardreader/rtsx_pcr.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,7 @@ static int rtsx_pci_probe(struct pci_dev *pcidev,
15121512
struct pcr_handle *handle;
15131513
u32 base, len;
15141514
int ret, i, bar = 0;
1515+
u8 val;
15151516

15161517
dev_dbg(&(pcidev->dev),
15171518
": Realtek PCI-E Card Reader found at %s [%04x:%04x] (rev %x)\n",
@@ -1577,7 +1578,11 @@ static int rtsx_pci_probe(struct pci_dev *pcidev,
15771578
pcr->host_cmds_addr = pcr->rtsx_resv_buf_addr;
15781579
pcr->host_sg_tbl_ptr = pcr->rtsx_resv_buf + HOST_CMDS_BUF_LEN;
15791580
pcr->host_sg_tbl_addr = pcr->rtsx_resv_buf_addr + HOST_CMDS_BUF_LEN;
1580-
1581+
rtsx_pci_read_register(pcr, ASPM_FORCE_CTL, &val);
1582+
if (val & FORCE_ASPM_CTL0 && val & FORCE_ASPM_CTL1)
1583+
pcr->aspm_enabled = false;
1584+
else
1585+
pcr->aspm_enabled = true;
15811586
pcr->card_inserted = 0;
15821587
pcr->card_removed = 0;
15831588
INIT_DELAYED_WORK(&pcr->carddet_work, rtsx_pci_card_detect);

0 commit comments

Comments
 (0)