Skip to contentSkip to conversation

misc: rtsx: do clear express reg every SD_INT

PATCH New Ricky Wu 1 participant 1 message Apr 30, 2024 Char and misc drivers

lore
Share & tools
lore

Ricky Wu

author
#0 lore raw

PATCH 1/1 misc: rtsx: do clear express reg every SD_INT

orginal only do clear EXPRESS_LINK_FAIL reg when card removed, this patch moved the flow to SD_INT statement, make sure the reg status is correct when inserted/removed card every time.

---
 drivers/misc/cardreader/rtsx_pcr.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/misc/cardreader/rtsx_pcr.c +7 -5
index 0ad2ff9065aa..117b3c24f910 100644
@@ -1002,12 +1002,14 @@ static irqreturn_t rtsx_pci_isr(int irq, void *dev_id)
 		} else {
 			pcr->card_removed |= SD_EXIST;
 			pcr->card_inserted &= ~SD_EXIST;
-			if ((PCI_PID(pcr) == PID_5261) || (PCI_PID(pcr) == PID_5264)) {
-				rtsx_pci_write_register(pcr, RTS5261_FW_STATUS,
-					RTS5261_EXPRESS_LINK_FAIL_MASK, 0);
-				pcr->extra_caps |= EXTRA_CAPS_SD_EXPRESS;
-			}
 		}
+
+		if ((PCI_PID(pcr) == PID_5261) || (PCI_PID(pcr) == PID_5264)) {
+			rtsx_pci_write_register(pcr, RTS5261_FW_STATUS,
+				RTS5261_EXPRESS_LINK_FAIL_MASK, 0);
+			pcr->extra_caps |= EXTRA_CAPS_SD_EXPRESS;
+		}
+
 		pcr->dma_error_count = 0;
 	}
 
Signature · 1 line
2.25.1