Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Ricky Wu <ricky_wu@realtek.com>
Link: https://lore.kernel.org/r/20240430060108.580685-1-ricky_wu@realtek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ricky Wu and committed by
Greg Kroah-Hartman
82fecafe bd860309

+7 -5
+7 -5
drivers/misc/cardreader/rtsx_pcr.c
··· 1002 1002 } else { 1003 1003 pcr->card_removed |= SD_EXIST; 1004 1004 pcr->card_inserted &= ~SD_EXIST; 1005 - if ((PCI_PID(pcr) == PID_5261) || (PCI_PID(pcr) == PID_5264)) { 1006 - rtsx_pci_write_register(pcr, RTS5261_FW_STATUS, 1007 - RTS5261_EXPRESS_LINK_FAIL_MASK, 0); 1008 - pcr->extra_caps |= EXTRA_CAPS_SD_EXPRESS; 1009 - } 1010 1005 } 1006 + 1007 + if ((PCI_PID(pcr) == PID_5261) || (PCI_PID(pcr) == PID_5264)) { 1008 + rtsx_pci_write_register(pcr, RTS5261_FW_STATUS, 1009 + RTS5261_EXPRESS_LINK_FAIL_MASK, 0); 1010 + pcr->extra_caps |= EXTRA_CAPS_SD_EXPRESS; 1011 + } 1012 + 1011 1013 pcr->dma_error_count = 0; 1012 1014 } 1013 1015