]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Sep 2020 12:00:14 +0000 (14:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Sep 2020 12:00:14 +0000 (14:00 +0200)
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

queue-4.14/i2c-i801-fix-resume-bug.patch [new file with mode: 0644]
queue-4.14/series
queue-4.14/usb-quirks-add-usb_quirk_ignore_remote_wakeup-quirk-for-byd-zhaoxin-notebook.patch [new file with mode: 0644]
queue-4.14/usb-uas-fix-disconnect-by-unplugging-a-hub.patch [new file with mode: 0644]
queue-4.14/usblp-fix-race-between-disconnect-and-read.patch [new file with mode: 0644]

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 (file)
index 0000000..ccf4ef7
--- /dev/null
@@ -0,0 +1,73 @@
+From 66d402e2e9455cf0213c42b97f22a0493372d7cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Volker=20R=C3=BCmelin?= <vr_qemu@t-online.de>
+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 <vr_qemu@t-online.de>
+
+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 <vr_qemu@t-online.de>
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+Signed-off-by: Wolfram Sang <wsa@kernel.org>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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;
index 977a09c5f772f845a75f87b9c4f184b673627af3..79624d99058644b9d776c6962c3a704b76ea72ed 100644 (file)
@@ -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 (file)
index 0000000..24cc0f4
--- /dev/null
@@ -0,0 +1,35 @@
+From bcea6dafeeef7d1a6a8320a249aabf981d63b881 Mon Sep 17 00:00:00 2001
+From: Penghao <penghao@uniontech.com>
+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 <penghao@uniontech.com>
+
+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 <penghao@uniontech.com>
+Cc: stable <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20200907023026.28189-1-penghao@uniontech.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 (file)
index 0000000..a911aad
--- /dev/null
@@ -0,0 +1,63 @@
+From 325b008723b2dd31de020e85ab9d2e9aa4637d35 Mon Sep 17 00:00:00 2001
+From: Oliver Neukum <oneukum@suse.com>
+Date: Wed, 16 Sep 2020 11:40:25 +0200
+Subject: USB: UAS: fix disconnect by unplugging a hub
+
+From: Oliver Neukum <oneukum@suse.com>
+
+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 <oneukum@suse.com>
+Cc: stable <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20200916094026.30085-2-oneukum@suse.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 (file)
index 0000000..8376b51
--- /dev/null
@@ -0,0 +1,36 @@
+From 9cdabcb3ef8c24ca3a456e4db7b012befb688e73 Mon Sep 17 00:00:00 2001
+From: Oliver Neukum <oneukum@suse.com>
+Date: Thu, 17 Sep 2020 12:34:27 +0200
+Subject: usblp: fix race between disconnect() and read()
+
+From: Oliver Neukum <oneukum@suse.com>
+
+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 <oneukum@suse.com>
+Reported-by: syzbot+be5b5f86a162a6c281e6@syzkaller.appspotmail.com
+Link: https://lore.kernel.org/r/20200917103427.15740-1-oneukum@suse.com
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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);