]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.0-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2019 13:15:38 +0000 (15:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2019 13:15:38 +0000 (15:15 +0200)
added patches:
alsa-hda-hdmi-consider-eld_valid-when-reporting-jack-event.patch
alsa-hda-hdmi-read-the-pin-sense-from-register-when-repolling.patch
alsa-hda-realtek-eapd-turn-on-later.patch
alsa-hdea-realtek-headset-fixup-for-system76-gazelle-gaze14.patch
alsa-line6-toneport-fix-broken-usage-of-timer-for-delayed-execution.patch
alsa-usb-audio-fix-a-memory-leak-bug.patch
asoc-codec-hdac_hdmi-add-device_link-to-card-device.patch
asoc-fsl_esai-fix-missing-break-in-switch-statement.patch
asoc-max98090-fix-restore-of-dapm-muxes.patch
asoc-rt5677-spi-disable-16bit-spi-transfers.patch
mmc-core-fix-tag-set-memory-leak.patch
mmc-sdhci-pci-fix-byt-ocp-setting.patch
mmc-tegra-fix-ddr-signaling-for-non-ddr-modes.patch

14 files changed:
queue-5.0/alsa-hda-hdmi-consider-eld_valid-when-reporting-jack-event.patch [new file with mode: 0644]
queue-5.0/alsa-hda-hdmi-read-the-pin-sense-from-register-when-repolling.patch [new file with mode: 0644]
queue-5.0/alsa-hda-realtek-eapd-turn-on-later.patch [new file with mode: 0644]
queue-5.0/alsa-hdea-realtek-headset-fixup-for-system76-gazelle-gaze14.patch [new file with mode: 0644]
queue-5.0/alsa-line6-toneport-fix-broken-usage-of-timer-for-delayed-execution.patch [new file with mode: 0644]
queue-5.0/alsa-usb-audio-fix-a-memory-leak-bug.patch [new file with mode: 0644]
queue-5.0/asoc-codec-hdac_hdmi-add-device_link-to-card-device.patch [new file with mode: 0644]
queue-5.0/asoc-fsl_esai-fix-missing-break-in-switch-statement.patch [new file with mode: 0644]
queue-5.0/asoc-max98090-fix-restore-of-dapm-muxes.patch [new file with mode: 0644]
queue-5.0/asoc-rt5677-spi-disable-16bit-spi-transfers.patch [new file with mode: 0644]
queue-5.0/mmc-core-fix-tag-set-memory-leak.patch [new file with mode: 0644]
queue-5.0/mmc-sdhci-pci-fix-byt-ocp-setting.patch [new file with mode: 0644]
queue-5.0/mmc-tegra-fix-ddr-signaling-for-non-ddr-modes.patch [new file with mode: 0644]
queue-5.0/series

diff --git a/queue-5.0/alsa-hda-hdmi-consider-eld_valid-when-reporting-jack-event.patch b/queue-5.0/alsa-hda-hdmi-consider-eld_valid-when-reporting-jack-event.patch
new file mode 100644 (file)
index 0000000..02c6884
--- /dev/null
@@ -0,0 +1,58 @@
+From 7f641e26a6df9269cb25dd7a4b0a91d6586ed441 Mon Sep 17 00:00:00 2001
+From: Hui Wang <hui.wang@canonical.com>
+Date: Mon, 6 May 2019 22:09:32 +0800
+Subject: ALSA: hda/hdmi - Consider eld_valid when reporting jack event
+
+From: Hui Wang <hui.wang@canonical.com>
+
+commit 7f641e26a6df9269cb25dd7a4b0a91d6586ed441 upstream.
+
+On the machines with AMD GPU or Nvidia GPU, we often meet this issue:
+after s3, there are 4 HDMI/DP audio devices in the gnome-sound-setting
+even there is no any monitors plugged.
+
+When this problem happens, we check the /proc/asound/cardX/eld#N.M, we
+will find the monitor_present=1, eld_valid=0.
+
+The root cause is BIOS or GPU driver makes the PRESENCE valid even no
+monitor plugged, and of course the driver will not get the valid
+eld_data subsequently.
+
+In this situation, we should not report the jack_plugged event, to do
+so, let us change the function hdmi_present_sense_via_verbs(). In this
+function, it reads the pin_sense via snd_hda_pin_sense(), after
+calling this function, the jack_dirty is 0, and before exiting
+via_verbs(), we change the shadow pin_sense according to both
+monitor_present and eld_valid, then in the snd_hda_jack_report_sync(),
+since the jack_dirty is still 0, it will report jack event according
+to this modified shadow pin_sense.
+
+After this change, the driver will not report Jack_is_plugged event
+through hdmi_present_sense_via_verbs() if monitor_present is 1 and
+eld_valid is 0.
+
+Signed-off-by: Hui Wang <hui.wang@canonical.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_hdmi.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/sound/pci/hda/patch_hdmi.c
++++ b/sound/pci/hda/patch_hdmi.c
+@@ -1548,9 +1548,11 @@ static bool hdmi_present_sense_via_verbs
+       ret = !repoll || !eld->monitor_present || eld->eld_valid;
+       jack = snd_hda_jack_tbl_get(codec, pin_nid);
+-      if (jack)
++      if (jack) {
+               jack->block_report = !ret;
+-
++              jack->pin_sense = (eld->monitor_present && eld->eld_valid) ?
++                      AC_PINSENSE_PRESENCE : 0;
++      }
+       mutex_unlock(&per_pin->lock);
+       return ret;
+ }
diff --git a/queue-5.0/alsa-hda-hdmi-read-the-pin-sense-from-register-when-repolling.patch b/queue-5.0/alsa-hda-hdmi-read-the-pin-sense-from-register-when-repolling.patch
new file mode 100644 (file)
index 0000000..1593e31
--- /dev/null
@@ -0,0 +1,45 @@
+From 8c2e6728c2bf95765b724e07d0278ae97cd1ee0d Mon Sep 17 00:00:00 2001
+From: Hui Wang <hui.wang@canonical.com>
+Date: Mon, 6 May 2019 22:09:31 +0800
+Subject: ALSA: hda/hdmi - Read the pin sense from register when repolling
+
+From: Hui Wang <hui.wang@canonical.com>
+
+commit 8c2e6728c2bf95765b724e07d0278ae97cd1ee0d upstream.
+
+The driver will check the monitor presence when resuming from suspend,
+starting poll or interrupt triggers. In these 3 situations, the
+jack_dirty will be set to 1 first, then the hda_jack.c reads the
+pin_sense from register, after reading the register, the jack_dirty
+will be set to 0. But hdmi_repoll_work() is enabled in these 3
+situations, It will read the pin_sense a couple of times subsequently,
+since the jack_dirty is 0 now, It does not read the register anymore,
+instead it uses the shadow pin_sense which is read at the first time.
+
+It is meaningless to check the shadow pin_sense a couple of times,
+we need to read the register to check the real plugging state, so
+we set the jack_dirty to 1 in the hdmi_repoll_work().
+
+Signed-off-by: Hui Wang <hui.wang@canonical.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_hdmi.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/sound/pci/hda/patch_hdmi.c
++++ b/sound/pci/hda/patch_hdmi.c
+@@ -1660,6 +1660,11 @@ static void hdmi_repoll_eld(struct work_
+       container_of(to_delayed_work(work), struct hdmi_spec_per_pin, work);
+       struct hda_codec *codec = per_pin->codec;
+       struct hdmi_spec *spec = codec->spec;
++      struct hda_jack_tbl *jack;
++
++      jack = snd_hda_jack_tbl_get(codec, per_pin->pin_nid);
++      if (jack)
++              jack->jack_dirty = 1;
+       if (per_pin->repoll_count++ > 6)
+               per_pin->repoll_count = 0;
diff --git a/queue-5.0/alsa-hda-realtek-eapd-turn-on-later.patch b/queue-5.0/alsa-hda-realtek-eapd-turn-on-later.patch
new file mode 100644 (file)
index 0000000..f42feeb
--- /dev/null
@@ -0,0 +1,40 @@
+From 607ca3bd220f4022e6f5356026b19dafc363863a Mon Sep 17 00:00:00 2001
+From: Kailang Yang <kailang@realtek.com>
+Date: Fri, 26 Apr 2019 16:35:41 +0800
+Subject: ALSA: hda/realtek - EAPD turn on later
+
+From: Kailang Yang <kailang@realtek.com>
+
+commit 607ca3bd220f4022e6f5356026b19dafc363863a upstream.
+
+Let EAPD turn on after set pin output.
+
+[ NOTE: This change is supposed to reduce the possible click noises at
+  (runtime) PM resume.  The functionality should be same (i.e. the
+  verbs are executed correctly) no matter which order is, so this
+  should be safe to apply for all codecs -- tiwai ]
+
+Signed-off-by: Kailang Yang <kailang@realtek.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -803,11 +803,10 @@ static int alc_init(struct hda_codec *co
+       if (spec->init_hook)
+               spec->init_hook(codec);
++      snd_hda_gen_init(codec);
+       alc_fix_pll(codec);
+       alc_auto_init_amp(codec, spec->init_amp);
+-      snd_hda_gen_init(codec);
+-
+       snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
+       return 0;
diff --git a/queue-5.0/alsa-hdea-realtek-headset-fixup-for-system76-gazelle-gaze14.patch b/queue-5.0/alsa-hdea-realtek-headset-fixup-for-system76-gazelle-gaze14.patch
new file mode 100644 (file)
index 0000000..ff79843
--- /dev/null
@@ -0,0 +1,36 @@
+From 80a5052db75131423b67f38b21958555d7d970e4 Mon Sep 17 00:00:00 2001
+From: Jeremy Soller <jeremy@system76.com>
+Date: Tue, 7 May 2019 17:11:08 -0400
+Subject: ALSA: hdea/realtek - Headset fixup for System76 Gazelle (gaze14)
+
+From: Jeremy Soller <jeremy@system76.com>
+
+commit 80a5052db75131423b67f38b21958555d7d970e4 upstream.
+
+On the System76 Gazelle (gaze14), there is a headset microphone input
+attached to 0x1a that does not have a jack detect. In order to get it
+working, the pin configuration needs to be set correctly, and the
+ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC fixup needs to be applied. This is
+identical to the patch already applied for the System76 Darter Pro
+(darp5).
+
+Signed-off-by: Jeremy Soller <jeremy@system76.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/pci/hda/patch_realtek.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/sound/pci/hda/patch_realtek.c
++++ b/sound/pci/hda/patch_realtek.c
+@@ -6930,6 +6930,8 @@ static const struct snd_pci_quirk alc269
+       SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
+       SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
+       SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
++      SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
++      SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
+       SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
+       SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
diff --git a/queue-5.0/alsa-line6-toneport-fix-broken-usage-of-timer-for-delayed-execution.patch b/queue-5.0/alsa-line6-toneport-fix-broken-usage-of-timer-for-delayed-execution.patch
new file mode 100644 (file)
index 0000000..b20f3ac
--- /dev/null
@@ -0,0 +1,77 @@
+From 7f84ff68be05ec7a5d2acf8fdc734fe5897af48f Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Wed, 8 May 2019 15:01:24 +0200
+Subject: ALSA: line6: toneport: Fix broken usage of timer for delayed execution
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 7f84ff68be05ec7a5d2acf8fdc734fe5897af48f upstream.
+
+The line6 toneport driver has code for some delayed initialization,
+and this hits the kernel Oops because mutex and other sleepable
+functions are used in the timer callback.  Fix the abuse by a delayed
+work instead so that everything works gracefully.
+
+Reported-by: syzbot+a07d0142e74fdd595cfb@syzkaller.appspotmail.com
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/line6/toneport.c |   16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
+
+--- a/sound/usb/line6/toneport.c
++++ b/sound/usb/line6/toneport.c
+@@ -54,8 +54,8 @@ struct usb_line6_toneport {
+       /* Firmware version (x 100) */
+       u8 firmware_version;
+-      /* Timer for delayed PCM startup */
+-      struct timer_list timer;
++      /* Work for delayed PCM startup */
++      struct delayed_work pcm_work;
+       /* Device type */
+       enum line6_device_type type;
+@@ -241,9 +241,10 @@ static int snd_toneport_source_put(struc
+       return 1;
+ }
+-static void toneport_start_pcm(struct timer_list *t)
++static void toneport_start_pcm(struct work_struct *work)
+ {
+-      struct usb_line6_toneport *toneport = from_timer(toneport, t, timer);
++      struct usb_line6_toneport *toneport =
++              container_of(work, struct usb_line6_toneport, pcm_work.work);
+       struct usb_line6 *line6 = &toneport->line6;
+       line6_pcm_acquire(line6->line6pcm, LINE6_STREAM_MONITOR, true);
+@@ -393,7 +394,8 @@ static int toneport_setup(struct usb_lin
+       if (toneport_has_led(toneport))
+               toneport_update_led(toneport);
+-      mod_timer(&toneport->timer, jiffies + TONEPORT_PCM_DELAY * HZ);
++      schedule_delayed_work(&toneport->pcm_work,
++                            msecs_to_jiffies(TONEPORT_PCM_DELAY * 1000));
+       return 0;
+ }
+@@ -405,7 +407,7 @@ static void line6_toneport_disconnect(st
+       struct usb_line6_toneport *toneport =
+               (struct usb_line6_toneport *)line6;
+-      del_timer_sync(&toneport->timer);
++      cancel_delayed_work_sync(&toneport->pcm_work);
+       if (toneport_has_led(toneport))
+               toneport_remove_leds(toneport);
+@@ -422,7 +424,7 @@ static int toneport_init(struct usb_line
+       struct usb_line6_toneport *toneport =  (struct usb_line6_toneport *) line6;
+       toneport->type = id->driver_info;
+-      timer_setup(&toneport->timer, toneport_start_pcm, 0);
++      INIT_DELAYED_WORK(&toneport->pcm_work, toneport_start_pcm);
+       line6->disconnect = line6_toneport_disconnect;
diff --git a/queue-5.0/alsa-usb-audio-fix-a-memory-leak-bug.patch b/queue-5.0/alsa-usb-audio-fix-a-memory-leak-bug.patch
new file mode 100644 (file)
index 0000000..7c35382
--- /dev/null
@@ -0,0 +1,40 @@
+From cb5173594d50c72b7bfa14113dfc5084b4d2f726 Mon Sep 17 00:00:00 2001
+From: Wenwen Wang <wang6495@umn.edu>
+Date: Sat, 27 Apr 2019 01:06:46 -0500
+Subject: ALSA: usb-audio: Fix a memory leak bug
+
+From: Wenwen Wang <wang6495@umn.edu>
+
+commit cb5173594d50c72b7bfa14113dfc5084b4d2f726 upstream.
+
+In parse_audio_selector_unit(), the string array 'namelist' is allocated
+through kmalloc_array(), and each string pointer in this array, i.e.,
+'namelist[]', is allocated through kmalloc() in the following for loop.
+Then, a control instance 'kctl' is created by invoking snd_ctl_new1(). If
+an error occurs during the creation process, the string array 'namelist',
+including all string pointers in the array 'namelist[]', should be freed,
+before the error code ENOMEM is returned. However, the current code does
+not free 'namelist[]', resulting in memory leaks.
+
+To fix the above issue, free all string pointers 'namelist[]' in a loop.
+
+Signed-off-by: Wenwen Wang <wang6495@umn.edu>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/mixer.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/sound/usb/mixer.c
++++ b/sound/usb/mixer.c
+@@ -2679,6 +2679,8 @@ static int parse_audio_selector_unit(str
+       kctl = snd_ctl_new1(&mixer_selectunit_ctl, cval);
+       if (! kctl) {
+               usb_audio_err(state->chip, "cannot malloc kcontrol\n");
++              for (i = 0; i < desc->bNrInPins; i++)
++                      kfree(namelist[i]);
+               kfree(namelist);
+               kfree(cval);
+               return -ENOMEM;
diff --git a/queue-5.0/asoc-codec-hdac_hdmi-add-device_link-to-card-device.patch b/queue-5.0/asoc-codec-hdac_hdmi-add-device_link-to-card-device.patch
new file mode 100644 (file)
index 0000000..f6690da
--- /dev/null
@@ -0,0 +1,47 @@
+From 01c8327667c249818d3712c3e25c7ad2aca7f389 Mon Sep 17 00:00:00 2001
+From: Libin Yang <libin.yang@intel.com>
+Date: Sat, 13 Apr 2019 21:18:12 +0800
+Subject: ASoC: codec: hdac_hdmi add device_link to card device
+
+From: Libin Yang <libin.yang@intel.com>
+
+commit 01c8327667c249818d3712c3e25c7ad2aca7f389 upstream.
+
+In resume from S3, HDAC HDMI codec driver dapm event callback may be
+operated before HDMI codec driver turns on the display audio power
+domain because of the contest between display driver and hdmi codec driver.
+
+This patch adds the device_link between soc card device (consumer) and
+hdmi codec device (supplier) to make sure the sequence is always correct.
+
+Signed-off-by: Libin Yang <libin.yang@intel.com>
+Reviewed-by: Takashi Iwai <tiwai@suse.de>
+Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/hdac_hdmi.c |   11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+--- a/sound/soc/codecs/hdac_hdmi.c
++++ b/sound/soc/codecs/hdac_hdmi.c
+@@ -1872,6 +1872,17 @@ static int hdmi_codec_probe(struct snd_s
+       hdmi->card = dapm->card->snd_card;
+       /*
++       * Setup a device_link between card device and HDMI codec device.
++       * The card device is the consumer and the HDMI codec device is
++       * the supplier. With this setting, we can make sure that the audio
++       * domain in display power will be always turned on before operating
++       * on the HDMI audio codec registers.
++       * Let's use the flag DL_FLAG_AUTOREMOVE_CONSUMER. This can make
++       * sure the device link is freed when the machine driver is removed.
++       */
++      device_link_add(component->card->dev, &hdev->dev, DL_FLAG_RPM_ACTIVE |
++                      DL_FLAG_AUTOREMOVE_CONSUMER);
++      /*
+        * hdac_device core already sets the state to active and calls
+        * get_noresume. So enable runtime and set the device to suspend.
+        */
diff --git a/queue-5.0/asoc-fsl_esai-fix-missing-break-in-switch-statement.patch b/queue-5.0/asoc-fsl_esai-fix-missing-break-in-switch-statement.patch
new file mode 100644 (file)
index 0000000..cfae3ee
--- /dev/null
@@ -0,0 +1,34 @@
+From 903c220b1ece12f17c868e43f2243b8f81ff2d4c Mon Sep 17 00:00:00 2001
+From: "S.j. Wang" <shengjiu.wang@nxp.com>
+Date: Sun, 28 Apr 2019 02:24:27 +0000
+Subject: ASoC: fsl_esai: Fix missing break in switch statement
+
+From: S.j. Wang <shengjiu.wang@nxp.com>
+
+commit 903c220b1ece12f17c868e43f2243b8f81ff2d4c upstream.
+
+case ESAI_HCKT_EXTAL and case ESAI_HCKR_EXTAL should be
+independent of each other, so replace fall-through with break.
+
+Fixes: 43d24e76b698 ("ASoC: fsl_esai: Add ESAI CPU DAI driver")
+Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
+Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/fsl/fsl_esai.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/soc/fsl/fsl_esai.c
++++ b/sound/soc/fsl/fsl_esai.c
+@@ -251,7 +251,7 @@ static int fsl_esai_set_dai_sysclk(struc
+               break;
+       case ESAI_HCKT_EXTAL:
+               ecr |= ESAI_ECR_ETI;
+-              /* fall through */
++              break;
+       case ESAI_HCKR_EXTAL:
+               ecr |= ESAI_ECR_ERI;
+               break;
diff --git a/queue-5.0/asoc-max98090-fix-restore-of-dapm-muxes.patch b/queue-5.0/asoc-max98090-fix-restore-of-dapm-muxes.patch
new file mode 100644 (file)
index 0000000..3c054d5
--- /dev/null
@@ -0,0 +1,53 @@
+From ecb2795c08bc825ebd604997e5be440b060c5b18 Mon Sep 17 00:00:00 2001
+From: Jon Hunter <jonathanh@nvidia.com>
+Date: Wed, 1 May 2019 15:29:38 +0100
+Subject: ASoC: max98090: Fix restore of DAPM Muxes
+
+From: Jon Hunter <jonathanh@nvidia.com>
+
+commit ecb2795c08bc825ebd604997e5be440b060c5b18 upstream.
+
+The max98090 driver defines 3 DAPM muxes; one for the right line output
+(LINMOD Mux), one for the left headphone mixer source (MIXHPLSEL Mux)
+and one for the right headphone mixer source (MIXHPRSEL Mux). The same
+bit is used for the mux as well as the DAPM enable, and although the mux
+can be correctly configured, after playback has completed, the mux will
+be reset during the disable phase. This is preventing the state of these
+muxes from being saved and restored correctly on system reboot. Fix this
+by marking these muxes as SND_SOC_NOPM.
+
+Note this has been verified this on the Tegra124 Nyan Big which features
+the MAX98090 codec.
+
+Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/max98090.c |   12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+--- a/sound/soc/codecs/max98090.c
++++ b/sound/soc/codecs/max98090.c
+@@ -1209,14 +1209,14 @@ static const struct snd_soc_dapm_widget
+               &max98090_right_rcv_mixer_controls[0],
+               ARRAY_SIZE(max98090_right_rcv_mixer_controls)),
+-      SND_SOC_DAPM_MUX("LINMOD Mux", M98090_REG_LOUTR_MIXER,
+-              M98090_LINMOD_SHIFT, 0, &max98090_linmod_mux),
++      SND_SOC_DAPM_MUX("LINMOD Mux", SND_SOC_NOPM, 0, 0,
++              &max98090_linmod_mux),
+-      SND_SOC_DAPM_MUX("MIXHPLSEL Mux", M98090_REG_HP_CONTROL,
+-              M98090_MIXHPLSEL_SHIFT, 0, &max98090_mixhplsel_mux),
++      SND_SOC_DAPM_MUX("MIXHPLSEL Mux", SND_SOC_NOPM, 0, 0,
++              &max98090_mixhplsel_mux),
+-      SND_SOC_DAPM_MUX("MIXHPRSEL Mux", M98090_REG_HP_CONTROL,
+-              M98090_MIXHPRSEL_SHIFT, 0, &max98090_mixhprsel_mux),
++      SND_SOC_DAPM_MUX("MIXHPRSEL Mux", SND_SOC_NOPM, 0, 0,
++              &max98090_mixhprsel_mux),
+       SND_SOC_DAPM_PGA("HP Left Out", M98090_REG_OUTPUT_ENABLE,
+               M98090_HPLEN_SHIFT, 0, NULL, 0),
diff --git a/queue-5.0/asoc-rt5677-spi-disable-16bit-spi-transfers.patch b/queue-5.0/asoc-rt5677-spi-disable-16bit-spi-transfers.patch
new file mode 100644 (file)
index 0000000..e9da77a
--- /dev/null
@@ -0,0 +1,131 @@
+From a46eb523220e242affb9a6bc9bb8efc05f4f7459 Mon Sep 17 00:00:00 2001
+From: Curtis Malainey <cujomalainey@chromium.org>
+Date: Fri, 3 May 2019 12:32:14 -0700
+Subject: ASoC: RT5677-SPI: Disable 16Bit SPI Transfers
+
+From: Curtis Malainey <cujomalainey@chromium.org>
+
+commit a46eb523220e242affb9a6bc9bb8efc05f4f7459 upstream.
+
+The current algorithm allows 3 types of transfers, 16bit, 32bit and
+burst. According to Realtek, 16bit transfers have a special restriction
+in that it is restricted to the memory region of
+0x18020000 ~ 0x18021000. This region is the memory location of the I2C
+registers. The current algorithm does not uphold this restriction and
+therefore fails to complete writes.
+
+Since this has been broken for some time it likely no one is using it.
+Better to simply disable the 16 bit writes. This will allow users to
+properly load firmware over SPI without data corruption.
+
+Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
+Reviewed-by: Ben Zhang <benzh@chromium.org>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/rt5677-spi.c |   35 ++++++++++++++++-------------------
+ 1 file changed, 16 insertions(+), 19 deletions(-)
+
+--- a/sound/soc/codecs/rt5677-spi.c
++++ b/sound/soc/codecs/rt5677-spi.c
+@@ -57,13 +57,15 @@ static DEFINE_MUTEX(spi_mutex);
+  * RT5677_SPI_READ/WRITE_32:  Transfer 4 bytes
+  * RT5677_SPI_READ/WRITE_BURST:       Transfer any multiples of 8 bytes
+  *
+- * For example, reading 260 bytes at 0x60030002 uses the following commands:
+- * 0x60030002 RT5677_SPI_READ_16      2 bytes
++ * Note:
++ * 16 Bit writes and reads are restricted to the address range
++ * 0x18020000 ~ 0x18021000
++ *
++ * For example, reading 256 bytes at 0x60030004 uses the following commands:
+  * 0x60030004 RT5677_SPI_READ_32      4 bytes
+  * 0x60030008 RT5677_SPI_READ_BURST   240 bytes
+  * 0x600300F8 RT5677_SPI_READ_BURST   8 bytes
+  * 0x60030100 RT5677_SPI_READ_32      4 bytes
+- * 0x60030104 RT5677_SPI_READ_16      2 bytes
+  *
+  * Input:
+  * @read: true for read commands; false for write commands
+@@ -78,15 +80,13 @@ static u8 rt5677_spi_select_cmd(bool rea
+ {
+       u8 cmd;
+-      if (align == 2 || align == 6 || remain == 2) {
+-              cmd = RT5677_SPI_READ_16;
+-              *len = 2;
+-      } else if (align == 4 || remain <= 6) {
++      if (align == 4 || remain <= 4) {
+               cmd = RT5677_SPI_READ_32;
+               *len = 4;
+       } else {
+               cmd = RT5677_SPI_READ_BURST;
+-              *len = min_t(u32, remain & ~7, RT5677_SPI_BURST_LEN);
++              *len = (((remain - 1) >> 3) + 1) << 3;
++              *len = min_t(u32, *len, RT5677_SPI_BURST_LEN);
+       }
+       return read ? cmd : cmd + 1;
+ }
+@@ -107,7 +107,7 @@ static void rt5677_spi_reverse(u8 *dst,
+       }
+ }
+-/* Read DSP address space using SPI. addr and len have to be 2-byte aligned. */
++/* Read DSP address space using SPI. addr and len have to be 4-byte aligned. */
+ int rt5677_spi_read(u32 addr, void *rxbuf, size_t len)
+ {
+       u32 offset;
+@@ -123,7 +123,7 @@ int rt5677_spi_read(u32 addr, void *rxbu
+       if (!g_spi)
+               return -ENODEV;
+-      if ((addr & 1) || (len & 1)) {
++      if ((addr & 3) || (len & 3)) {
+               dev_err(&g_spi->dev, "Bad read align 0x%x(%zu)\n", addr, len);
+               return -EACCES;
+       }
+@@ -158,13 +158,13 @@ int rt5677_spi_read(u32 addr, void *rxbu
+ }
+ EXPORT_SYMBOL_GPL(rt5677_spi_read);
+-/* Write DSP address space using SPI. addr has to be 2-byte aligned.
+- * If len is not 2-byte aligned, an extra byte of zero is written at the end
++/* Write DSP address space using SPI. addr has to be 4-byte aligned.
++ * If len is not 4-byte aligned, then extra zeros are written at the end
+  * as padding.
+  */
+ int rt5677_spi_write(u32 addr, const void *txbuf, size_t len)
+ {
+-      u32 offset, len_with_pad = len;
++      u32 offset;
+       int status = 0;
+       struct spi_transfer t;
+       struct spi_message m;
+@@ -177,22 +177,19 @@ int rt5677_spi_write(u32 addr, const voi
+       if (!g_spi)
+               return -ENODEV;
+-      if (addr & 1) {
++      if (addr & 3) {
+               dev_err(&g_spi->dev, "Bad write align 0x%x(%zu)\n", addr, len);
+               return -EACCES;
+       }
+-      if (len & 1)
+-              len_with_pad = len + 1;
+-
+       memset(&t, 0, sizeof(t));
+       t.tx_buf = buf;
+       t.speed_hz = RT5677_SPI_FREQ;
+       spi_message_init_with_transfers(&m, &t, 1);
+-      for (offset = 0; offset < len_with_pad;) {
++      for (offset = 0; offset < len;) {
+               spi_cmd = rt5677_spi_select_cmd(false, (addr + offset) & 7,
+-                              len_with_pad - offset, &t.len);
++                              len - offset, &t.len);
+               /* Construct SPI message header */
+               buf[0] = spi_cmd;
diff --git a/queue-5.0/mmc-core-fix-tag-set-memory-leak.patch b/queue-5.0/mmc-core-fix-tag-set-memory-leak.patch
new file mode 100644 (file)
index 0000000..4be867e
--- /dev/null
@@ -0,0 +1,35 @@
+From 43d8dabb4074cf7f3b1404bfbaeba5aa6f3e5cfc Mon Sep 17 00:00:00 2001
+From: Raul E Rangel <rrangel@chromium.org>
+Date: Thu, 2 May 2019 13:07:14 -0600
+Subject: mmc: core: Fix tag set memory leak
+
+From: Raul E Rangel <rrangel@chromium.org>
+
+commit 43d8dabb4074cf7f3b1404bfbaeba5aa6f3e5cfc upstream.
+
+The tag set is allocated in mmc_init_queue but never freed. This results
+in a memory leak. This change makes sure we free the tag set when the
+queue is also freed.
+
+Signed-off-by: Raul E Rangel <rrangel@chromium.org>
+Reviewed-by: Jens Axboe <axboe@kernel.dk>
+Acked-by: Adrian Hunter <adrian.hunter@intel.com>
+Fixes: 81196976ed94 ("mmc: block: Add blk-mq support")
+Cc: stable@vger.kernel.org
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/core/queue.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/mmc/core/queue.c
++++ b/drivers/mmc/core/queue.c
+@@ -473,6 +473,7 @@ void mmc_cleanup_queue(struct mmc_queue
+               blk_mq_unquiesce_queue(q);
+       blk_cleanup_queue(q);
++      blk_mq_free_tag_set(&mq->tag_set);
+       /*
+        * A request can be completed before the next request, potentially
diff --git a/queue-5.0/mmc-sdhci-pci-fix-byt-ocp-setting.patch b/queue-5.0/mmc-sdhci-pci-fix-byt-ocp-setting.patch
new file mode 100644 (file)
index 0000000..a6d7307
--- /dev/null
@@ -0,0 +1,185 @@
+From 0a49a619e7e1aeb3f5f5511ca59314423c83dae2 Mon Sep 17 00:00:00 2001
+From: Adrian Hunter <adrian.hunter@intel.com>
+Date: Mon, 6 May 2019 11:38:53 +0300
+Subject: mmc: sdhci-pci: Fix BYT OCP setting
+
+From: Adrian Hunter <adrian.hunter@intel.com>
+
+commit 0a49a619e7e1aeb3f5f5511ca59314423c83dae2 upstream.
+
+Some time ago, a fix was done for the sdhci-acpi driver, refer
+commit 6e1c7d6103fe ("mmc: sdhci-acpi: Reduce Baytrail eMMC/SD/SDIO
+hangs"). The same issue was not expected to affect the sdhci-pci driver,
+but there have been reports to the contrary, so make the same hardware
+setting change.
+
+This patch applies to v5.0+ but before that backports will be required.
+
+Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/host/Kconfig          |    1 
+ drivers/mmc/host/sdhci-pci-core.c |   96 ++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 97 insertions(+)
+
+--- a/drivers/mmc/host/Kconfig
++++ b/drivers/mmc/host/Kconfig
+@@ -92,6 +92,7 @@ config MMC_SDHCI_PCI
+       tristate "SDHCI support on PCI bus"
+       depends on MMC_SDHCI && PCI
+       select MMC_CQHCI
++      select IOSF_MBI if X86
+       help
+         This selects the PCI Secure Digital Host Controller Interface.
+         Most controllers found today are PCI devices.
+--- a/drivers/mmc/host/sdhci-pci-core.c
++++ b/drivers/mmc/host/sdhci-pci-core.c
+@@ -31,6 +31,10 @@
+ #include <linux/mmc/sdhci-pci-data.h>
+ #include <linux/acpi.h>
++#ifdef CONFIG_X86
++#include <asm/iosf_mbi.h>
++#endif
++
+ #include "cqhci.h"
+ #include "sdhci.h"
+@@ -451,6 +455,50 @@ static const struct sdhci_pci_fixes sdhc
+       .probe_slot     = pch_hc_probe_slot,
+ };
++#ifdef CONFIG_X86
++
++#define BYT_IOSF_SCCEP                        0x63
++#define BYT_IOSF_OCP_NETCTRL0         0x1078
++#define BYT_IOSF_OCP_TIMEOUT_BASE     GENMASK(10, 8)
++
++static void byt_ocp_setting(struct pci_dev *pdev)
++{
++      u32 val = 0;
++
++      if (pdev->device != PCI_DEVICE_ID_INTEL_BYT_EMMC &&
++          pdev->device != PCI_DEVICE_ID_INTEL_BYT_SDIO &&
++          pdev->device != PCI_DEVICE_ID_INTEL_BYT_SD &&
++          pdev->device != PCI_DEVICE_ID_INTEL_BYT_EMMC2)
++              return;
++
++      if (iosf_mbi_read(BYT_IOSF_SCCEP, MBI_CR_READ, BYT_IOSF_OCP_NETCTRL0,
++                        &val)) {
++              dev_err(&pdev->dev, "%s read error\n", __func__);
++              return;
++      }
++
++      if (!(val & BYT_IOSF_OCP_TIMEOUT_BASE))
++              return;
++
++      val &= ~BYT_IOSF_OCP_TIMEOUT_BASE;
++
++      if (iosf_mbi_write(BYT_IOSF_SCCEP, MBI_CR_WRITE, BYT_IOSF_OCP_NETCTRL0,
++                         val)) {
++              dev_err(&pdev->dev, "%s write error\n", __func__);
++              return;
++      }
++
++      dev_dbg(&pdev->dev, "%s completed\n", __func__);
++}
++
++#else
++
++static inline void byt_ocp_setting(struct pci_dev *pdev)
++{
++}
++
++#endif
++
+ enum {
+       INTEL_DSM_FNS           =  0,
+       INTEL_DSM_V18_SWITCH    =  3,
+@@ -715,6 +763,8 @@ static void byt_probe_slot(struct sdhci_
+       byt_read_dsm(slot);
++      byt_ocp_setting(slot->chip->pdev);
++
+       ops->execute_tuning = intel_execute_tuning;
+       ops->start_signal_voltage_switch = intel_start_signal_voltage_switch;
+@@ -938,7 +988,35 @@ static int byt_sd_probe_slot(struct sdhc
+       return 0;
+ }
++#ifdef CONFIG_PM_SLEEP
++
++static int byt_resume(struct sdhci_pci_chip *chip)
++{
++      byt_ocp_setting(chip->pdev);
++
++      return sdhci_pci_resume_host(chip);
++}
++
++#endif
++
++#ifdef CONFIG_PM
++
++static int byt_runtime_resume(struct sdhci_pci_chip *chip)
++{
++      byt_ocp_setting(chip->pdev);
++
++      return sdhci_pci_runtime_resume_host(chip);
++}
++
++#endif
++
+ static const struct sdhci_pci_fixes sdhci_intel_byt_emmc = {
++#ifdef CONFIG_PM_SLEEP
++      .resume         = byt_resume,
++#endif
++#ifdef CONFIG_PM
++      .runtime_resume = byt_runtime_resume,
++#endif
+       .allow_runtime_pm = true,
+       .probe_slot     = byt_emmc_probe_slot,
+       .quirks         = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC |
+@@ -972,6 +1050,12 @@ static const struct sdhci_pci_fixes sdhc
+ };
+ static const struct sdhci_pci_fixes sdhci_ni_byt_sdio = {
++#ifdef CONFIG_PM_SLEEP
++      .resume         = byt_resume,
++#endif
++#ifdef CONFIG_PM
++      .runtime_resume = byt_runtime_resume,
++#endif
+       .quirks         = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC |
+                         SDHCI_QUIRK_NO_LED,
+       .quirks2        = SDHCI_QUIRK2_HOST_OFF_CARD_ON |
+@@ -983,6 +1067,12 @@ static const struct sdhci_pci_fixes sdhc
+ };
+ static const struct sdhci_pci_fixes sdhci_intel_byt_sdio = {
++#ifdef CONFIG_PM_SLEEP
++      .resume         = byt_resume,
++#endif
++#ifdef CONFIG_PM
++      .runtime_resume = byt_runtime_resume,
++#endif
+       .quirks         = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC |
+                         SDHCI_QUIRK_NO_LED,
+       .quirks2        = SDHCI_QUIRK2_HOST_OFF_CARD_ON |
+@@ -994,6 +1084,12 @@ static const struct sdhci_pci_fixes sdhc
+ };
+ static const struct sdhci_pci_fixes sdhci_intel_byt_sd = {
++#ifdef CONFIG_PM_SLEEP
++      .resume         = byt_resume,
++#endif
++#ifdef CONFIG_PM
++      .runtime_resume = byt_runtime_resume,
++#endif
+       .quirks         = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC |
+                         SDHCI_QUIRK_NO_LED,
+       .quirks2        = SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON |
diff --git a/queue-5.0/mmc-tegra-fix-ddr-signaling-for-non-ddr-modes.patch b/queue-5.0/mmc-tegra-fix-ddr-signaling-for-non-ddr-modes.patch
new file mode 100644 (file)
index 0000000..94ab177
--- /dev/null
@@ -0,0 +1,40 @@
+From 92cd1667d579af5c3ef383680598a112da3695df Mon Sep 17 00:00:00 2001
+From: Sowjanya Komatineni <skomatineni@nvidia.com>
+Date: Sat, 23 Mar 2019 21:45:18 -0700
+Subject: mmc: tegra: fix ddr signaling for non-ddr modes
+
+From: Sowjanya Komatineni <skomatineni@nvidia.com>
+
+commit 92cd1667d579af5c3ef383680598a112da3695df upstream.
+
+ddr_signaling is set to true for DDR50 and DDR52 modes but is
+not set back to false for other modes. This programs incorrect
+host clock when mode change happens from DDR52/DDR50 to other
+SDR or HS modes like incase of mmc_retune where it switches
+from HS400 to HS DDR and then from HS DDR to HS mode and then
+to HS200.
+
+This patch fixes the ddr_signaling to set properly for non DDR
+modes.
+
+Tested-by: Jon Hunter <jonathanh@nvidia.com>
+Acked-by: Adrian Hunter <adrian.hunter@intel.com>
+Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
+Cc: stable@vger.kernel.org # v4.20 +
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mmc/host/sdhci-tegra.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/mmc/host/sdhci-tegra.c
++++ b/drivers/mmc/host/sdhci-tegra.c
+@@ -675,6 +675,7 @@ static void tegra_sdhci_set_uhs_signalin
+       bool set_dqs_trim = false;
+       bool do_hs400_dll_cal = false;
++      tegra_host->ddr_signaling = false;
+       switch (timing) {
+       case MMC_TIMING_UHS_SDR50:
+       case MMC_TIMING_UHS_SDR104:
index 928c99864c177fb3cc7a21871b90498d0332f204..63492e14385495f360d3f36478cf0c9e50e61333 100644 (file)
@@ -41,3 +41,16 @@ crypto-caam-qi2-fix-dma-mapping-of-stack-memory.patch
 crypto-caam-qi2-generate-hash-keys-in-place.patch
 crypto-arm-aes-neonbs-don-t-access-already-freed-walk.iv.patch
 crypto-arm64-aes-neonbs-don-t-access-already-freed-walk.iv.patch
+mmc-tegra-fix-ddr-signaling-for-non-ddr-modes.patch
+mmc-core-fix-tag-set-memory-leak.patch
+mmc-sdhci-pci-fix-byt-ocp-setting.patch
+alsa-line6-toneport-fix-broken-usage-of-timer-for-delayed-execution.patch
+alsa-usb-audio-fix-a-memory-leak-bug.patch
+alsa-hda-hdmi-read-the-pin-sense-from-register-when-repolling.patch
+alsa-hda-hdmi-consider-eld_valid-when-reporting-jack-event.patch
+alsa-hda-realtek-eapd-turn-on-later.patch
+alsa-hdea-realtek-headset-fixup-for-system76-gazelle-gaze14.patch
+asoc-max98090-fix-restore-of-dapm-muxes.patch
+asoc-rt5677-spi-disable-16bit-spi-transfers.patch
+asoc-fsl_esai-fix-missing-break-in-switch-statement.patch
+asoc-codec-hdac_hdmi-add-device_link-to-card-device.patch