From 91e1c4a68887e47b51c69b602f30a73d6e751f6d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 21 Sep 2020 13:59:43 +0200 Subject: [PATCH] 4.4-stable patches added patches: usb-quirks-add-usb_quirk_ignore_remote_wakeup-quirk-for-byd-zhaoxin-notebook.patch usb-uas-fix-disconnect-by-unplugging-a-hub.patch usblp-fix-race-between-disconnect-and-read.patch --- queue-4.4/series | 3 + ...akeup-quirk-for-byd-zhaoxin-notebook.patch | 35 +++++++++++ ...s-fix-disconnect-by-unplugging-a-hub.patch | 63 +++++++++++++++++++ ...fix-race-between-disconnect-and-read.patch | 35 +++++++++++ 4 files changed, 136 insertions(+) create mode 100644 queue-4.4/usb-quirks-add-usb_quirk_ignore_remote_wakeup-quirk-for-byd-zhaoxin-notebook.patch create mode 100644 queue-4.4/usb-uas-fix-disconnect-by-unplugging-a-hub.patch create mode 100644 queue-4.4/usblp-fix-race-between-disconnect-and-read.patch diff --git a/queue-4.4/series b/queue-4.4/series index 6773cb9840f..d1557e24715 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -36,3 +36,6 @@ mips-sni-fix-mips_l1_cache_shift.patch perf-test-free-formats-for-perf-pmu-parse-test.patch fbcon-fix-user-font-detection-test-at-fbcon_resize.patch mips-sni-fix-spurious-interrupts.patch +usb-quirks-add-usb_quirk_ignore_remote_wakeup-quirk-for-byd-zhaoxin-notebook.patch +usb-uas-fix-disconnect-by-unplugging-a-hub.patch +usblp-fix-race-between-disconnect-and-read.patch diff --git a/queue-4.4/usb-quirks-add-usb_quirk_ignore_remote_wakeup-quirk-for-byd-zhaoxin-notebook.patch b/queue-4.4/usb-quirks-add-usb_quirk_ignore_remote_wakeup-quirk-for-byd-zhaoxin-notebook.patch new file mode 100644 index 00000000000..24cc0f4edb2 --- /dev/null +++ b/queue-4.4/usb-quirks-add-usb_quirk_ignore_remote_wakeup-quirk-for-byd-zhaoxin-notebook.patch @@ -0,0 +1,35 @@ +From bcea6dafeeef7d1a6a8320a249aabf981d63b881 Mon Sep 17 00:00:00 2001 +From: Penghao +Date: Mon, 7 Sep 2020 10:30:26 +0800 +Subject: USB: quirks: Add USB_QUIRK_IGNORE_REMOTE_WAKEUP quirk for BYD zhaoxin notebook + +From: Penghao + +commit bcea6dafeeef7d1a6a8320a249aabf981d63b881 upstream. + +Add a USB_QUIRK_IGNORE_REMOTE_WAKEUP quirk for the BYD zhaoxin notebook. +This notebook come with usb touchpad. And we would like to disable +touchpad wakeup on this notebook by default. + +Signed-off-by: Penghao +Cc: stable +Link: https://lore.kernel.org/r/20200907023026.28189-1-penghao@uniontech.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/core/quirks.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/usb/core/quirks.c ++++ b/drivers/usb/core/quirks.c +@@ -236,6 +236,10 @@ static const struct usb_device_id usb_qu + /* Generic RTL8153 based ethernet adapters */ + { USB_DEVICE(0x0bda, 0x8153), .driver_info = USB_QUIRK_NO_LPM }, + ++ /* SONiX USB DEVICE Touchpad */ ++ { USB_DEVICE(0x0c45, 0x7056), .driver_info = ++ USB_QUIRK_IGNORE_REMOTE_WAKEUP }, ++ + /* Action Semiconductor flash disk */ + { USB_DEVICE(0x10d6, 0x2200), .driver_info = + USB_QUIRK_STRING_FETCH_255 }, diff --git a/queue-4.4/usb-uas-fix-disconnect-by-unplugging-a-hub.patch b/queue-4.4/usb-uas-fix-disconnect-by-unplugging-a-hub.patch new file mode 100644 index 00000000000..4186ad32621 --- /dev/null +++ b/queue-4.4/usb-uas-fix-disconnect-by-unplugging-a-hub.patch @@ -0,0 +1,63 @@ +From 325b008723b2dd31de020e85ab9d2e9aa4637d35 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Wed, 16 Sep 2020 11:40:25 +0200 +Subject: USB: UAS: fix disconnect by unplugging a hub + +From: Oliver Neukum + +commit 325b008723b2dd31de020e85ab9d2e9aa4637d35 upstream. + +The SCSI layer can go into an ugly loop if you ignore that a device is +gone. You need to report an error in the command rather than in the +return value of the queue method. + +We need to specifically check for ENODEV. The issue goes back to the +introduction of the driver. + +Fixes: 115bb1ffa54c3 ("USB: Add UAS driver") +Signed-off-by: Oliver Neukum +Cc: stable +Link: https://lore.kernel.org/r/20200916094026.30085-2-oneukum@suse.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/storage/uas.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +--- a/drivers/usb/storage/uas.c ++++ b/drivers/usb/storage/uas.c +@@ -646,8 +646,7 @@ static int uas_queuecommand_lck(struct s + if (devinfo->resetting) { + cmnd->result = DID_ERROR << 16; + cmnd->scsi_done(cmnd); +- spin_unlock_irqrestore(&devinfo->lock, flags); +- return 0; ++ goto zombie; + } + + /* Find a free uas-tag */ +@@ -682,6 +681,16 @@ static int uas_queuecommand_lck(struct s + cmdinfo->state &= ~(SUBMIT_DATA_IN_URB | SUBMIT_DATA_OUT_URB); + + err = uas_submit_urbs(cmnd, devinfo, GFP_ATOMIC); ++ /* ++ * in case of fatal errors the SCSI layer is peculiar ++ * a command that has finished is a success for the purpose ++ * of queueing, no matter how fatal the error ++ */ ++ if (err == -ENODEV) { ++ cmnd->result = DID_ERROR << 16; ++ cmnd->scsi_done(cmnd); ++ goto zombie; ++ } + if (err) { + /* If we did nothing, give up now */ + if (cmdinfo->state & SUBMIT_STATUS_URB) { +@@ -692,6 +701,7 @@ static int uas_queuecommand_lck(struct s + } + + devinfo->cmnd[idx] = cmnd; ++zombie: + spin_unlock_irqrestore(&devinfo->lock, flags); + return 0; + } diff --git a/queue-4.4/usblp-fix-race-between-disconnect-and-read.patch b/queue-4.4/usblp-fix-race-between-disconnect-and-read.patch new file mode 100644 index 00000000000..0256ce66de0 --- /dev/null +++ b/queue-4.4/usblp-fix-race-between-disconnect-and-read.patch @@ -0,0 +1,35 @@ +From 9cdabcb3ef8c24ca3a456e4db7b012befb688e73 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Thu, 17 Sep 2020 12:34:27 +0200 +Subject: usblp: fix race between disconnect() and read() + +From: Oliver Neukum + +commit 9cdabcb3ef8c24ca3a456e4db7b012befb688e73 upstream. + +read() needs to check whether the device has been +disconnected before it tries to talk to the device. + +Signed-off-by: Oliver Neukum +Reported-by: syzbot+be5b5f86a162a6c281e6@syzkaller.appspotmail.com +Link: https://lore.kernel.org/r/20200917103427.15740-1-oneukum@suse.com +Cc: stable +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/class/usblp.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/usb/class/usblp.c ++++ b/drivers/usb/class/usblp.c +@@ -840,6 +840,11 @@ static ssize_t usblp_read(struct file *f + if (rv < 0) + return rv; + ++ if (!usblp->present) { ++ count = -ENODEV; ++ goto done; ++ } ++ + if ((avail = usblp->rstatus) < 0) { + printk(KERN_ERR "usblp%d: error %d reading from printer\n", + usblp->minor, (int)avail); -- 2.47.3