From: Greg Kroah-Hartman Date: Mon, 21 Sep 2020 12:00:29 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v4.4.237~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=30083f1d85d2f2480cdf3d2baaa3ffaa79d752a4;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: i2c-i801-fix-resume-bug.patch revert-alsa-hda-fix-silent-audio-output-and-corrupted.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.19/i2c-i801-fix-resume-bug.patch b/queue-4.19/i2c-i801-fix-resume-bug.patch new file mode 100644 index 00000000000..6b90838040c --- /dev/null +++ b/queue-4.19/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 +@@ -1506,6 +1506,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; +@@ -1611,14 +1621,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"); +@@ -1745,6 +1751,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.19/revert-alsa-hda-fix-silent-audio-output-and-corrupted.patch b/queue-4.19/revert-alsa-hda-fix-silent-audio-output-and-corrupted.patch new file mode 100644 index 00000000000..3738eccb8d5 --- /dev/null +++ b/queue-4.19/revert-alsa-hda-fix-silent-audio-output-and-corrupted.patch @@ -0,0 +1,31 @@ +From 0342d2342b24547ff8ec3e12f9148a9fd681481f Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Mon, 21 Sep 2020 13:55:28 +0200 +Subject: Revert "ALSA: hda - Fix silent audio output and corrupted input on MSI X570-A PRO" + +From: Greg Kroah-Hartman + +This reverts commit c0a7b7fe0e0f7baa7c1779e401d293d176307c51 which is +commit 15cbff3fbbc631952c346744f862fb294504b5e2 upstream. + +It causes know regressions and will be reverted in Linus's tree soon. + +Reported-by: Hans de Goede +Cc: Dan Crawford +Cc: Takashi Iwai +Link: https://lore.kernel.org/r/7efd2fe5-bf38-7f85-891a-eee3845d1493@redhat.com +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -2452,7 +2452,6 @@ static const struct snd_pci_quirk alc882 + SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950), + SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950), + SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), +- SND_PCI_QUIRK(0x1462, 0x9c37, "MSI X570-A PRO", ALC1220_FIXUP_CLEVO_P950), + SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS), + SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), + SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), diff --git a/queue-4.19/series b/queue-4.19/series index 5ae4af5b283..a410a8cc10f 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -34,3 +34,8 @@ 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 +revert-alsa-hda-fix-silent-audio-output-and-corrupted.patch diff --git a/queue-4.19/usb-quirks-add-usb_quirk_ignore_remote_wakeup-quirk-for-byd-zhaoxin-notebook.patch b/queue-4.19/usb-quirks-add-usb_quirk_ignore_remote_wakeup-quirk-for-byd-zhaoxin-notebook.patch new file mode 100644 index 00000000000..0ae32637aa6 --- /dev/null +++ b/queue-4.19/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 +@@ -397,6 +397,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.19/usb-uas-fix-disconnect-by-unplugging-a-hub.patch b/queue-4.19/usb-uas-fix-disconnect-by-unplugging-a-hub.patch new file mode 100644 index 00000000000..f1516f35e65 --- /dev/null +++ b/queue-4.19/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 +@@ -669,8 +669,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.19/usblp-fix-race-between-disconnect-and-read.patch b/queue-4.19/usblp-fix-race-between-disconnect-and-read.patch new file mode 100644 index 00000000000..2d09d9be891 --- /dev/null +++ b/queue-4.19/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 +@@ -827,6 +827,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);