Merge 93a56dbe12 ("drivers/card_reader/rtsx_usb: Restore interrupt based detection") into android14-6.1-lts

Steps on the way to 6.1.129

Resolves merge conflicts in:
	drivers/usb/host/xhci-ring.c

Change-Id: Ie123285eab89802392003b95ec495b21820ad41b
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2025-03-07 08:31:24 +00:00

View File

@@ -286,6 +286,7 @@ static int rtsx_usb_get_status_with_bulk(struct rtsx_ucr *ucr, u16 *status)
int rtsx_usb_get_card_status(struct rtsx_ucr *ucr, u16 *status)
{
int ret;
u8 interrupt_val = 0;
u16 *buf;
if (!status)
@@ -308,6 +309,20 @@ int rtsx_usb_get_card_status(struct rtsx_ucr *ucr, u16 *status)
ret = rtsx_usb_get_status_with_bulk(ucr, status);
}
rtsx_usb_read_register(ucr, CARD_INT_PEND, &interrupt_val);
/* Cross check presence with interrupts */
if (*status & XD_CD)
if (!(interrupt_val & XD_INT))
*status &= ~XD_CD;
if (*status & SD_CD)
if (!(interrupt_val & SD_INT))
*status &= ~SD_CD;
if (*status & MS_CD)
if (!(interrupt_val & MS_INT))
*status &= ~MS_CD;
/* usb_control_msg may return positive when success */
if (ret < 0)
return ret;