[SRU] [B/D/E/Unstable] [PATCH 0/2] Fix auto-delink on new ums-realtek devices

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU] [B/D/E/Unstable] [PATCH 0/2] Fix auto-delink on new ums-realtek devices

Kai-Heng Feng
BugLink: https://bugs.launchpad.net/bugs/1838886

[Impact]
Some ums-realtek card readers may dropped from USB bus after using
ums-realtek driver instead of usb-storage generic driver.

[Fix]
Disable auto-delink on new ums-realtek devices, only whitelist three
oldest IDs.

[Test]
Affected user and myself confirmed disabling auto-delink works.

[Regression Potential]
Minimal. Limited to one specific driver and this also restore the old
behavior.

Kai-Heng Feng (2):
  USB: storage: ums-realtek: Update module parameter description for
    auto_delink_en
  USB: storage: ums-realtek: Whitelist auto-delink support

 drivers/usb/storage/realtek_cr.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/2] USB: storage: ums-realtek: Update module parameter description for auto_delink_en

Kai-Heng Feng
BugLink: https://bugs.launchpad.net/bugs/1838886

The option named "auto_delink_en" is a bit misleading, as setting it to
false doesn't really disable auto-delink but let auto-delink be firmware
controlled.

Update the description to reflect the real usage of this parameter.

Signed-off-by: Kai-Heng Feng <[hidden email]>
Cc: stable <[hidden email]>
Link: https://lore.kernel.org/r/20190827173450.13572-1-kai.heng.feng@...
Signed-off-by: Greg Kroah-Hartman <[hidden email]>
(cherry picked from commit f6445b6b2f2bb1745080af4a0926049e8bca2617 linux-next)
Signed-off-by: Kai-Heng Feng <[hidden email]>
---
 drivers/usb/storage/realtek_cr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c
index 02bd3556364c..a7935c6382fc 100644
--- a/drivers/usb/storage/realtek_cr.c
+++ b/drivers/usb/storage/realtek_cr.c
@@ -38,7 +38,7 @@ MODULE_LICENSE("GPL");
 
 static int auto_delink_en = 1;
 module_param(auto_delink_en, int, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(auto_delink_en, "enable auto delink");
+MODULE_PARM_DESC(auto_delink_en, "auto delink mode (0=firmware, 1=software [default])");
 
 static int enable_mmc = 1;
 module_param(enable_mmc, int, S_IRUGO | S_IWUSR);
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 2/2] USB: storage: ums-realtek: Whitelist auto-delink support

Kai-Heng Feng
In reply to this post by Kai-Heng Feng
BugLink: https://bugs.launchpad.net/bugs/1838886

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 <[hidden email]>
Acked-by: Alan Stern <[hidden email]>
Cc: stable <[hidden email]>
Link: https://lore.kernel.org/r/20190827173450.13572-2-kai.heng.feng@...
Signed-off-by: Greg Kroah-Hartman <[hidden email]>
(cherry picked from commit 1902a01e2bcc3abd7c9a18dc05e78c7ab4a53c54 linux-next)
Signed-off-by: Kai-Heng Feng <[hidden email]>
---
 drivers/usb/storage/realtek_cr.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c
index a7935c6382fc..99a77f48ca10 100644
--- a/drivers/usb/storage/realtek_cr.c
+++ b/drivers/usb/storage/realtek_cr.c
@@ -1032,12 +1032,15 @@ static int init_realtek_cr(struct us_data *us)
  goto INIT_FAIL;
  }
 
- if (CHECK_FW_VER(chip, 0x5888) || CHECK_FW_VER(chip, 0x5889) ||
-    CHECK_FW_VER(chip, 0x5901))
- SET_AUTO_DELINK(chip);
- if (STATUS_LEN(chip) == 16) {
- if (SUPPORT_AUTO_DELINK(chip))
+ if (CHECK_PID(chip, 0x0138) || CHECK_PID(chip, 0x0158) ||
+    CHECK_PID(chip, 0x0159)) {
+ if (CHECK_FW_VER(chip, 0x5888) || CHECK_FW_VER(chip, 0x5889) ||
+ CHECK_FW_VER(chip, 0x5901))
  SET_AUTO_DELINK(chip);
+ if (STATUS_LEN(chip) == 16) {
+ if (SUPPORT_AUTO_DELINK(chip))
+ SET_AUTO_DELINK(chip);
+ }
  }
 #ifdef CONFIG_REALTEK_AUTOPM
  if (ss_en)
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK/cmt / APPLIED[E]: [SRU] [B/D/E/Unstable] [PATCH 0/2] Fix auto-delink on new ums-realtek devices

Seth Forshee
In reply to this post by Kai-Heng Feng
On Mon, Sep 02, 2019 at 05:04:19PM +0800, Kai-Heng Feng wrote:

> BugLink: https://bugs.launchpad.net/bugs/1838886
>
> [Impact]
> Some ums-realtek card readers may dropped from USB bus after using
> ums-realtek driver instead of usb-storage generic driver.
>
> [Fix]
> Disable auto-delink on new ums-realtek devices, only whitelist three
> oldest IDs.
>
> [Test]
> Affected user and myself confirmed disabling auto-delink works.
>
> [Regression Potential]
> Minimal. Limited to one specific driver and this also restore the old
> behavior.

These patches are upstream as of 5.3-rc7, so unstable does not need
them, and the patches can be marked as coming from upstream rather than
linux-next.

Acked-by: Seth Forshee <[hidden email]>

Applied to eoan/master-next, thanks!

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team