From: Greg Kroah-Hartman Date: Mon, 21 Sep 2020 12:00:14 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v4.4.237~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ce265d0df4ff7eee80b90b2e81aa652743257065;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: i2c-i801-fix-resume-bug.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.14/i2c-i801-fix-resume-bug.patch b/queue-4.14/i2c-i801-fix-resume-bug.patch new file mode 100644 index 00000000000..ccf4ef70d72 --- /dev/null +++ b/queue-4.14/i2c-i801-fix-resume-bug.patch @@ -0,0 +1,73 @@ +From 66d402e2e9455cf0213c42b97f22a0493372d7cc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Volker=20R=C3=BCmelin?= +Date: Tue, 1 Sep 2020 15:22:21 +0200 +Subject: i2c: i801: Fix resume bug +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Volker Rümelin + +commit 66d402e2e9455cf0213c42b97f22a0493372d7cc upstream. + +On suspend the original host configuration gets restored. The +resume routine has to undo this, otherwise the SMBus master +may be left in disabled state or in i2c mode. + +[JD: Rebased on v5.8, moved the write into i801_setup_hstcfg.] + +Signed-off-by: Volker Rümelin +Signed-off-by: Jean Delvare +Signed-off-by: Wolfram Sang +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/i2c/busses/i2c-i801.c | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +--- a/drivers/i2c/busses/i2c-i801.c ++++ b/drivers/i2c/busses/i2c-i801.c +@@ -1499,6 +1499,16 @@ static inline int i801_acpi_probe(struct + static inline void i801_acpi_remove(struct i801_priv *priv) { } + #endif + ++static unsigned char i801_setup_hstcfg(struct i801_priv *priv) ++{ ++ unsigned char hstcfg = priv->original_hstcfg; ++ ++ hstcfg &= ~SMBHSTCFG_I2C_EN; /* SMBus timing */ ++ hstcfg |= SMBHSTCFG_HST_EN; ++ pci_write_config_byte(priv->pci_dev, SMBHSTCFG, hstcfg); ++ return hstcfg; ++} ++ + static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) + { + unsigned char temp; +@@ -1602,14 +1612,10 @@ static int i801_probe(struct pci_dev *de + return err; + } + +- pci_read_config_byte(priv->pci_dev, SMBHSTCFG, &temp); +- priv->original_hstcfg = temp; +- temp &= ~SMBHSTCFG_I2C_EN; /* SMBus timing */ +- if (!(temp & SMBHSTCFG_HST_EN)) { ++ pci_read_config_byte(priv->pci_dev, SMBHSTCFG, &priv->original_hstcfg); ++ temp = i801_setup_hstcfg(priv); ++ if (!(priv->original_hstcfg & SMBHSTCFG_HST_EN)) + dev_info(&dev->dev, "Enabling SMBus device\n"); +- temp |= SMBHSTCFG_HST_EN; +- } +- pci_write_config_byte(priv->pci_dev, SMBHSTCFG, temp); + + if (temp & SMBHSTCFG_SMB_SMI_EN) { + dev_dbg(&dev->dev, "SMBus using interrupt SMI#\n"); +@@ -1736,6 +1742,7 @@ static int i801_resume(struct device *de + struct pci_dev *pci_dev = to_pci_dev(dev); + struct i801_priv *priv = pci_get_drvdata(pci_dev); + ++ i801_setup_hstcfg(priv); + i801_enable_host_notify(&priv->adapter); + + return 0; diff --git a/queue-4.14/series b/queue-4.14/series index 977a09c5f77..79624d99058 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -81,3 +81,7 @@ fbcon-fix-user-font-detection-test-at-fbcon_resize.patch mips-sni-fix-spurious-interrupts.patch drm-mediatek-add-exception-handing-in-mtk_drm_probe-.patch drm-mediatek-add-missing-put_device-call-in-mtk_hdmi.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 +i2c-i801-fix-resume-bug.patch diff --git a/queue-4.14/usb-quirks-add-usb_quirk_ignore_remote_wakeup-quirk-for-byd-zhaoxin-notebook.patch b/queue-4.14/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.14/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.14/usb-uas-fix-disconnect-by-unplugging-a-hub.patch b/queue-4.14/usb-uas-fix-disconnect-by-unplugging-a-hub.patch new file mode 100644 index 00000000000..a911aad4c30 --- /dev/null +++ b/queue-4.14/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 +@@ -670,8 +670,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 */ +@@ -706,6 +705,16 @@ static int uas_queuecommand_lck(struct s + cmdinfo->state &= ~(SUBMIT_DATA_IN_URB | SUBMIT_DATA_OUT_URB); + + err = uas_submit_urbs(cmnd, devinfo); ++ /* ++ * 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) { +@@ -716,6 +725,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.14/usblp-fix-race-between-disconnect-and-read.patch b/queue-4.14/usblp-fix-race-between-disconnect-and-read.patch new file mode 100644 index 00000000000..8376b51ad1b --- /dev/null +++ b/queue-4.14/usblp-fix-race-between-disconnect-and-read.patch @@ -0,0 +1,36 @@ +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);