Skip to content

Commit 1902a01

Browse files
khfenggregkh
authored andcommitted
USB: storage: ums-realtek: Whitelist auto-delink support
Auto-delink requires writing special registers to ums-realtek devices. Unconditionally enable auto-delink may break newer devices. So only enable auto-delink by default for the original three IDs, 0x0138, 0x0158 and 0x0159. Realtek is working on a patch to properly support auto-delink for other IDs. BugLink: https://bugs.launchpad.net/bugs/1838886 Signed-off-by: Kai-Heng Feng <[email protected]> Acked-by: Alan Stern <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f6445b6 commit 1902a01

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

drivers/usb/storage/realtek_cr.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -996,12 +996,15 @@ static int init_realtek_cr(struct us_data *us)
996996
goto INIT_FAIL;
997997
}
998998

999-
if (CHECK_FW_VER(chip, 0x5888) || CHECK_FW_VER(chip, 0x5889) ||
1000-
CHECK_FW_VER(chip, 0x5901))
1001-
SET_AUTO_DELINK(chip);
1002-
if (STATUS_LEN(chip) == 16) {
1003-
if (SUPPORT_AUTO_DELINK(chip))
999+
if (CHECK_PID(chip, 0x0138) || CHECK_PID(chip, 0x0158) ||
1000+
CHECK_PID(chip, 0x0159)) {
1001+
if (CHECK_FW_VER(chip, 0x5888) || CHECK_FW_VER(chip, 0x5889) ||
1002+
CHECK_FW_VER(chip, 0x5901))
10041003
SET_AUTO_DELINK(chip);
1004+
if (STATUS_LEN(chip) == 16) {
1005+
if (SUPPORT_AUTO_DELINK(chip))
1006+
SET_AUTO_DELINK(chip);
1007+
}
10051008
}
10061009
#ifdef CONFIG_REALTEK_AUTOPM
10071010
if (ss_en)

0 commit comments

Comments
 (0)