Skip to contentSkip to conversation

misc: rtsx: init value of aspm_enabled

PATCH In review [email protected] 1 participant 2 messages Jan 21, 2021 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 misc: rtsx: init value of aspm_enabled

From: Ricky Wu <[email protected]>

make sure ASPM state sync with pcr->aspm_enabled
init value pcr->aspm_enabled

---
 drivers/misc/cardreader/rtsx_pcr.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/misc/cardreader/rtsx_pcr.c +6 -1
index 2aa6648fa41f..06df0687c0bb 100644
@@ -1512,6 +1512,7 @@ static int rtsx_pci_probe(struct pci_dev *pcidev,
 	struct pcr_handle *handle;
 	u32 base, len;
 	int ret, i, bar = 0;
+	u8 val;
 
 	dev_dbg(&(pcidev->dev),
 		": 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,
 	pcr->host_cmds_addr = pcr->rtsx_resv_buf_addr;
 	pcr->host_sg_tbl_ptr = pcr->rtsx_resv_buf + HOST_CMDS_BUF_LEN;
 	pcr->host_sg_tbl_addr = pcr->rtsx_resv_buf_addr + HOST_CMDS_BUF_LEN;
-
+	rtsx_pci_read_register(pcr, ASPM_FORCE_CTL, &val);
+	if (val & FORCE_ASPM_CTL0 || val & FORCE_ASPM_CTL1)
+		pcr->aspm_enabled = true;
+	else
+		pcr->aspm_enabled = false;
 	pcr->card_inserted = 0;
 	pcr->card_removed = 0;
 	INIT_DELAYED_WORK(&pcr->carddet_work, rtsx_pci_card_detect);
Signature · 1 line
2.17.1
#1 lore raw

Abandon this patch
Sorry~

Quoted 47 lines

-----Original Message-----
From: 吳昊澄 Ricky <[email protected]>
Sent: Thursday, January 21, 2021 6:16 PM
To: [email protected]; [email protected]; [email protected]; 吳 昊澄 Ricky <[email protected]>; [email protected]; [email protected]
Subject: [PATCH] misc: rtsx: init value of aspm_enabled

From: Ricky Wu <[email protected]>

make sure ASPM state sync with pcr->aspm_enabled init value pcr->aspm_enabled

---
 drivers/misc/cardreader/rtsx_pcr.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/misc/cardreader/rtsx_pcr.c +6 -1
index 2aa6648fa41f..06df0687c0bb 100644
@@ -1512,6 +1512,7 @@ static int rtsx_pci_probe(struct pci_dev *pcidev,
 	struct pcr_handle *handle;
 	u32 base, len;
 	int ret, i, bar = 0;
+	u8 val;
 
 	dev_dbg(&(pcidev->dev),
 		": 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,
 	pcr->host_cmds_addr = pcr->rtsx_resv_buf_addr;
 	pcr->host_sg_tbl_ptr = pcr->rtsx_resv_buf + HOST_CMDS_BUF_LEN;
 	pcr->host_sg_tbl_addr = pcr->rtsx_resv_buf_addr +
 HOST_CMDS_BUF_LEN;
-
+	rtsx_pci_read_register(pcr, ASPM_FORCE_CTL, &val);
+	if (val & FORCE_ASPM_CTL0 || val & FORCE_ASPM_CTL1)
+		pcr->aspm_enabled = true;
+	else
+		pcr->aspm_enabled = false;
 	pcr->card_inserted = 0;
 	pcr->card_removed = 0;

INIT_DELAYED_WORK(&pcr->carddet_work, rtsx_pci_card_detect);
--
2.17.1