]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.3-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Dec 2019 12:35:45 +0000 (13:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Dec 2019 12:35:45 +0000 (13:35 +0100)
added patches:
alsa-hda-add-mute-led-support-for-hp-probook-645-g4.patch
alsa-hda-modify-stream-stripe-mask-only-when-needed.patch
alsa-hda-realtek-dell-headphone-has-noise-on-unmute-for-alc236.patch
alsa-hda-realtek-enable-internal-speaker-of-asus-ux431flc.patch
alsa-hda-realtek-enable-the-headset-mic-on-a-xiaomi-s-laptop.patch
alsa-pcm-oss-avoid-potential-buffer-overflows.patch
coresight-etm4x-fix-input-validation-for-sysfs.patch
input-fix-memory-leak-in-psxpad_spi_probe.patch
input-goodix-add-upside-down-quirk-for-teclast-x89-tablet.patch
input-synaptics-rmi4-don-t-increment-rmiaddr-for-smbus-transfers.patch
input-synaptics-rmi4-re-enable-irqs-in-f34v7_do_reflash.patch
input-synaptics-switch-another-x1-carbon-6-to-rmi-smbus.patch
media-rc-mark-input-device-as-pointing-stick.patch

14 files changed:
queue-5.3/alsa-hda-add-mute-led-support-for-hp-probook-645-g4.patch [new file with mode: 0644]
queue-5.3/alsa-hda-modify-stream-stripe-mask-only-when-needed.patch [new file with mode: 0644]
queue-5.3/alsa-hda-realtek-dell-headphone-has-noise-on-unmute-for-alc236.patch [new file with mode: 0644]
queue-5.3/alsa-hda-realtek-enable-internal-speaker-of-asus-ux431flc.patch [new file with mode: 0644]
queue-5.3/alsa-hda-realtek-enable-the-headset-mic-on-a-xiaomi-s-laptop.patch [new file with mode: 0644]
queue-5.3/alsa-pcm-oss-avoid-potential-buffer-overflows.patch [new file with mode: 0644]
queue-5.3/coresight-etm4x-fix-input-validation-for-sysfs.patch [new file with mode: 0644]
queue-5.3/input-fix-memory-leak-in-psxpad_spi_probe.patch [new file with mode: 0644]
queue-5.3/input-goodix-add-upside-down-quirk-for-teclast-x89-tablet.patch [new file with mode: 0644]
queue-5.3/input-synaptics-rmi4-don-t-increment-rmiaddr-for-smbus-transfers.patch [new file with mode: 0644]
queue-5.3/input-synaptics-rmi4-re-enable-irqs-in-f34v7_do_reflash.patch [new file with mode: 0644]
queue-5.3/input-synaptics-switch-another-x1-carbon-6-to-rmi-smbus.patch [new file with mode: 0644]
queue-5.3/media-rc-mark-input-device-as-pointing-stick.patch [new file with mode: 0644]
queue-5.3/series

diff --git a/queue-5.3/alsa-hda-add-mute-led-support-for-hp-probook-645-g4.patch b/queue-5.3/alsa-hda-add-mute-led-support-for-hp-probook-645-g4.patch
new file mode 100644 (file)
index 0000000..5d1ce0a
--- /dev/null
@@ -0,0 +1,32 @@
+From e190de6941db14813032af87873f5550ad5764fe Mon Sep 17 00:00:00 2001
+From: Kai-Heng Feng <kai.heng.feng@canonical.com>
+Date: Wed, 20 Nov 2019 16:20:35 +0800
+Subject: ALSA: hda - Add mute led support for HP ProBook 645 G4
+
+From: Kai-Heng Feng <kai.heng.feng@canonical.com>
+
+commit e190de6941db14813032af87873f5550ad5764fe upstream.
+
+Mic mute led does not work on HP ProBook 645 G4.
+We can use CXT_FIXUP_MUTE_LED_GPIO fixup to support it.
+
+Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20191120082035.18937-1-kai.heng.feng@canonical.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_conexant.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/pci/hda/patch_conexant.c
++++ b/sound/pci/hda/patch_conexant.c
+@@ -910,6 +910,7 @@ static const struct snd_pci_quirk cxt506
+       SND_PCI_QUIRK(0x103c, 0x837f, "HP ProBook 470 G5", CXT_FIXUP_MUTE_LED_GPIO),
+       SND_PCI_QUIRK(0x103c, 0x8299, "HP 800 G3 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x103c, 0x829a, "HP 800 G3 DM", CXT_FIXUP_HP_MIC_NO_PRESENCE),
++      SND_PCI_QUIRK(0x103c, 0x8402, "HP ProBook 645 G4", CXT_FIXUP_MUTE_LED_GPIO),
+       SND_PCI_QUIRK(0x103c, 0x8455, "HP Z2 G4", CXT_FIXUP_HP_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x103c, 0x8456, "HP Z2 G4 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x103c, 0x8457, "HP Z2 G4 mini", CXT_FIXUP_HP_MIC_NO_PRESENCE),
diff --git a/queue-5.3/alsa-hda-modify-stream-stripe-mask-only-when-needed.patch b/queue-5.3/alsa-hda-modify-stream-stripe-mask-only-when-needed.patch
new file mode 100644 (file)
index 0000000..3084b17
--- /dev/null
@@ -0,0 +1,99 @@
+From e38e486d66e2a3b902768fd71c32dbf10f77e1cb Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Mon, 2 Dec 2019 08:49:47 +0100
+Subject: ALSA: hda: Modify stream stripe mask only when needed
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit e38e486d66e2a3b902768fd71c32dbf10f77e1cb upstream.
+
+The recent commit in HD-audio stream management for changing the
+stripe control seems causing a regression on some platforms.  The
+stripe control is currently used only by HDMI codec, and applying the
+stripe mask unconditionally may lead to scratchy and static noises as
+seen on some MacBooks.
+
+For addressing the regression, this patch changes the stream
+management code to apply the stripe mask conditionally only when the
+codec driver requested.
+
+Fixes: 9b6f7e7a296e ("ALSA: hda: program stripe bits for controller")
+BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204477
+Tested-by: Michael Pobega <mpobega@neverware.com>
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20191202074947.1617-1-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/sound/hdaudio.h    |    1 +
+ sound/hda/hdac_stream.c    |   19 ++++++++++++-------
+ sound/pci/hda/patch_hdmi.c |    5 +++++
+ 3 files changed, 18 insertions(+), 7 deletions(-)
+
+--- a/include/sound/hdaudio.h
++++ b/include/sound/hdaudio.h
+@@ -504,6 +504,7 @@ struct hdac_stream {
+       bool prepared:1;
+       bool no_period_wakeup:1;
+       bool locked:1;
++      bool stripe:1;                  /* apply stripe control */
+       /* timestamp */
+       unsigned long start_wallclk;    /* start + minimum wallclk */
+--- a/sound/hda/hdac_stream.c
++++ b/sound/hda/hdac_stream.c
+@@ -96,12 +96,14 @@ void snd_hdac_stream_start(struct hdac_s
+                             1 << azx_dev->index,
+                             1 << azx_dev->index);
+       /* set stripe control */
+-      if (azx_dev->substream)
+-              stripe_ctl = snd_hdac_get_stream_stripe_ctl(bus, azx_dev->substream);
+-      else
+-              stripe_ctl = 0;
+-      snd_hdac_stream_updateb(azx_dev, SD_CTL_3B, SD_CTL_STRIPE_MASK,
+-                              stripe_ctl);
++      if (azx_dev->stripe) {
++              if (azx_dev->substream)
++                      stripe_ctl = snd_hdac_get_stream_stripe_ctl(bus, azx_dev->substream);
++              else
++                      stripe_ctl = 0;
++              snd_hdac_stream_updateb(azx_dev, SD_CTL_3B, SD_CTL_STRIPE_MASK,
++                                      stripe_ctl);
++      }
+       /* set DMA start and interrupt mask */
+       snd_hdac_stream_updateb(azx_dev, SD_CTL,
+                               0, SD_CTL_DMA_START | SD_INT_MASK);
+@@ -118,7 +120,10 @@ void snd_hdac_stream_clear(struct hdac_s
+       snd_hdac_stream_updateb(azx_dev, SD_CTL,
+                               SD_CTL_DMA_START | SD_INT_MASK, 0);
+       snd_hdac_stream_writeb(azx_dev, SD_STS, SD_INT_MASK); /* to be sure */
+-      snd_hdac_stream_updateb(azx_dev, SD_CTL_3B, SD_CTL_STRIPE_MASK, 0);
++      if (azx_dev->stripe) {
++              snd_hdac_stream_updateb(azx_dev, SD_CTL_3B, SD_CTL_STRIPE_MASK, 0);
++              azx_dev->stripe = 0;
++      }
+       azx_dev->running = false;
+ }
+ EXPORT_SYMBOL_GPL(snd_hdac_stream_clear);
+--- a/sound/pci/hda/patch_hdmi.c
++++ b/sound/pci/hda/patch_hdmi.c
+@@ -31,6 +31,7 @@
+ #include <sound/hda_codec.h>
+ #include "hda_local.h"
+ #include "hda_jack.h"
++#include "hda_controller.h"
+ static bool static_hdmi_pcm;
+ module_param(static_hdmi_pcm, bool, 0644);
+@@ -1226,6 +1227,10 @@ static int hdmi_pcm_open(struct hda_pcm_
+       per_pin->cvt_nid = per_cvt->cvt_nid;
+       hinfo->nid = per_cvt->cvt_nid;
++      /* flip stripe flag for the assigned stream if supported */
++      if (get_wcaps(codec, per_cvt->cvt_nid) & AC_WCAP_STRIPE)
++              azx_stream(get_azx_dev(substream))->stripe = 1;
++
+       snd_hda_set_dev_select(codec, per_pin->pin_nid, per_pin->dev_id);
+       snd_hda_codec_write_cache(codec, per_pin->pin_nid, 0,
+                           AC_VERB_SET_CONNECT_SEL,
diff --git a/queue-5.3/alsa-hda-realtek-dell-headphone-has-noise-on-unmute-for-alc236.patch b/queue-5.3/alsa-hda-realtek-dell-headphone-has-noise-on-unmute-for-alc236.patch
new file mode 100644 (file)
index 0000000..4376c55
--- /dev/null
@@ -0,0 +1,49 @@
+From e1e8c1fdce8b00fce08784d9d738c60ebf598ebc Mon Sep 17 00:00:00 2001
+From: Kailang Yang <kailang@realtek.com>
+Date: Tue, 26 Nov 2019 17:04:23 +0800
+Subject: ALSA: hda/realtek - Dell headphone has noise on unmute for ALC236
+
+From: Kailang Yang <kailang@realtek.com>
+
+commit e1e8c1fdce8b00fce08784d9d738c60ebf598ebc upstream.
+
+headphone have noise even the volume is very small.
+Let it fill up pcbeep hidden register to default value.
+The issue was gone.
+
+Fixes: 4344aec84bd8 ("ALSA: hda/realtek - New codec support for ALC256")
+Fixes: 736f20a70608 ("ALSA: hda/realtek - Add support for ALC236/ALC3204")
+Signed-off-by: Kailang Yang <kailang@realtek.com>
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/9ae47f23a64d4e41a9c81e263cd8a250@realtek.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c |    7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -367,9 +367,7 @@ static void alc_fill_eapd_coef(struct hd
+       case 0x10ec0215:
+       case 0x10ec0233:
+       case 0x10ec0235:
+-      case 0x10ec0236:
+       case 0x10ec0255:
+-      case 0x10ec0256:
+       case 0x10ec0257:
+       case 0x10ec0282:
+       case 0x10ec0283:
+@@ -381,6 +379,11 @@ static void alc_fill_eapd_coef(struct hd
+       case 0x10ec0300:
+               alc_update_coef_idx(codec, 0x10, 1<<9, 0);
+               break;
++      case 0x10ec0236:
++      case 0x10ec0256:
++              alc_write_coef_idx(codec, 0x36, 0x5757);
++              alc_update_coef_idx(codec, 0x10, 1<<9, 0);
++              break;
+       case 0x10ec0275:
+               alc_update_coef_idx(codec, 0xe, 0, 1<<0);
+               break;
diff --git a/queue-5.3/alsa-hda-realtek-enable-internal-speaker-of-asus-ux431flc.patch b/queue-5.3/alsa-hda-realtek-enable-internal-speaker-of-asus-ux431flc.patch
new file mode 100644 (file)
index 0000000..686feca
--- /dev/null
@@ -0,0 +1,57 @@
+From 436e25505f3458cc92c7f3c985e9cbc198a98209 Mon Sep 17 00:00:00 2001
+From: Jian-Hong Pan <jian-hong@endlessm.com>
+Date: Mon, 25 Nov 2019 17:34:06 +0800
+Subject: ALSA: hda/realtek - Enable internal speaker of ASUS UX431FLC
+
+From: Jian-Hong Pan <jian-hong@endlessm.com>
+
+commit 436e25505f3458cc92c7f3c985e9cbc198a98209 upstream.
+
+Laptops like ASUS UX431FLC and UX431FL can share the same audio quirks.
+But UX431FLC needs one more step to enable the internal speaker: Pull
+the GPIO from CODEC to initialize the AMP.
+
+Fixes: 60083f9e94b2 ("ALSA: hda/realtek - Enable internal speaker & headset mic of ASUS UX431FL")
+Signed-off-by: Jian-Hong Pan <jian-hong@endlessm.com>
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20191125093405.5702-1-jian-hong@endlessm.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c |   10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -5878,6 +5878,7 @@ enum {
+       ALC299_FIXUP_PREDATOR_SPK,
+       ALC294_FIXUP_ASUS_INTSPK_HEADSET_MIC,
+       ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
++      ALC294_FIXUP_ASUS_INTSPK_GPIO,
+ };
+ static const struct hda_fixup alc269_fixups[] = {
+@@ -6953,6 +6954,13 @@ static const struct hda_fixup alc269_fix
+               .chained = true,
+               .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
+       },
++      [ALC294_FIXUP_ASUS_INTSPK_GPIO] = {
++              .type = HDA_FIXUP_FUNC,
++              /* The GPIO must be pulled to initialize the AMP */
++              .v.func = alc_fixup_gpio4,
++              .chained = true,
++              .chain_id = ALC294_FIXUP_ASUS_INTSPK_HEADSET_MIC
++      },
+ };
+ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
+@@ -7112,7 +7120,7 @@ static const struct snd_pci_quirk alc269
+       SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
+       SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
+       SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
+-      SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_INTSPK_HEADSET_MIC),
++      SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_INTSPK_GPIO),
+       SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
+       SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
+       SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
diff --git a/queue-5.3/alsa-hda-realtek-enable-the-headset-mic-on-a-xiaomi-s-laptop.patch b/queue-5.3/alsa-hda-realtek-enable-the-headset-mic-on-a-xiaomi-s-laptop.patch
new file mode 100644 (file)
index 0000000..7b4bef7
--- /dev/null
@@ -0,0 +1,33 @@
+From 695d1ec3994f9de2cefae80ee2087c95d2e5a2f3 Mon Sep 17 00:00:00 2001
+From: Hui Wang <hui.wang@canonical.com>
+Date: Thu, 21 Nov 2019 10:54:27 +0800
+Subject: ALSA: hda/realtek - Enable the headset-mic on a Xiaomi's laptop
+
+From: Hui Wang <hui.wang@canonical.com>
+
+commit 695d1ec3994f9de2cefae80ee2087c95d2e5a2f3 upstream.
+
+The headset on this machine is not defined, after applying the quirk
+ALC256_FIXUP_ASUS_HEADSET_MIC, the headset-mic works well
+
+BugLink: https://bugs.launchpad.net/bugs/1846148
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Hui Wang <hui.wang@canonical.com>
+Link: https://lore.kernel.org/r/20191121025427.8856-1-hui.wang@canonical.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -7227,6 +7227,7 @@ static const struct snd_pci_quirk alc269
+       SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
+       SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
+       SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
++      SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
+       SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
+ #if 0
diff --git a/queue-5.3/alsa-pcm-oss-avoid-potential-buffer-overflows.patch b/queue-5.3/alsa-pcm-oss-avoid-potential-buffer-overflows.patch
new file mode 100644 (file)
index 0000000..2156367
--- /dev/null
@@ -0,0 +1,64 @@
+From 4cc8d6505ab82db3357613d36e6c58a297f57f7c Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 4 Dec 2019 15:48:24 +0100
+Subject: ALSA: pcm: oss: Avoid potential buffer overflows
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 4cc8d6505ab82db3357613d36e6c58a297f57f7c upstream.
+
+syzkaller reported an invalid access in PCM OSS read, and this seems
+to be an overflow of the internal buffer allocated for a plugin.
+Since the rate plugin adjusts its transfer size dynamically, the
+calculation for the chained plugin might be bigger than the given
+buffer size in some extreme cases, which lead to such an buffer
+overflow as caught by KASAN.
+
+Fix it by limiting the max transfer size properly by checking against
+the destination size in each plugin transfer callback.
+
+Reported-by: syzbot+f153bde47a62e0b05f83@syzkaller.appspotmail.com
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20191204144824.17801-1-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/core/oss/linear.c |    2 ++
+ sound/core/oss/mulaw.c  |    2 ++
+ sound/core/oss/route.c  |    2 ++
+ 3 files changed, 6 insertions(+)
+
+--- a/sound/core/oss/linear.c
++++ b/sound/core/oss/linear.c
+@@ -107,6 +107,8 @@ static snd_pcm_sframes_t linear_transfer
+               }
+       }
+ #endif
++      if (frames > dst_channels[0].frames)
++              frames = dst_channels[0].frames;
+       convert(plugin, src_channels, dst_channels, frames);
+       return frames;
+ }
+--- a/sound/core/oss/mulaw.c
++++ b/sound/core/oss/mulaw.c
+@@ -269,6 +269,8 @@ static snd_pcm_sframes_t mulaw_transfer(
+               }
+       }
+ #endif
++      if (frames > dst_channels[0].frames)
++              frames = dst_channels[0].frames;
+       data = (struct mulaw_priv *)plugin->extra_data;
+       data->func(plugin, src_channels, dst_channels, frames);
+       return frames;
+--- a/sound/core/oss/route.c
++++ b/sound/core/oss/route.c
+@@ -57,6 +57,8 @@ static snd_pcm_sframes_t route_transfer(
+               return -ENXIO;
+       if (frames == 0)
+               return 0;
++      if (frames > dst_channels[0].frames)
++              frames = dst_channels[0].frames;
+       nsrcs = plugin->src_format.channels;
+       ndsts = plugin->dst_format.channels;
diff --git a/queue-5.3/coresight-etm4x-fix-input-validation-for-sysfs.patch b/queue-5.3/coresight-etm4x-fix-input-validation-for-sysfs.patch
new file mode 100644 (file)
index 0000000..80242fc
--- /dev/null
@@ -0,0 +1,90 @@
+From 2fe6899e36aa174abefd017887f9cfe0cb60c43a Mon Sep 17 00:00:00 2001
+From: Mike Leach <mike.leach@linaro.org>
+Date: Mon, 4 Nov 2019 11:12:42 -0700
+Subject: coresight: etm4x: Fix input validation for sysfs.
+
+From: Mike Leach <mike.leach@linaro.org>
+
+commit 2fe6899e36aa174abefd017887f9cfe0cb60c43a upstream.
+
+A number of issues are fixed relating to sysfs input validation:-
+
+1) bb_ctrl_store() - incorrect compare of bit select field to absolute
+value. Reworked per ETMv4 specification.
+2) seq_event_store() - incorrect mask value - register has two
+event values.
+3) cyc_threshold_store() - must mask with max before checking min
+otherwise wrapped values can set illegal value below min.
+4) res_ctrl_store() - update to mask off all res0 bits.
+
+Reviewed-by: Leo Yan <leo.yan@linaro.org>
+Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
+Signed-off-by: Mike Leach <mike.leach@linaro.org>
+Fixes: a77de2637c9eb ("coresight: etm4x: moving sysFS entries to a dedicated file")
+Cc: stable <stable@vger.kernel.org> # 4.9+
+Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
+Link: https://lore.kernel.org/r/20191104181251.26732-6-mathieu.poirier@linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/hwtracing/coresight/coresight-etm4x-sysfs.c |   21 ++++++++++++--------
+ 1 file changed, 13 insertions(+), 8 deletions(-)
+
+--- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
++++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
+@@ -655,10 +655,13 @@ static ssize_t cyc_threshold_store(struc
+       if (kstrtoul(buf, 16, &val))
+               return -EINVAL;
++
++      /* mask off max threshold before checking min value */
++      val &= ETM_CYC_THRESHOLD_MASK;
+       if (val < drvdata->ccitmin)
+               return -EINVAL;
+-      config->ccctlr = val & ETM_CYC_THRESHOLD_MASK;
++      config->ccctlr = val;
+       return size;
+ }
+ static DEVICE_ATTR_RW(cyc_threshold);
+@@ -689,14 +692,16 @@ static ssize_t bb_ctrl_store(struct devi
+               return -EINVAL;
+       if (!drvdata->nr_addr_cmp)
+               return -EINVAL;
++
+       /*
+-       * Bit[7:0] selects which address range comparator is used for
+-       * branch broadcast control.
++       * Bit[8] controls include(1) / exclude(0), bits[0-7] select
++       * individual range comparators. If include then at least 1
++       * range must be selected.
+        */
+-      if (BMVAL(val, 0, 7) > drvdata->nr_addr_cmp)
++      if ((val & BIT(8)) && (BMVAL(val, 0, 7) == 0))
+               return -EINVAL;
+-      config->bb_ctrl = val;
++      config->bb_ctrl = val & GENMASK(8, 0);
+       return size;
+ }
+ static DEVICE_ATTR_RW(bb_ctrl);
+@@ -1329,8 +1334,8 @@ static ssize_t seq_event_store(struct de
+       spin_lock(&drvdata->spinlock);
+       idx = config->seq_idx;
+-      /* RST, bits[7:0] */
+-      config->seq_ctrl[idx] = val & 0xFF;
++      /* Seq control has two masks B[15:8] F[7:0] */
++      config->seq_ctrl[idx] = val & 0xFFFF;
+       spin_unlock(&drvdata->spinlock);
+       return size;
+ }
+@@ -1585,7 +1590,7 @@ static ssize_t res_ctrl_store(struct dev
+       if (idx % 2 != 0)
+               /* PAIRINV, bit[21] */
+               val &= ~BIT(21);
+-      config->res_ctrl[idx] = val;
++      config->res_ctrl[idx] = val & GENMASK(21, 0);
+       spin_unlock(&drvdata->spinlock);
+       return size;
+ }
diff --git a/queue-5.3/input-fix-memory-leak-in-psxpad_spi_probe.patch b/queue-5.3/input-fix-memory-leak-in-psxpad_spi_probe.patch
new file mode 100644 (file)
index 0000000..fb96f58
--- /dev/null
@@ -0,0 +1,35 @@
+From navid.emamdoost@gmail.com  Mon Dec  9 13:28:47 2019
+From: Navid Emamdoost <navid.emamdoost@gmail.com>
+Date: Thu, 21 Nov 2019 14:01:11 -0600
+Subject: Input: Fix memory leak in psxpad_spi_probe
+To: Dmitry Torokhov <dmitry.torokhov@gmail.com>, Kate Stewart <kstewart@linuxfoundation.org>, Navid Emamdoost <navid.emamdoost@gmail.com>, Richard Fontana <rfontana@redhat.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Allison Randal <allison@lohutok.net>, Thomas Gleixner <tglx@linutronix.de>, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
+Cc: emamd001@umn.edu
+Message-ID: <20191121200115.24846-1-navid.emamdoost@gmail.com>
+
+From: Navid Emamdoost <navid.emamdoost@gmail.com>
+
+In the implementation of psxpad_spi_probe() the allocated memory for
+pdev is leaked if psxpad_spi_init_ff() or input_register_polled_device()
+fail. The solution is using device managed allocation, like the one used
+for pad. Perform the allocation using
+devm_input_allocate_polled_device().
+
+Fixes: 8be193c7b1f4 ("Input: add support for PlayStation 1/2 joypads connected via SPI")
+Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
+Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/input/joystick/psxpad-spi.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/input/joystick/psxpad-spi.c
++++ b/drivers/input/joystick/psxpad-spi.c
+@@ -292,7 +292,7 @@ static int psxpad_spi_probe(struct spi_d
+       if (!pad)
+               return -ENOMEM;
+-      pdev = input_allocate_polled_device();
++      pdev = devm_input_allocate_polled_device(&spi->dev);
+       if (!pdev) {
+               dev_err(&spi->dev, "failed to allocate input device\n");
+               return -ENOMEM;
diff --git a/queue-5.3/input-goodix-add-upside-down-quirk-for-teclast-x89-tablet.patch b/queue-5.3/input-goodix-add-upside-down-quirk-for-teclast-x89-tablet.patch
new file mode 100644 (file)
index 0000000..f66c3ff
--- /dev/null
@@ -0,0 +1,43 @@
+From df5b5e555b356662a5e4a23c6774fdfce8547d54 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Mon, 2 Dec 2019 09:36:15 -0800
+Subject: Input: goodix - add upside-down quirk for Teclast X89 tablet
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit df5b5e555b356662a5e4a23c6774fdfce8547d54 upstream.
+
+The touchscreen on the Teclast X89 is mounted upside down in relation to
+the display orientation (the touchscreen itself is mounted upright, but the
+display is mounted upside-down). Add a quirk for this so that we send
+coordinates which match the display orientation.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Reviewed-by: Bastien Nocera <hadess@hadess.net>
+Link: https://lore.kernel.org/r/20191202085636.6650-1-hdegoede@redhat.com
+Cc: stable@vger.kernel.org
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/touchscreen/goodix.c |    9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/drivers/input/touchscreen/goodix.c
++++ b/drivers/input/touchscreen/goodix.c
+@@ -127,6 +127,15 @@ static const unsigned long goodix_irq_fl
+ static const struct dmi_system_id rotated_screen[] = {
+ #if defined(CONFIG_DMI) && defined(CONFIG_X86)
+       {
++              .ident = "Teclast X89",
++              .matches = {
++                      /* tPAD is too generic, also match on bios date */
++                      DMI_MATCH(DMI_BOARD_VENDOR, "TECLAST"),
++                      DMI_MATCH(DMI_BOARD_NAME, "tPAD"),
++                      DMI_MATCH(DMI_BIOS_DATE, "12/19/2014"),
++              },
++      },
++      {
+               .ident = "WinBook TW100",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "WinBook"),
diff --git a/queue-5.3/input-synaptics-rmi4-don-t-increment-rmiaddr-for-smbus-transfers.patch b/queue-5.3/input-synaptics-rmi4-don-t-increment-rmiaddr-for-smbus-transfers.patch
new file mode 100644 (file)
index 0000000..709a5dc
--- /dev/null
@@ -0,0 +1,59 @@
+From a284e11c371e446371675668d8c8120a27227339 Mon Sep 17 00:00:00 2001
+From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+Date: Mon, 2 Dec 2019 10:08:12 -0800
+Subject: Input: synaptics-rmi4 - don't increment rmiaddr for SMBus transfers
+
+From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+
+commit a284e11c371e446371675668d8c8120a27227339 upstream.
+
+This increment of rmi_smbus in rmi_smb_read/write_block() causes
+garbage to be read/written.
+
+The first read of SMB_MAX_COUNT bytes is fine, but after that
+it is nonsense. Trial-and-error showed that by dropping the
+increment of rmiaddr everything is fine and the F54 function
+properly works.
+
+I tried a hack with rmi_smb_write_block() as well (writing to the
+same F54 touchpad data area, then reading it back), and that
+suggests that there too the rmiaddr increment has to be dropped.
+It makes sense that if it has to be dropped for read, then it has
+to be dropped for write as well.
+
+It looks like the initial work with F54 was done using i2c, not smbus,
+and it seems nobody ever tested F54 with smbus. The other functions
+all read/write less than SMB_MAX_COUNT as far as I can tell, so this
+issue was never noticed with non-F54 functions.
+
+With this change I can read out the touchpad data correctly on my
+Lenovo X1 Carbon 6th Gen laptop.
+
+Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+Link: https://lore.kernel.org/r/8dd22e21-4933-8e9c-a696-d281872c8de7@xs4all.nl
+Cc: stable@vger.kernel.org
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/rmi4/rmi_smbus.c |    2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/drivers/input/rmi4/rmi_smbus.c
++++ b/drivers/input/rmi4/rmi_smbus.c
+@@ -163,7 +163,6 @@ static int rmi_smb_write_block(struct rm
+               /* prepare to write next block of bytes */
+               cur_len -= SMB_MAX_COUNT;
+               databuff += SMB_MAX_COUNT;
+-              rmiaddr += SMB_MAX_COUNT;
+       }
+ exit:
+       mutex_unlock(&rmi_smb->page_mutex);
+@@ -215,7 +214,6 @@ static int rmi_smb_read_block(struct rmi
+               /* prepare to read next block of bytes */
+               cur_len -= SMB_MAX_COUNT;
+               databuff += SMB_MAX_COUNT;
+-              rmiaddr += SMB_MAX_COUNT;
+       }
+       retval = 0;
diff --git a/queue-5.3/input-synaptics-rmi4-re-enable-irqs-in-f34v7_do_reflash.patch b/queue-5.3/input-synaptics-rmi4-re-enable-irqs-in-f34v7_do_reflash.patch
new file mode 100644 (file)
index 0000000..9f67d0b
--- /dev/null
@@ -0,0 +1,41 @@
+From 86bcd3a12999447faad60ec59c2d64d18d8e61ac Mon Sep 17 00:00:00 2001
+From: Lucas Stach <l.stach@pengutronix.de>
+Date: Mon, 2 Dec 2019 09:37:00 -0800
+Subject: Input: synaptics-rmi4 - re-enable IRQs in f34v7_do_reflash
+
+From: Lucas Stach <l.stach@pengutronix.de>
+
+commit 86bcd3a12999447faad60ec59c2d64d18d8e61ac upstream.
+
+F34 is a bit special as it reinitializes the device and related driver
+structs during the firmware update. This clears the fn_irq_mask which
+will then prevent F34 from receiving further interrupts, leading to
+timeouts during the firmware update. Make sure to reinitialize the
+IRQ enables at the appropriate times.
+
+The issue is in F34 code, but the commit in the fixes tag exposed the
+issue, as before this commit things would work by accident.
+
+Fixes: 363c53875aef (Input: synaptics-rmi4 - avoid processing unknown IRQs)
+Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
+Link: https://lore.kernel.org/r/20191129133514.23224-1-l.stach@pengutronix.de
+Cc: stable@vger.kernel.org
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/rmi4/rmi_f34v7.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/input/rmi4/rmi_f34v7.c
++++ b/drivers/input/rmi4/rmi_f34v7.c
+@@ -1189,6 +1189,9 @@ int rmi_f34v7_do_reflash(struct f34_data
+ {
+       int ret;
++      f34->fn->rmi_dev->driver->set_irq_bits(f34->fn->rmi_dev,
++                                             f34->fn->irq_mask);
++
+       rmi_f34v7_read_queries_bl_version(f34);
+       f34->v7.image = fw->data;
diff --git a/queue-5.3/input-synaptics-switch-another-x1-carbon-6-to-rmi-smbus.patch b/queue-5.3/input-synaptics-switch-another-x1-carbon-6-to-rmi-smbus.patch
new file mode 100644 (file)
index 0000000..e3f9550
--- /dev/null
@@ -0,0 +1,32 @@
+From fc1156f373e3927e0dcf06678906c367588bfdd6 Mon Sep 17 00:00:00 2001
+From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+Date: Fri, 22 Nov 2019 16:17:08 -0800
+Subject: Input: synaptics - switch another X1 Carbon 6 to RMI/SMbus
+
+From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+
+commit fc1156f373e3927e0dcf06678906c367588bfdd6 upstream.
+
+Some Lenovo X1 Carbon Gen 6 laptops report LEN0091. Add this
+to the smbus_pnp_ids list.
+
+Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/20191119105118.54285-2-hverkuil-cisco@xs4all.nl
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/mouse/synaptics.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/input/mouse/synaptics.c
++++ b/drivers/input/mouse/synaptics.c
+@@ -172,6 +172,7 @@ static const char * const smbus_pnp_ids[
+       "LEN0071", /* T480 */
+       "LEN0072", /* X1 Carbon Gen 5 (2017) - Elan/ALPS trackpoint */
+       "LEN0073", /* X1 Carbon G5 (Elantech) */
++      "LEN0091", /* X1 Carbon 6 */
+       "LEN0092", /* X1 Carbon 6 */
+       "LEN0093", /* T480 */
+       "LEN0096", /* X280 */
diff --git a/queue-5.3/media-rc-mark-input-device-as-pointing-stick.patch b/queue-5.3/media-rc-mark-input-device-as-pointing-stick.patch
new file mode 100644 (file)
index 0000000..b96f3f7
--- /dev/null
@@ -0,0 +1,35 @@
+From ce819649b03d932dc19b0cb6be513779bf64fad3 Mon Sep 17 00:00:00 2001
+From: Sean Young <sean@mess.org>
+Date: Sat, 28 Sep 2019 17:46:14 -0300
+Subject: media: rc: mark input device as pointing stick
+
+From: Sean Young <sean@mess.org>
+
+commit ce819649b03d932dc19b0cb6be513779bf64fad3 upstream.
+
+libinput refuses pointer movement from rc-core, since it believes it's not
+a pointer-type device:
+
+libinput error: event17 - Media Center Ed. eHome Infrared Remote Transceiver (1784:0008): libinput bug: REL_X/Y from a non-pointer device
+
+Fixes: 158bc148a31e ("media: rc: mce_kbd: input events via rc-core's input device")
+Fixes: 0ac5a603a732 ("media: rc: imon: report mouse events using rc-core's input device")
+Cc: stable@vger.kernel.org # 4.20+
+Signed-off-by: Sean Young <sean@mess.org>
+Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/rc/rc-main.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/media/rc/rc-main.c
++++ b/drivers/media/rc/rc-main.c
+@@ -1773,6 +1773,7 @@ static int rc_prepare_rx_device(struct r
+       set_bit(MSC_SCAN, dev->input_dev->mscbit);
+       /* Pointer/mouse events */
++      set_bit(INPUT_PROP_POINTING_STICK, dev->input_dev->propbit);
+       set_bit(EV_REL, dev->input_dev->evbit);
+       set_bit(REL_X, dev->input_dev->relbit);
+       set_bit(REL_Y, dev->input_dev->relbit);
index 1e610df08d5257970b8fda7ffe3d5d60a33ed162..88d3533e68f5a30186f8f00152d4bb739c11cac0 100644 (file)
@@ -46,3 +46,16 @@ fuse-verify-nlink.patch
 fuse-verify-attributes.patch
 io_uring-ensure-req-submit-is-copied-when-req-is-deferred.patch
 sunrpc-avoid-rpc-delays-when-exiting-suspend.patch
+alsa-hda-realtek-enable-internal-speaker-of-asus-ux431flc.patch
+alsa-hda-realtek-enable-the-headset-mic-on-a-xiaomi-s-laptop.patch
+alsa-hda-realtek-dell-headphone-has-noise-on-unmute-for-alc236.patch
+alsa-pcm-oss-avoid-potential-buffer-overflows.patch
+alsa-hda-add-mute-led-support-for-hp-probook-645-g4.patch
+alsa-hda-modify-stream-stripe-mask-only-when-needed.patch
+input-synaptics-switch-another-x1-carbon-6-to-rmi-smbus.patch
+input-synaptics-rmi4-re-enable-irqs-in-f34v7_do_reflash.patch
+input-synaptics-rmi4-don-t-increment-rmiaddr-for-smbus-transfers.patch
+input-goodix-add-upside-down-quirk-for-teclast-x89-tablet.patch
+coresight-etm4x-fix-input-validation-for-sysfs.patch
+input-fix-memory-leak-in-psxpad_spi_probe.patch
+media-rc-mark-input-device-as-pointing-stick.patch