]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fixes for 4.14
authorSasha Levin <sashal@kernel.org>
Wed, 8 May 2019 20:23:46 +0000 (16:23 -0400)
committerSasha Levin <sashal@kernel.org>
Wed, 8 May 2019 20:23:46 +0000 (16:23 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
26 files changed:
queue-4.14/asoc-cs4270-set-auto-increment-bit-for-register-writ.patch [new file with mode: 0644]
queue-4.14/asoc-hdmi-codec-fix-s-pdif-dai.patch [new file with mode: 0644]
queue-4.14/asoc-intel-kbl-fix-wrong-number-of-channels.patch [new file with mode: 0644]
queue-4.14/asoc-nau8810-fix-the-issue-of-widget-with-prefixed-n.patch [new file with mode: 0644]
queue-4.14/asoc-nau8824-fix-the-issue-of-the-widget-with-prefix.patch [new file with mode: 0644]
queue-4.14/asoc-rockchip-pdm-fix-regmap_ops-hang-issue.patch [new file with mode: 0644]
queue-4.14/asoc-samsung-odroid-fix-clock-configuration-for-4410.patch [new file with mode: 0644]
queue-4.14/asoc-soc-pcm-fix-a-codec-fixup-issue-in-tdm-case.patch [new file with mode: 0644]
queue-4.14/asoc-tlv320aic32x4-fix-common-pins.patch [new file with mode: 0644]
queue-4.14/asoc-wm_adsp-add-locking-to-wm_adsp2_bus_error.patch [new file with mode: 0644]
queue-4.14/drm-mediatek-fix-an-error-code-in-mtk_hdmi_dt_parse_.patch [new file with mode: 0644]
queue-4.14/drm-mediatek-fix-possible-object-reference-leak.patch [new file with mode: 0644]
queue-4.14/ib-hfi1-eliminate-opcode-tests-on-mr-deref.patch [new file with mode: 0644]
queue-4.14/iommu-amd-set-exclusion-range-correctly.patch [new file with mode: 0644]
queue-4.14/linux-kernel.h-use-parentheses-around-argument-in-u6.patch [new file with mode: 0644]
queue-4.14/mips-kgdb-fix-kgdb-support-for-smp-platforms.patch [new file with mode: 0644]
queue-4.14/perf-x86-intel-fix-handling-of-wakeup_events-for-mul.patch [new file with mode: 0644]
queue-4.14/perf-x86-intel-initialize-tfa-msr.patch [new file with mode: 0644]
queue-4.14/platform-x86-pmc_atom-drop-__initconst-on-dmi-table.patch [new file with mode: 0644]
queue-4.14/rdma-vmw_pvrdma-fix-memory-leak-on-pvrdma_pci_remove.patch [new file with mode: 0644]
queue-4.14/scsi-csiostor-fix-missing-data-copy-in-csio_scsi_err.patch [new file with mode: 0644]
queue-4.14/series
queue-4.14/slab-fix-a-crash-by-reading-proc-slab_allocators.patch [new file with mode: 0644]
queue-4.14/virtio-blk-limit-number-of-hw-queues-by-nr_cpu_ids.patch [new file with mode: 0644]
queue-4.14/virtio_pci-fix-a-null-pointer-reference-in-vp_del_vq.patch [new file with mode: 0644]
queue-4.14/xtensa-fix-initialization-of-pt_regs-syscall-in-star.patch [new file with mode: 0644]

diff --git a/queue-4.14/asoc-cs4270-set-auto-increment-bit-for-register-writ.patch b/queue-4.14/asoc-cs4270-set-auto-increment-bit-for-register-writ.patch
new file mode 100644 (file)
index 0000000..441f5a8
--- /dev/null
@@ -0,0 +1,37 @@
+From 28f4e360809b9625a9db7935e183765479a2c18b Mon Sep 17 00:00:00 2001
+From: Daniel Mack <daniel@zonque.org>
+Date: Wed, 20 Mar 2019 22:41:56 +0100
+Subject: ASoC: cs4270: Set auto-increment bit for register writes
+
+[ Upstream commit f0f2338a9cfaf71db895fa989ea7234e8a9b471d ]
+
+The CS4270 does not by default increment the register address on
+consecutive writes. During normal operation it doesn't matter as all
+register accesses are done individually. At resume time after suspend,
+however, the regcache code gathers the biggest possible block of
+registers to sync and sends them one on one go.
+
+To fix this, set the INCR bit in all cases.
+
+Signed-off-by: Daniel Mack <daniel@zonque.org>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/codecs/cs4270.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c
+index 84f86745c30e9..828bc615a1908 100644
+--- a/sound/soc/codecs/cs4270.c
++++ b/sound/soc/codecs/cs4270.c
+@@ -643,6 +643,7 @@ static const struct regmap_config cs4270_regmap = {
+       .reg_defaults =         cs4270_reg_defaults,
+       .num_reg_defaults =     ARRAY_SIZE(cs4270_reg_defaults),
+       .cache_type =           REGCACHE_RBTREE,
++      .write_flag_mask =      CS4270_I2C_INCR,
+       .readable_reg =         cs4270_reg_is_readable,
+       .volatile_reg =         cs4270_reg_is_volatile,
+-- 
+2.20.1
+
diff --git a/queue-4.14/asoc-hdmi-codec-fix-s-pdif-dai.patch b/queue-4.14/asoc-hdmi-codec-fix-s-pdif-dai.patch
new file mode 100644 (file)
index 0000000..5bf5824
--- /dev/null
@@ -0,0 +1,176 @@
+From 8d0e356088a7494e95364f747ee2e780f9ee7701 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel@armlinux.org.uk>
+Date: Thu, 28 Feb 2019 15:30:34 +0000
+Subject: ASoC: hdmi-codec: fix S/PDIF DAI
+
+[ Upstream commit 2e95f984aae4cf0608d0ba2189c756f2bd50b44a ]
+
+When using the S/PDIF DAI, there is no requirement to call
+snd_soc_dai_set_fmt() as there is no DAI format definition that defines
+S/PDIF.  In any case, S/PDIF does not have separate clocks, this is
+embedded into the data stream.
+
+Consequently, when attempting to use TDA998x in S/PDIF mode, the attempt
+to configure TDA998x via the hw_params callback fails as the
+hdmi_codec_daifmt is left initialised to zero.
+
+Since the S/PDIF DAI will only be used by S/PDIF, prepare the
+hdmi_codec_daifmt structure for this format.
+
+Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
+Reviewed-by: Jyri Sarha <jsarha@ti.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/codecs/hdmi-codec.c | 118 +++++++++++++++++-----------------
+ 1 file changed, 59 insertions(+), 59 deletions(-)
+
+diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
+index cf3b905b4eadf..7406695ee5dc2 100644
+--- a/sound/soc/codecs/hdmi-codec.c
++++ b/sound/soc/codecs/hdmi-codec.c
+@@ -536,73 +536,71 @@ static int hdmi_codec_set_fmt(struct snd_soc_dai *dai,
+ {
+       struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai);
+       struct hdmi_codec_daifmt cf = { 0 };
+-      int ret = 0;
+       dev_dbg(dai->dev, "%s()\n", __func__);
+-      if (dai->id == DAI_ID_SPDIF) {
+-              cf.fmt = HDMI_SPDIF;
+-      } else {
+-              switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
+-              case SND_SOC_DAIFMT_CBM_CFM:
+-                      cf.bit_clk_master = 1;
+-                      cf.frame_clk_master = 1;
+-                      break;
+-              case SND_SOC_DAIFMT_CBS_CFM:
+-                      cf.frame_clk_master = 1;
+-                      break;
+-              case SND_SOC_DAIFMT_CBM_CFS:
+-                      cf.bit_clk_master = 1;
+-                      break;
+-              case SND_SOC_DAIFMT_CBS_CFS:
+-                      break;
+-              default:
+-                      return -EINVAL;
+-              }
++      if (dai->id == DAI_ID_SPDIF)
++              return 0;
++
++      switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
++      case SND_SOC_DAIFMT_CBM_CFM:
++              cf.bit_clk_master = 1;
++              cf.frame_clk_master = 1;
++              break;
++      case SND_SOC_DAIFMT_CBS_CFM:
++              cf.frame_clk_master = 1;
++              break;
++      case SND_SOC_DAIFMT_CBM_CFS:
++              cf.bit_clk_master = 1;
++              break;
++      case SND_SOC_DAIFMT_CBS_CFS:
++              break;
++      default:
++              return -EINVAL;
++      }
+-              switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
+-              case SND_SOC_DAIFMT_NB_NF:
+-                      break;
+-              case SND_SOC_DAIFMT_NB_IF:
+-                      cf.frame_clk_inv = 1;
+-                      break;
+-              case SND_SOC_DAIFMT_IB_NF:
+-                      cf.bit_clk_inv = 1;
+-                      break;
+-              case SND_SOC_DAIFMT_IB_IF:
+-                      cf.frame_clk_inv = 1;
+-                      cf.bit_clk_inv = 1;
+-                      break;
+-              }
++      switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
++      case SND_SOC_DAIFMT_NB_NF:
++              break;
++      case SND_SOC_DAIFMT_NB_IF:
++              cf.frame_clk_inv = 1;
++              break;
++      case SND_SOC_DAIFMT_IB_NF:
++              cf.bit_clk_inv = 1;
++              break;
++      case SND_SOC_DAIFMT_IB_IF:
++              cf.frame_clk_inv = 1;
++              cf.bit_clk_inv = 1;
++              break;
++      }
+-              switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+-              case SND_SOC_DAIFMT_I2S:
+-                      cf.fmt = HDMI_I2S;
+-                      break;
+-              case SND_SOC_DAIFMT_DSP_A:
+-                      cf.fmt = HDMI_DSP_A;
+-                      break;
+-              case SND_SOC_DAIFMT_DSP_B:
+-                      cf.fmt = HDMI_DSP_B;
+-                      break;
+-              case SND_SOC_DAIFMT_RIGHT_J:
+-                      cf.fmt = HDMI_RIGHT_J;
+-                      break;
+-              case SND_SOC_DAIFMT_LEFT_J:
+-                      cf.fmt = HDMI_LEFT_J;
+-                      break;
+-              case SND_SOC_DAIFMT_AC97:
+-                      cf.fmt = HDMI_AC97;
+-                      break;
+-              default:
+-                      dev_err(dai->dev, "Invalid DAI interface format\n");
+-                      return -EINVAL;
+-              }
++      switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
++      case SND_SOC_DAIFMT_I2S:
++              cf.fmt = HDMI_I2S;
++              break;
++      case SND_SOC_DAIFMT_DSP_A:
++              cf.fmt = HDMI_DSP_A;
++              break;
++      case SND_SOC_DAIFMT_DSP_B:
++              cf.fmt = HDMI_DSP_B;
++              break;
++      case SND_SOC_DAIFMT_RIGHT_J:
++              cf.fmt = HDMI_RIGHT_J;
++              break;
++      case SND_SOC_DAIFMT_LEFT_J:
++              cf.fmt = HDMI_LEFT_J;
++              break;
++      case SND_SOC_DAIFMT_AC97:
++              cf.fmt = HDMI_AC97;
++              break;
++      default:
++              dev_err(dai->dev, "Invalid DAI interface format\n");
++              return -EINVAL;
+       }
+       hcp->daifmt[dai->id] = cf;
+-      return ret;
++      return 0;
+ }
+ static int hdmi_codec_digital_mute(struct snd_soc_dai *dai, int mute)
+@@ -784,8 +782,10 @@ static int hdmi_codec_probe(struct platform_device *pdev)
+               i++;
+       }
+-      if (hcd->spdif)
++      if (hcd->spdif) {
+               hcp->daidrv[i] = hdmi_spdif_dai;
++              hcp->daifmt[DAI_ID_SPDIF].fmt = HDMI_SPDIF;
++      }
+       ret = snd_soc_register_codec(dev, &hdmi_codec, hcp->daidrv,
+                                    dai_count);
+-- 
+2.20.1
+
diff --git a/queue-4.14/asoc-intel-kbl-fix-wrong-number-of-channels.patch b/queue-4.14/asoc-intel-kbl-fix-wrong-number-of-channels.patch
new file mode 100644 (file)
index 0000000..18e9da9
--- /dev/null
@@ -0,0 +1,34 @@
+From b690050fbfefb8e67c14817fd49b9e8142b20ebd Mon Sep 17 00:00:00 2001
+From: Tzung-Bi Shih <tzungbi@google.com>
+Date: Mon, 8 Apr 2019 17:08:58 +0800
+Subject: ASoC: Intel: kbl: fix wrong number of channels
+
+[ Upstream commit d6ba3f815bc5f3c4249d15c8bc5fbb012651b4a4 ]
+
+Fix wrong setting on number of channels.  The context wants to set
+constraint to 2 channels instead of 4.
+
+Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
+Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
+index 69ab559564921..41cb1fefbd427 100644
+--- a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
++++ b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
+@@ -405,7 +405,7 @@ static const struct snd_pcm_hw_constraint_list constraints_dmic_channels = {
+ };
+ static const unsigned int dmic_2ch[] = {
+-      4,
++      2,
+ };
+ static const struct snd_pcm_hw_constraint_list constraints_dmic_2ch = {
+-- 
+2.20.1
+
diff --git a/queue-4.14/asoc-nau8810-fix-the-issue-of-widget-with-prefixed-n.patch b/queue-4.14/asoc-nau8810-fix-the-issue-of-widget-with-prefixed-n.patch
new file mode 100644 (file)
index 0000000..9b3a4af
--- /dev/null
@@ -0,0 +1,37 @@
+From 7d495695d67ef6bc4ee4b6907ad84a516a95e237 Mon Sep 17 00:00:00 2001
+From: John Hsu <KCHSU0@nuvoton.com>
+Date: Wed, 13 Mar 2019 16:23:44 +0800
+Subject: ASoC: nau8810: fix the issue of widget with prefixed name
+
+[ Upstream commit 54d1cf78b0f4ba348a7c7fb8b7d0708d71b6cc8a ]
+
+The driver changes the stream name of DAC and ADC to avoid the issue of
+widget with prefixed name. When the machine adds prefixed name for codec,
+the stream name of DAI may not find the widgets.
+
+Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/codecs/nau8810.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sound/soc/codecs/nau8810.c b/sound/soc/codecs/nau8810.c
+index c8e2451ae0a37..193588eb98354 100644
+--- a/sound/soc/codecs/nau8810.c
++++ b/sound/soc/codecs/nau8810.c
+@@ -414,9 +414,9 @@ static const struct snd_soc_dapm_widget nau8810_dapm_widgets[] = {
+       SND_SOC_DAPM_MIXER("Mono Mixer", NAU8810_REG_POWER3,
+               NAU8810_MOUTMX_EN_SFT, 0, &nau8810_mono_mixer_controls[0],
+               ARRAY_SIZE(nau8810_mono_mixer_controls)),
+-      SND_SOC_DAPM_DAC("DAC", "HiFi Playback", NAU8810_REG_POWER3,
++      SND_SOC_DAPM_DAC("DAC", "Playback", NAU8810_REG_POWER3,
+               NAU8810_DAC_EN_SFT, 0),
+-      SND_SOC_DAPM_ADC("ADC", "HiFi Capture", NAU8810_REG_POWER2,
++      SND_SOC_DAPM_ADC("ADC", "Capture", NAU8810_REG_POWER2,
+               NAU8810_ADC_EN_SFT, 0),
+       SND_SOC_DAPM_PGA("SpkN Out", NAU8810_REG_POWER3,
+               NAU8810_NSPK_EN_SFT, 0, NULL, 0),
+-- 
+2.20.1
+
diff --git a/queue-4.14/asoc-nau8824-fix-the-issue-of-the-widget-with-prefix.patch b/queue-4.14/asoc-nau8824-fix-the-issue-of-the-widget-with-prefix.patch
new file mode 100644 (file)
index 0000000..29b8cfe
--- /dev/null
@@ -0,0 +1,108 @@
+From a5f6d80c19d7248dfea5c29fe6df16e701942504 Mon Sep 17 00:00:00 2001
+From: John Hsu <KCHSU0@nuvoton.com>
+Date: Mon, 11 Mar 2019 09:36:45 +0800
+Subject: ASoC: nau8824: fix the issue of the widget with prefix name
+
+[ Upstream commit 844a4a362dbec166b44d6b9b3dd45b08cb273703 ]
+
+The driver has two issues when machine add prefix name for codec.
+(1)The stream name of DAI can't find the AIF widgets.
+(2)The drivr can enable/disalbe the MICBIAS and SAR widgets.
+
+The patch will fix these issues caused by prefixed name added.
+
+Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/codecs/nau8824.c | 46 +++++++++++++++++++++++++++++++-------
+ 1 file changed, 38 insertions(+), 8 deletions(-)
+
+diff --git a/sound/soc/codecs/nau8824.c b/sound/soc/codecs/nau8824.c
+index 0240759f951c7..e8ea51247b179 100644
+--- a/sound/soc/codecs/nau8824.c
++++ b/sound/soc/codecs/nau8824.c
+@@ -634,8 +634,8 @@ static const struct snd_soc_dapm_widget nau8824_dapm_widgets[] = {
+       SND_SOC_DAPM_ADC("ADCR", NULL, NAU8824_REG_ANALOG_ADC_2,
+               NAU8824_ADCR_EN_SFT, 0),
+-      SND_SOC_DAPM_AIF_OUT("AIFTX", "HiFi Capture", 0, SND_SOC_NOPM, 0, 0),
+-      SND_SOC_DAPM_AIF_IN("AIFRX", "HiFi Playback", 0, SND_SOC_NOPM, 0, 0),
++      SND_SOC_DAPM_AIF_OUT("AIFTX", "Capture", 0, SND_SOC_NOPM, 0, 0),
++      SND_SOC_DAPM_AIF_IN("AIFRX", "Playback", 0, SND_SOC_NOPM, 0, 0),
+       SND_SOC_DAPM_DAC("DACL", NULL, NAU8824_REG_RDAC,
+               NAU8824_DACL_EN_SFT, 0),
+@@ -784,6 +784,36 @@ static void nau8824_int_status_clear_all(struct regmap *regmap)
+       }
+ }
++static void nau8824_dapm_disable_pin(struct nau8824 *nau8824, const char *pin)
++{
++      struct snd_soc_dapm_context *dapm = nau8824->dapm;
++      const char *prefix = dapm->component->name_prefix;
++      char prefixed_pin[80];
++
++      if (prefix) {
++              snprintf(prefixed_pin, sizeof(prefixed_pin), "%s %s",
++                       prefix, pin);
++              snd_soc_dapm_disable_pin(dapm, prefixed_pin);
++      } else {
++              snd_soc_dapm_disable_pin(dapm, pin);
++      }
++}
++
++static void nau8824_dapm_enable_pin(struct nau8824 *nau8824, const char *pin)
++{
++      struct snd_soc_dapm_context *dapm = nau8824->dapm;
++      const char *prefix = dapm->component->name_prefix;
++      char prefixed_pin[80];
++
++      if (prefix) {
++              snprintf(prefixed_pin, sizeof(prefixed_pin), "%s %s",
++                       prefix, pin);
++              snd_soc_dapm_force_enable_pin(dapm, prefixed_pin);
++      } else {
++              snd_soc_dapm_force_enable_pin(dapm, pin);
++      }
++}
++
+ static void nau8824_eject_jack(struct nau8824 *nau8824)
+ {
+       struct snd_soc_dapm_context *dapm = nau8824->dapm;
+@@ -792,8 +822,8 @@ static void nau8824_eject_jack(struct nau8824 *nau8824)
+       /* Clear all interruption status */
+       nau8824_int_status_clear_all(regmap);
+-      snd_soc_dapm_disable_pin(dapm, "SAR");
+-      snd_soc_dapm_disable_pin(dapm, "MICBIAS");
++      nau8824_dapm_disable_pin(nau8824, "SAR");
++      nau8824_dapm_disable_pin(nau8824, "MICBIAS");
+       snd_soc_dapm_sync(dapm);
+       /* Enable the insertion interruption, disable the ejection
+@@ -822,8 +852,8 @@ static void nau8824_jdet_work(struct work_struct *work)
+       struct regmap *regmap = nau8824->regmap;
+       int adc_value, event = 0, event_mask = 0;
+-      snd_soc_dapm_force_enable_pin(dapm, "MICBIAS");
+-      snd_soc_dapm_force_enable_pin(dapm, "SAR");
++      nau8824_dapm_enable_pin(nau8824, "MICBIAS");
++      nau8824_dapm_enable_pin(nau8824, "SAR");
+       snd_soc_dapm_sync(dapm);
+       msleep(100);
+@@ -834,8 +864,8 @@ static void nau8824_jdet_work(struct work_struct *work)
+       if (adc_value < HEADSET_SARADC_THD) {
+               event |= SND_JACK_HEADPHONE;
+-              snd_soc_dapm_disable_pin(dapm, "SAR");
+-              snd_soc_dapm_disable_pin(dapm, "MICBIAS");
++              nau8824_dapm_disable_pin(nau8824, "SAR");
++              nau8824_dapm_disable_pin(nau8824, "MICBIAS");
+               snd_soc_dapm_sync(dapm);
+       } else {
+               event |= SND_JACK_HEADSET;
+-- 
+2.20.1
+
diff --git a/queue-4.14/asoc-rockchip-pdm-fix-regmap_ops-hang-issue.patch b/queue-4.14/asoc-rockchip-pdm-fix-regmap_ops-hang-issue.patch
new file mode 100644 (file)
index 0000000..cd2cc0e
--- /dev/null
@@ -0,0 +1,35 @@
+From 3de32b63c9dc581e9ce7d215eca4165761a1b6fc Mon Sep 17 00:00:00 2001
+From: Sugar Zhang <sugar.zhang@rock-chips.com>
+Date: Wed, 3 Apr 2019 21:40:45 +0800
+Subject: ASoC: rockchip: pdm: fix regmap_ops hang issue
+
+[ Upstream commit c85064435fe7a216ec0f0238ef2b8f7cd850a450 ]
+
+This is because set_fmt ops maybe called when PD is off,
+and in such case, regmap_ops will lead system hang.
+enale PD before doing regmap_ops.
+
+Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/rockchip/rockchip_pdm.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c
+index 400e29edb1c9c..8a2e3bbce3a16 100644
+--- a/sound/soc/rockchip/rockchip_pdm.c
++++ b/sound/soc/rockchip/rockchip_pdm.c
+@@ -208,7 +208,9 @@ static int rockchip_pdm_set_fmt(struct snd_soc_dai *cpu_dai,
+               return -EINVAL;
+       }
++      pm_runtime_get_sync(cpu_dai->dev);
+       regmap_update_bits(pdm->regmap, PDM_CLK_CTRL, mask, val);
++      pm_runtime_put(cpu_dai->dev);
+       return 0;
+ }
+-- 
+2.20.1
+
diff --git a/queue-4.14/asoc-samsung-odroid-fix-clock-configuration-for-4410.patch b/queue-4.14/asoc-samsung-odroid-fix-clock-configuration-for-4410.patch
new file mode 100644 (file)
index 0000000..ee6d06a
--- /dev/null
@@ -0,0 +1,47 @@
+From 9dbff01fb8cdf5540b11661a213c2a9766247f62 Mon Sep 17 00:00:00 2001
+From: Sylwester Nawrocki <s.nawrocki@samsung.com>
+Date: Tue, 12 Mar 2019 18:40:06 +0100
+Subject: ASoC: samsung: odroid: Fix clock configuration for 44100 sample rate
+
+[ Upstream commit 2b13bee3884926cba22061efa75bd315e871de24 ]
+
+After commit fbeec965b8d1c ("ASoC: samsung: odroid: Fix 32000 sample rate
+handling") the audio root clock frequency is configured improperly for
+44100 sample rate. Due to clock rate rounding it's 20070401 Hz instead
+of 22579000 Hz. This results in a too low value of the PSR clock divider
+in the CPU DAI driver and too fast actual sample rate for fs=44100. E.g.
+1 kHz tone has actual 1780 Hz frequency (1 kHz * 20070401/22579000 * 2).
+
+Fix this by increasing the correction passed to clk_set_rate() to take
+into account inaccuracy of the EPLL frequency properly.
+
+Fixes: fbeec965b8d1c ("ASoC: samsung: odroid: Fix 32000 sample rate handling")
+Reported-by: JaeChul Lee <jcsing.lee@samsung.com>
+Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/samsung/odroid.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sound/soc/samsung/odroid.c b/sound/soc/samsung/odroid.c
+index 06a31a9585a05..32c9e197ca957 100644
+--- a/sound/soc/samsung/odroid.c
++++ b/sound/soc/samsung/odroid.c
+@@ -66,11 +66,11 @@ static int odroid_card_hw_params(struct snd_pcm_substream *substream,
+               return ret;
+       /*
+-       *  We add 1 to the rclk_freq value in order to avoid too low clock
++       *  We add 2 to the rclk_freq value in order to avoid too low clock
+        *  frequency values due to the EPLL output frequency not being exact
+        *  multiple of the audio sampling rate.
+        */
+-      rclk_freq = params_rate(params) * rfs + 1;
++      rclk_freq = params_rate(params) * rfs + 2;
+       ret = clk_set_rate(priv->sclk_i2s, rclk_freq);
+       if (ret < 0)
+-- 
+2.20.1
+
diff --git a/queue-4.14/asoc-soc-pcm-fix-a-codec-fixup-issue-in-tdm-case.patch b/queue-4.14/asoc-soc-pcm-fix-a-codec-fixup-issue-in-tdm-case.patch
new file mode 100644 (file)
index 0000000..d9c93f9
--- /dev/null
@@ -0,0 +1,62 @@
+From 77062df8ececf20e860ca963ec598d8855737329 Mon Sep 17 00:00:00 2001
+From: Rander Wang <rander.wang@linux.intel.com>
+Date: Fri, 8 Mar 2019 16:38:57 +0800
+Subject: ASoC:soc-pcm:fix a codec fixup issue in TDM case
+
+[ Upstream commit 570f18b6a8d1f0e60e8caf30e66161b6438dcc91 ]
+
+On HDaudio platforms, if playback is started when capture is working,
+there is no audible output.
+
+This can be root-caused to the use of the rx|tx_mask to store an HDaudio
+stream tag.
+
+If capture is stared before playback, rx_mask would be non-zero on HDaudio
+platform, then the channel number of playback, which is in the same codec
+dai with the capture, would be changed by soc_pcm_codec_params_fixup based
+on the tx_mask at first, then overwritten by this function based on rx_mask
+at last.
+
+According to the author of tx|rx_mask, tx_mask is for playback and rx_mask
+is for capture. And stream direction is checked at all other references of
+tx|rx_mask in ASoC, so here should be an error. This patch checks stream
+direction for tx|rx_mask for fixup function.
+
+This issue would affect not only HDaudio+ASoC, but also I2S codecs if the
+channel number based on rx_mask is not equal to the one for tx_mask. It could
+be rarely reproduecd because most drivers in kernel set the same channel number
+to tx|rx_mask or rx_mask is zero.
+
+Tested on all platforms using stream_tag & HDaudio and intel I2S platforms.
+
+Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
+Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/soc-pcm.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
+index 6fc85199ac737..584b7ffe78f52 100644
+--- a/sound/soc/soc-pcm.c
++++ b/sound/soc/soc-pcm.c
+@@ -894,10 +894,13 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
+               codec_params = *params;
+               /* fixup params based on TDM slot masks */
+-              if (codec_dai->tx_mask)
++              if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
++                  codec_dai->tx_mask)
+                       soc_pcm_codec_params_fixup(&codec_params,
+                                                  codec_dai->tx_mask);
+-              if (codec_dai->rx_mask)
++
++              if (substream->stream == SNDRV_PCM_STREAM_CAPTURE &&
++                  codec_dai->rx_mask)
+                       soc_pcm_codec_params_fixup(&codec_params,
+                                                  codec_dai->rx_mask);
+-- 
+2.20.1
+
diff --git a/queue-4.14/asoc-tlv320aic32x4-fix-common-pins.patch b/queue-4.14/asoc-tlv320aic32x4-fix-common-pins.patch
new file mode 100644 (file)
index 0000000..01a1ab8
--- /dev/null
@@ -0,0 +1,33 @@
+From 930a889f7599e3e8e97c6123a0e46bdde6452a60 Mon Sep 17 00:00:00 2001
+From: Annaliese McDermond <nh6z@nh6z.net>
+Date: Sat, 30 Mar 2019 09:02:02 -0700
+Subject: ASoC: tlv320aic32x4: Fix Common Pins
+
+[ Upstream commit c63adb28f6d913310430f14c69f0a2ea55eed0cc ]
+
+The common pins were mistakenly not added to the DAPM graph.
+Adding these pins will allow valid graphs to be created.
+
+Signed-off-by: Annaliese McDermond <nh6z@nh6z.net>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/codecs/tlv320aic32x4.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
+index e694f5f04eb90..628621fc3386c 100644
+--- a/sound/soc/codecs/tlv320aic32x4.c
++++ b/sound/soc/codecs/tlv320aic32x4.c
+@@ -462,6 +462,8 @@ static const struct snd_soc_dapm_widget aic32x4_dapm_widgets[] = {
+       SND_SOC_DAPM_INPUT("IN2_R"),
+       SND_SOC_DAPM_INPUT("IN3_L"),
+       SND_SOC_DAPM_INPUT("IN3_R"),
++      SND_SOC_DAPM_INPUT("CM_L"),
++      SND_SOC_DAPM_INPUT("CM_R"),
+ };
+ static const struct snd_soc_dapm_route aic32x4_dapm_routes[] = {
+-- 
+2.20.1
+
diff --git a/queue-4.14/asoc-wm_adsp-add-locking-to-wm_adsp2_bus_error.patch b/queue-4.14/asoc-wm_adsp-add-locking-to-wm_adsp2_bus_error.patch
new file mode 100644 (file)
index 0000000..0ce4cd6
--- /dev/null
@@ -0,0 +1,67 @@
+From 1bc6cc9c9a01569adb6f971cd33868a03fa8c44d Mon Sep 17 00:00:00 2001
+From: Charles Keepax <ckeepax@opensource.cirrus.com>
+Date: Tue, 19 Mar 2019 11:52:06 +0000
+Subject: ASoC: wm_adsp: Add locking to wm_adsp2_bus_error
+
+[ Upstream commit a2225a6d155fcb247fe4c6d87f7c91807462966d ]
+
+Best to lock across handling the bus error to ensure the DSP doesn't
+change power state as we are reading the status registers.
+
+Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/codecs/wm_adsp.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
+index 67330b6ab204c..d632a0511d62a 100644
+--- a/sound/soc/codecs/wm_adsp.c
++++ b/sound/soc/codecs/wm_adsp.c
+@@ -3711,11 +3711,13 @@ irqreturn_t wm_adsp2_bus_error(struct wm_adsp *dsp)
+       struct regmap *regmap = dsp->regmap;
+       int ret = 0;
++      mutex_lock(&dsp->pwr_lock);
++
+       ret = regmap_read(regmap, dsp->base + ADSP2_LOCK_REGION_CTRL, &val);
+       if (ret) {
+               adsp_err(dsp,
+                       "Failed to read Region Lock Ctrl register: %d\n", ret);
+-              return IRQ_HANDLED;
++              goto error;
+       }
+       if (val & ADSP2_WDT_TIMEOUT_STS_MASK) {
+@@ -3734,7 +3736,7 @@ irqreturn_t wm_adsp2_bus_error(struct wm_adsp *dsp)
+                       adsp_err(dsp,
+                                "Failed to read Bus Err Addr register: %d\n",
+                                ret);
+-                      return IRQ_HANDLED;
++                      goto error;
+               }
+               adsp_err(dsp, "bus error address = 0x%x\n",
+@@ -3747,7 +3749,7 @@ irqreturn_t wm_adsp2_bus_error(struct wm_adsp *dsp)
+                       adsp_err(dsp,
+                                "Failed to read Pmem Xmem Err Addr register: %d\n",
+                                ret);
+-                      return IRQ_HANDLED;
++                      goto error;
+               }
+               adsp_err(dsp, "xmem error address = 0x%x\n",
+@@ -3760,6 +3762,9 @@ irqreturn_t wm_adsp2_bus_error(struct wm_adsp *dsp)
+       regmap_update_bits(regmap, dsp->base + ADSP2_LOCK_REGION_CTRL,
+                          ADSP2_CTRL_ERR_EINT, ADSP2_CTRL_ERR_EINT);
++error:
++      mutex_unlock(&dsp->pwr_lock);
++
+       return IRQ_HANDLED;
+ }
+ EXPORT_SYMBOL_GPL(wm_adsp2_bus_error);
+-- 
+2.20.1
+
diff --git a/queue-4.14/drm-mediatek-fix-an-error-code-in-mtk_hdmi_dt_parse_.patch b/queue-4.14/drm-mediatek-fix-an-error-code-in-mtk_hdmi_dt_parse_.patch
new file mode 100644 (file)
index 0000000..6cfa8e1
--- /dev/null
@@ -0,0 +1,33 @@
+From 82daf7f2a70576cd2573077e1575c63962570312 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Thu, 28 Mar 2019 17:31:30 +0300
+Subject: drm/mediatek: Fix an error code in mtk_hdmi_dt_parse_pdata()
+
+[ Upstream commit 2d85978341e6a32e7443d9f28639da254d53f400 ]
+
+We don't want to overwrite "ret", it already holds the correct error
+code.  The "regmap" variable might be a valid pointer as this point.
+
+Fixes: 8f83f26891e1 ("drm/mediatek: Add HDMI support")
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: CK Hu <ck.hu@mediatek.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/mediatek/mtk_hdmi.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
+index aba27ea9cea5c..a33a1918463de 100644
+--- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
++++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
+@@ -1473,7 +1473,6 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
+       if (IS_ERR(regmap))
+               ret = PTR_ERR(regmap);
+       if (ret) {
+-              ret = PTR_ERR(regmap);
+               dev_err(dev,
+                       "Failed to get system configuration registers: %d\n",
+                       ret);
+-- 
+2.20.1
+
diff --git a/queue-4.14/drm-mediatek-fix-possible-object-reference-leak.patch b/queue-4.14/drm-mediatek-fix-possible-object-reference-leak.patch
new file mode 100644 (file)
index 0000000..43d5d52
--- /dev/null
@@ -0,0 +1,46 @@
+From cb685b22b7025ac548ab17a4744473557d07f903 Mon Sep 17 00:00:00 2001
+From: Wen Yang <wen.yang99@zte.com.cn>
+Date: Thu, 4 Apr 2019 00:04:09 +0800
+Subject: drm/mediatek: fix possible object reference leak
+
+[ Upstream commit 2ae2c3316fb77dcf64275d011596b60104c45426 ]
+
+The call to of_parse_phandle returns a node pointer with refcount
+incremented thus it must be explicitly decremented after the last
+usage.
+
+Detected by coccinelle with the following warnings:
+drivers/gpu/drm/mediatek/mtk_hdmi.c:1521:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 1509, but without a corresponding object release within this function.
+drivers/gpu/drm/mediatek/mtk_hdmi.c:1524:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 1509, but without a corresponding object release within this function.
+
+Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
+Cc: CK Hu <ck.hu@mediatek.com>
+Cc: Philipp Zabel <p.zabel@pengutronix.de>
+Cc: David Airlie <airlied@linux.ie>
+Cc: Daniel Vetter <daniel@ffwll.ch>
+Cc: Matthias Brugger <matthias.bgg@gmail.com>
+Cc: dri-devel@lists.freedesktop.org
+Cc: linux-arm-kernel@lists.infradead.org
+Cc: linux-mediatek@lists.infradead.org
+Cc: linux-kernel@vger.kernel.org
+Signed-off-by: CK Hu <ck.hu@mediatek.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/mediatek/mtk_hdmi.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
+index a33a1918463de..3c69c73fbd473 100644
+--- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
++++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
+@@ -1508,6 +1508,7 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
+       of_node_put(remote);
+       hdmi->ddc_adpt = of_find_i2c_adapter_by_node(i2c_np);
++      of_node_put(i2c_np);
+       if (!hdmi->ddc_adpt) {
+               dev_err(dev, "Failed to get ddc i2c adapter by node\n");
+               return -EINVAL;
+-- 
+2.20.1
+
diff --git a/queue-4.14/ib-hfi1-eliminate-opcode-tests-on-mr-deref.patch b/queue-4.14/ib-hfi1-eliminate-opcode-tests-on-mr-deref.patch
new file mode 100644 (file)
index 0000000..55eedc7
--- /dev/null
@@ -0,0 +1,52 @@
+From 528b8365d3c1d798cd37573b6e9ac56432f20951 Mon Sep 17 00:00:00 2001
+From: Kaike Wan <kaike.wan@intel.com>
+Date: Mon, 18 Mar 2019 09:55:39 -0700
+Subject: IB/hfi1: Eliminate opcode tests on mr deref
+
+[ Upstream commit a8639a79e85c18c16c10089edd589c7948f19bbd ]
+
+When an old ack_queue entry is used to store an incoming request, it may
+need to clean up the old entry if it is still referencing the
+MR. Originally only RDMA READ request needed to reference MR on the
+responder side and therefore the opcode was tested when cleaning up the
+old entry. The introduction of tid rdma specific operations in the
+ack_queue makes the specific opcode tests wrong.  Multiple opcodes (RDMA
+READ, TID RDMA READ, and TID RDMA WRITE) may need MR ref cleanup.
+
+Remove the opcode specific tests associated with the ack_queue.
+
+Fixes: f48ad614c100 ("IB/hfi1: Move driver out of staging")
+Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
+Signed-off-by: Kaike Wan <kaike.wan@intel.com>
+Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
+Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/infiniband/hw/hfi1/rc.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/infiniband/hw/hfi1/rc.c b/drivers/infiniband/hw/hfi1/rc.c
+index d3b8cb92fd6d6..28eb7003c297e 100644
+--- a/drivers/infiniband/hw/hfi1/rc.c
++++ b/drivers/infiniband/hw/hfi1/rc.c
+@@ -2309,7 +2309,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)
+                       update_ack_queue(qp, next);
+               }
+               e = &qp->s_ack_queue[qp->r_head_ack_queue];
+-              if (e->opcode == OP(RDMA_READ_REQUEST) && e->rdma_sge.mr) {
++              if (e->rdma_sge.mr) {
+                       rvt_put_mr(e->rdma_sge.mr);
+                       e->rdma_sge.mr = NULL;
+               }
+@@ -2383,7 +2383,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)
+                       update_ack_queue(qp, next);
+               }
+               e = &qp->s_ack_queue[qp->r_head_ack_queue];
+-              if (e->opcode == OP(RDMA_READ_REQUEST) && e->rdma_sge.mr) {
++              if (e->rdma_sge.mr) {
+                       rvt_put_mr(e->rdma_sge.mr);
+                       e->rdma_sge.mr = NULL;
+               }
+-- 
+2.20.1
+
diff --git a/queue-4.14/iommu-amd-set-exclusion-range-correctly.patch b/queue-4.14/iommu-amd-set-exclusion-range-correctly.patch
new file mode 100644 (file)
index 0000000..04bfa74
--- /dev/null
@@ -0,0 +1,38 @@
+From 793eaa9dc0a96c1a018361ad39e4a6914a9cbd17 Mon Sep 17 00:00:00 2001
+From: Joerg Roedel <jroedel@suse.de>
+Date: Fri, 12 Apr 2019 12:50:31 +0200
+Subject: iommu/amd: Set exclusion range correctly
+
+[ Upstream commit 3c677d206210f53a4be972211066c0f1cd47fe12 ]
+
+The exlcusion range limit register needs to contain the
+base-address of the last page that is part of the range, as
+bits 0-11 of this register are treated as 0xfff by the
+hardware for comparisons.
+
+So correctly set the exclusion range in the hardware to the
+last page which is _in_ the range.
+
+Fixes: b2026aa2dce44 ('x86, AMD IOMMU: add functions for programming IOMMU MMIO space')
+Signed-off-by: Joerg Roedel <jroedel@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/iommu/amd_iommu_init.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
+index 91d7718625a67..3884e82d24e91 100644
+--- a/drivers/iommu/amd_iommu_init.c
++++ b/drivers/iommu/amd_iommu_init.c
+@@ -355,7 +355,7 @@ static void iommu_write_l2(struct amd_iommu *iommu, u8 address, u32 val)
+ static void iommu_set_exclusion_range(struct amd_iommu *iommu)
+ {
+       u64 start = iommu->exclusion_start & PAGE_MASK;
+-      u64 limit = (start + iommu->exclusion_length) & PAGE_MASK;
++      u64 limit = (start + iommu->exclusion_length - 1) & PAGE_MASK;
+       u64 entry;
+       if (!iommu->exclusion_start)
+-- 
+2.20.1
+
diff --git a/queue-4.14/linux-kernel.h-use-parentheses-around-argument-in-u6.patch b/queue-4.14/linux-kernel.h-use-parentheses-around-argument-in-u6.patch
new file mode 100644 (file)
index 0000000..6af0c99
--- /dev/null
@@ -0,0 +1,70 @@
+From 32489fba909859425b9646d36143e6d6c067d3fa Mon Sep 17 00:00:00 2001
+From: Jann Horn <jannh@google.com>
+Date: Fri, 29 Mar 2019 22:46:49 +0100
+Subject: linux/kernel.h: Use parentheses around argument in u64_to_user_ptr()
+
+[ Upstream commit a0fe2c6479aab5723239b315ef1b552673f434a3 ]
+
+Use parentheses around uses of the argument in u64_to_user_ptr() to
+ensure that the cast doesn't apply to part of the argument.
+
+There are existing uses of the macro of the form
+
+  u64_to_user_ptr(A + B)
+
+which expands to
+
+  (void __user *)(uintptr_t)A + B
+
+(the cast applies to the first operand of the addition, the addition
+is a pointer addition). This happens to still work as intended, the
+semantic difference doesn't cause a difference in behavior.
+
+But I want to use u64_to_user_ptr() with a ternary operator in the
+argument, like so:
+
+  u64_to_user_ptr(A ? B : C)
+
+This currently doesn't work as intended.
+
+Signed-off-by: Jann Horn <jannh@google.com>
+Signed-off-by: Borislav Petkov <bp@suse.de>
+Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
+Cc: Andrei Vagin <avagin@openvz.org>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Cc: Dan Carpenter <dan.carpenter@oracle.com>
+Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: "H. Peter Anvin" <hpa@zytor.com>
+Cc: Ingo Molnar <mingo@kernel.org>
+Cc: Jani Nikula <jani.nikula@intel.com>
+Cc: Kees Cook <keescook@chromium.org>
+Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
+Cc: NeilBrown <neilb@suse.com>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Qiaowei Ren <qiaowei.ren@intel.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: x86-ml <x86@kernel.org>
+Link: https://lkml.kernel.org/r/20190329214652.258477-1-jannh@google.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/linux/kernel.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/include/linux/kernel.h b/include/linux/kernel.h
+index 4b484ab9e1635..1c5469adaa85e 100644
+--- a/include/linux/kernel.h
++++ b/include/linux/kernel.h
+@@ -72,8 +72,8 @@
+ #define u64_to_user_ptr(x) (          \
+ {                                     \
+-      typecheck(u64, x);              \
+-      (void __user *)(uintptr_t)x;    \
++      typecheck(u64, (x));            \
++      (void __user *)(uintptr_t)(x);  \
+ }                                     \
+ )
+-- 
+2.20.1
+
diff --git a/queue-4.14/mips-kgdb-fix-kgdb-support-for-smp-platforms.patch b/queue-4.14/mips-kgdb-fix-kgdb-support-for-smp-platforms.patch
new file mode 100644 (file)
index 0000000..c4c8297
--- /dev/null
@@ -0,0 +1,53 @@
+From 0d50f7ddf51953180496b25fc620d3b1e7b6bd97 Mon Sep 17 00:00:00 2001
+From: Chong Qiao <qiaochong@loongson.cn>
+Date: Thu, 28 Mar 2019 07:08:01 +0800
+Subject: MIPS: KGDB: fix kgdb support for SMP platforms.
+
+[ Upstream commit ab8a6d821179ab9bea1a9179f535ccba6330c1ed ]
+
+KGDB_call_nmi_hook is called by other cpu through smp call.
+MIPS smp call is processed in ipi irq handler and regs is saved in
+ handle_int.
+So kgdb_call_nmi_hook get regs by get_irq_regs and regs will be passed
+ to kgdb_cpu_enter.
+
+Signed-off-by: Chong Qiao <qiaochong@loongson.cn>
+Reviewed-by: Douglas Anderson <dianders@chromium.org>
+Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
+Signed-off-by: Paul Burton <paul.burton@mips.com>
+Cc: Ralf Baechle <ralf@linux-mips.org>
+Cc: James Hogan <jhogan@kernel.org>
+Cc: Will Deacon <will.deacon@arm.com>
+Cc: Christophe Leroy <christophe.leroy@c-s.fr>
+Cc: linux-mips@vger.kernel.org
+Cc: linux-kernel@vger.kernel.org
+Cc: QiaoChong <qiaochong@loongson.cn>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/mips/kernel/kgdb.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c
+index eb6c0d582626b..2c1e30ca7ee4e 100644
+--- a/arch/mips/kernel/kgdb.c
++++ b/arch/mips/kernel/kgdb.c
+@@ -33,6 +33,7 @@
+ #include <asm/processor.h>
+ #include <asm/sigcontext.h>
+ #include <linux/uaccess.h>
++#include <asm/irq_regs.h>
+ static struct hard_trap_info {
+       unsigned char tt;       /* Trap type code for MIPS R3xxx and R4xxx */
+@@ -214,7 +215,7 @@ static void kgdb_call_nmi_hook(void *ignored)
+       old_fs = get_fs();
+       set_fs(get_ds());
+-      kgdb_nmicallback(raw_smp_processor_id(), NULL);
++      kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
+       set_fs(old_fs);
+ }
+-- 
+2.20.1
+
diff --git a/queue-4.14/perf-x86-intel-fix-handling-of-wakeup_events-for-mul.patch b/queue-4.14/perf-x86-intel-fix-handling-of-wakeup_events-for-mul.patch
new file mode 100644 (file)
index 0000000..d7f11e6
--- /dev/null
@@ -0,0 +1,59 @@
+From 6f1d4b188db02c26df39bd764ff3bf7c435953a7 Mon Sep 17 00:00:00 2001
+From: Stephane Eranian <eranian@google.com>
+Date: Wed, 6 Mar 2019 11:50:48 -0800
+Subject: perf/x86/intel: Fix handling of wakeup_events for multi-entry PEBS
+
+[ Upstream commit 583feb08e7f7ac9d533b446882eb3a54737a6dbb ]
+
+When an event is programmed with attr.wakeup_events=N (N>0), it means
+the caller is interested in getting a user level notification after
+N samples have been recorded in the kernel sampling buffer.
+
+With precise events on Intel processors, the kernel uses PEBS.
+The kernel tries minimize sampling overhead by verifying
+if the event configuration is compatible with multi-entry PEBS mode.
+If so, the kernel is notified only when the buffer has reached its threshold.
+Other PEBS operates in single-entry mode, the kenrel is notified for each
+PEBS sample.
+
+The problem is that the current implementation look at frequency
+mode and event sample_type but ignores the wakeup_events field. Thus,
+it may not be possible to receive a notification after each precise event.
+
+This patch fixes this problem by disabling multi-entry PEBS if wakeup_events
+is non-zero.
+
+Signed-off-by: Stephane Eranian <eranian@google.com>
+Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Reviewed-by: Andi Kleen <ak@linux.intel.com>
+Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
+Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
+Cc: Jiri Olsa <jolsa@redhat.com>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Vince Weaver <vincent.weaver@maine.edu>
+Cc: kan.liang@intel.com
+Link: https://lkml.kernel.org/r/20190306195048.189514-1-eranian@google.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/x86/events/intel/core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
+index 99d45660242e3..74e26803be5dd 100644
+--- a/arch/x86/events/intel/core.c
++++ b/arch/x86/events/intel/core.c
+@@ -3051,7 +3051,7 @@ static int intel_pmu_hw_config(struct perf_event *event)
+               return ret;
+       if (event->attr.precise_ip) {
+-              if (!event->attr.freq) {
++              if (!(event->attr.freq || event->attr.wakeup_events)) {
+                       event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD;
+                       if (!(event->attr.sample_type &
+                             ~intel_pmu_free_running_flags(event)))
+-- 
+2.20.1
+
diff --git a/queue-4.14/perf-x86-intel-initialize-tfa-msr.patch b/queue-4.14/perf-x86-intel-initialize-tfa-msr.patch
new file mode 100644 (file)
index 0000000..3b44a83
--- /dev/null
@@ -0,0 +1,49 @@
+From 6418f3773cb30ea5cebca4f8838b53117a671e75 Mon Sep 17 00:00:00 2001
+From: Peter Zijlstra <peterz@infradead.org>
+Date: Thu, 21 Mar 2019 13:38:49 +0100
+Subject: perf/x86/intel: Initialize TFA MSR
+
+[ Upstream commit d7262457e35dbe239659e62654e56f8ddb814bed ]
+
+Stephane reported that the TFA MSR is not initialized by the kernel,
+but the TFA bit could set by firmware or as a leftover from a kexec,
+which makes the state inconsistent.
+
+Reported-by: Stephane Eranian <eranian@google.com>
+Tested-by: Nelson DSouza <nelson.dsouza@intel.com>
+Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
+Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
+Cc: Jiri Olsa <jolsa@redhat.com>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Vince Weaver <vincent.weaver@maine.edu>
+Cc: tonyj@suse.com
+Link: https://lkml.kernel.org/r/20190321123849.GN6521@hirez.programming.kicks-ass.net
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/x86/events/intel/core.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
+index 74e26803be5dd..82ddee4ab25fd 100644
+--- a/arch/x86/events/intel/core.c
++++ b/arch/x86/events/intel/core.c
+@@ -3427,6 +3427,12 @@ static void intel_pmu_cpu_starting(int cpu)
+       cpuc->lbr_sel = NULL;
++      if (x86_pmu.flags & PMU_FL_TFA) {
++              WARN_ON_ONCE(cpuc->tfa_shadow);
++              cpuc->tfa_shadow = ~0ULL;
++              intel_set_tfa(cpuc, false);
++      }
++
+       if (x86_pmu.version > 1)
+               flip_smm_bit(&x86_pmu.attr_freeze_on_smi);
+-- 
+2.20.1
+
diff --git a/queue-4.14/platform-x86-pmc_atom-drop-__initconst-on-dmi-table.patch b/queue-4.14/platform-x86-pmc_atom-drop-__initconst-on-dmi-table.patch
new file mode 100644 (file)
index 0000000..8c17977
--- /dev/null
@@ -0,0 +1,40 @@
+From c3421a354e80af62f70b56961faa40a852ede79b Mon Sep 17 00:00:00 2001
+From: Stephen Boyd <sboyd@kernel.org>
+Date: Thu, 11 Apr 2019 10:22:43 -0700
+Subject: platform/x86: pmc_atom: Drop __initconst on dmi table
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+[ Upstream commit b995dcca7cf12f208cfd95fd9d5768dca7cccec7 ]
+
+It's used by probe and that isn't an init function. Drop this so that we
+don't get a section mismatch.
+
+Reported-by: kbuild test robot <lkp@intel.com>
+Cc: David Müller <dave.mueller@gmx.ch>
+Cc: Hans de Goede <hdegoede@redhat.com>
+Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
+Fixes: 7c2e07130090 ("clk: x86: Add system specific quirk to mark clocks as critical")
+Signed-off-by: Stephen Boyd <sboyd@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/platform/x86/pmc_atom.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/platform/x86/pmc_atom.c b/drivers/platform/x86/pmc_atom.c
+index 75f69cf0d45fa..50f2a125cd2c8 100644
+--- a/drivers/platform/x86/pmc_atom.c
++++ b/drivers/platform/x86/pmc_atom.c
+@@ -426,7 +426,7 @@ static int pmc_dbgfs_register(struct pmc_dev *pmc)
+  * Some systems need one or more of their pmc_plt_clks to be
+  * marked as critical.
+  */
+-static const struct dmi_system_id critclk_systems[] __initconst = {
++static const struct dmi_system_id critclk_systems[] = {
+       {
+               .ident = "MPL CEC1x",
+               .matches = {
+-- 
+2.20.1
+
diff --git a/queue-4.14/rdma-vmw_pvrdma-fix-memory-leak-on-pvrdma_pci_remove.patch b/queue-4.14/rdma-vmw_pvrdma-fix-memory-leak-on-pvrdma_pci_remove.patch
new file mode 100644 (file)
index 0000000..1e4f695
--- /dev/null
@@ -0,0 +1,34 @@
+From 4b57473f98d0b98d4bc777165ed32658ce9e836b Mon Sep 17 00:00:00 2001
+From: Kamal Heib <kamalheib1@gmail.com>
+Date: Wed, 3 Apr 2019 16:52:54 +0300
+Subject: RDMA/vmw_pvrdma: Fix memory leak on pvrdma_pci_remove
+
+[ Upstream commit ea7a5c706fa49273cf6d1d9def053ecb50db2076 ]
+
+Make sure to free the DSR on pvrdma_pci_remove() to avoid the memory leak.
+
+Fixes: 29c8d9eba550 ("IB: Add vmw_pvrdma driver")
+Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
+Acked-by: Adit Ranadive <aditr@vmware.com>
+Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
+index 6ce709a67959b..d549c9ffadcbb 100644
+--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
++++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
+@@ -1055,6 +1055,8 @@ static void pvrdma_pci_remove(struct pci_dev *pdev)
+       pvrdma_page_dir_cleanup(dev, &dev->cq_pdir);
+       pvrdma_page_dir_cleanup(dev, &dev->async_pdir);
+       pvrdma_free_slots(dev);
++      dma_free_coherent(&pdev->dev, sizeof(*dev->dsr), dev->dsr,
++                        dev->dsrbase);
+       iounmap(dev->regs);
+       kfree(dev->sgid_tbl);
+-- 
+2.20.1
+
diff --git a/queue-4.14/scsi-csiostor-fix-missing-data-copy-in-csio_scsi_err.patch b/queue-4.14/scsi-csiostor-fix-missing-data-copy-in-csio_scsi_err.patch
new file mode 100644 (file)
index 0000000..2bd16be
--- /dev/null
@@ -0,0 +1,38 @@
+From 167b1c596a0f32314f8c38f441986d1555f02a26 Mon Sep 17 00:00:00 2001
+From: Varun Prakash <varun@chelsio.com>
+Date: Fri, 5 Apr 2019 20:39:13 +0530
+Subject: scsi: csiostor: fix missing data copy in csio_scsi_err_handler()
+
+[ Upstream commit 5c2442fd78998af60e13aba506d103f7f43f8701 ]
+
+If scsi cmd sglist is not suitable for DDP then csiostor driver uses
+preallocated buffers for DDP, because of this data copy is required from
+DDP buffer to scsi cmd sglist before calling ->scsi_done().
+
+Signed-off-by: Varun Prakash <varun@chelsio.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/scsi/csiostor/csio_scsi.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c
+index dab0d3f9bee13..e09c7f360dbde 100644
+--- a/drivers/scsi/csiostor/csio_scsi.c
++++ b/drivers/scsi/csiostor/csio_scsi.c
+@@ -1713,8 +1713,11 @@ csio_scsi_err_handler(struct csio_hw *hw, struct csio_ioreq *req)
+       }
+ out:
+-      if (req->nsge > 0)
++      if (req->nsge > 0) {
+               scsi_dma_unmap(cmnd);
++              if (req->dcopy && (host_status == DID_OK))
++                      host_status = csio_scsi_copy_to_sgl(hw, req);
++      }
+       cmnd->result = (((host_status) << 16) | scsi_status);
+       cmnd->scsi_done(cmnd);
+-- 
+2.20.1
+
index a6de90a65b12865cf84fe8b88ed3891f0bc8cd0b..85fa3a18c3724ccfca5bc5b3c6e4e0df41ecd5e2 100644 (file)
@@ -2,3 +2,28 @@ scsi-libsas-fix-a-race-condition-when-smp-task-timeout.patch
 drivers-hv-vmbus-remove-the-undesired-put_cpu_ptr-in-hv_synic_cleanup.patch
 ubsan-fix-nasty-wbuiltin-declaration-mismatch-gcc-9-warnings.patch
 staging-greybus-power_supply-fix-prop-descriptor-request-size.patch
+asoc-hdmi-codec-fix-s-pdif-dai.patch
+asoc-soc-pcm-fix-a-codec-fixup-issue-in-tdm-case.patch
+asoc-nau8824-fix-the-issue-of-the-widget-with-prefix.patch
+asoc-nau8810-fix-the-issue-of-widget-with-prefixed-n.patch
+asoc-samsung-odroid-fix-clock-configuration-for-4410.patch
+asoc-wm_adsp-add-locking-to-wm_adsp2_bus_error.patch
+asoc-cs4270-set-auto-increment-bit-for-register-writ.patch
+ib-hfi1-eliminate-opcode-tests-on-mr-deref.patch
+mips-kgdb-fix-kgdb-support-for-smp-platforms.patch
+asoc-tlv320aic32x4-fix-common-pins.patch
+drm-mediatek-fix-an-error-code-in-mtk_hdmi_dt_parse_.patch
+perf-x86-intel-fix-handling-of-wakeup_events-for-mul.patch
+perf-x86-intel-initialize-tfa-msr.patch
+linux-kernel.h-use-parentheses-around-argument-in-u6.patch
+xtensa-fix-initialization-of-pt_regs-syscall-in-star.patch
+asoc-rockchip-pdm-fix-regmap_ops-hang-issue.patch
+slab-fix-a-crash-by-reading-proc-slab_allocators.patch
+virtio_pci-fix-a-null-pointer-reference-in-vp_del_vq.patch
+rdma-vmw_pvrdma-fix-memory-leak-on-pvrdma_pci_remove.patch
+scsi-csiostor-fix-missing-data-copy-in-csio_scsi_err.patch
+drm-mediatek-fix-possible-object-reference-leak.patch
+asoc-intel-kbl-fix-wrong-number-of-channels.patch
+virtio-blk-limit-number-of-hw-queues-by-nr_cpu_ids.patch
+platform-x86-pmc_atom-drop-__initconst-on-dmi-table.patch
+iommu-amd-set-exclusion-range-correctly.patch
diff --git a/queue-4.14/slab-fix-a-crash-by-reading-proc-slab_allocators.patch b/queue-4.14/slab-fix-a-crash-by-reading-proc-slab_allocators.patch
new file mode 100644 (file)
index 0000000..d62f09b
--- /dev/null
@@ -0,0 +1,44 @@
+From b8ded6c1e6445de30b31625729a1cc682fe5f093 Mon Sep 17 00:00:00 2001
+From: Qian Cai <cai@lca.pw>
+Date: Sat, 6 Apr 2019 18:59:01 -0400
+Subject: slab: fix a crash by reading /proc/slab_allocators
+
+[ Upstream commit fcf88917dd435c6a4cb2830cb086ee58605a1d85 ]
+
+The commit 510ded33e075 ("slab: implement slab_root_caches list")
+changes the name of the list node within "struct kmem_cache" from "list"
+to "root_caches_node", but leaks_show() still use the "list" which
+causes a crash when reading /proc/slab_allocators.
+
+You need to have CONFIG_SLAB=y and CONFIG_MEMCG=y to see the problem,
+because without MEMCG all slab caches are root caches, and the "list"
+node happens to be the right one.
+
+Fixes: 510ded33e075 ("slab: implement slab_root_caches list")
+Signed-off-by: Qian Cai <cai@lca.pw>
+Reviewed-by: Tobin C. Harding <tobin@kernel.org>
+Cc: Tejun Heo <tj@kernel.org>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ mm/slab.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/mm/slab.c b/mm/slab.c
+index f4658468b23e1..843ecea9e336b 100644
+--- a/mm/slab.c
++++ b/mm/slab.c
+@@ -4299,7 +4299,8 @@ static void show_symbol(struct seq_file *m, unsigned long address)
+ static int leaks_show(struct seq_file *m, void *p)
+ {
+-      struct kmem_cache *cachep = list_entry(p, struct kmem_cache, list);
++      struct kmem_cache *cachep = list_entry(p, struct kmem_cache,
++                                             root_caches_node);
+       struct page *page;
+       struct kmem_cache_node *n;
+       const char *name;
+-- 
+2.20.1
+
diff --git a/queue-4.14/virtio-blk-limit-number-of-hw-queues-by-nr_cpu_ids.patch b/queue-4.14/virtio-blk-limit-number-of-hw-queues-by-nr_cpu_ids.patch
new file mode 100644 (file)
index 0000000..f308e58
--- /dev/null
@@ -0,0 +1,44 @@
+From 52e38eda80014fc8fd99aef0afa6a57eebee6ea8 Mon Sep 17 00:00:00 2001
+From: Dongli Zhang <dongli.zhang@oracle.com>
+Date: Wed, 27 Mar 2019 18:36:34 +0800
+Subject: virtio-blk: limit number of hw queues by nr_cpu_ids
+
+[ Upstream commit bf348f9b78d413e75bb079462751a1d86b6de36c ]
+
+When tag_set->nr_maps is 1, the block layer limits the number of hw queues
+by nr_cpu_ids. No matter how many hw queues are used by virtio-blk, as it
+has (tag_set->nr_maps == 1), it can use at most nr_cpu_ids hw queues.
+
+In addition, specifically for pci scenario, when the 'num-queues' specified
+by qemu is more than maxcpus, virtio-blk would not be able to allocate more
+than maxcpus vectors in order to have a vector for each queue. As a result,
+it falls back into MSI-X with one vector for config and one shared for
+queues.
+
+Considering above reasons, this patch limits the number of hw queues used
+by virtio-blk by nr_cpu_ids.
+
+Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
+Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/block/virtio_blk.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
+index 68846897d2139..8767401f75e04 100644
+--- a/drivers/block/virtio_blk.c
++++ b/drivers/block/virtio_blk.c
+@@ -437,6 +437,8 @@ static int init_vq(struct virtio_blk *vblk)
+       if (err)
+               num_vqs = 1;
++      num_vqs = min_t(unsigned int, nr_cpu_ids, num_vqs);
++
+       vblk->vqs = kmalloc_array(num_vqs, sizeof(*vblk->vqs), GFP_KERNEL);
+       if (!vblk->vqs)
+               return -ENOMEM;
+-- 
+2.20.1
+
diff --git a/queue-4.14/virtio_pci-fix-a-null-pointer-reference-in-vp_del_vq.patch b/queue-4.14/virtio_pci-fix-a-null-pointer-reference-in-vp_del_vq.patch
new file mode 100644 (file)
index 0000000..0fc3aca
--- /dev/null
@@ -0,0 +1,68 @@
+From 9218e0598526f23fbd92b083fe188af306455a60 Mon Sep 17 00:00:00 2001
+From: Longpeng <longpeng2@huawei.com>
+Date: Sat, 9 Mar 2019 15:17:40 +0800
+Subject: virtio_pci: fix a NULL pointer reference in vp_del_vqs
+
+[ Upstream commit 6a8aae68c87349dbbcd46eac380bc43cdb98a13b ]
+
+If the msix_affinity_masks is alloced failed, then we'll
+try to free some resources in vp_free_vectors() that may
+access it directly.
+
+We met the following stack in our production:
+[   29.296767] BUG: unable to handle kernel NULL pointer dereference at  (null)
+[   29.311151] IP: [<ffffffffc04fe35a>] vp_free_vectors+0x6a/0x150 [virtio_pci]
+[   29.324787] PGD 0
+[   29.333224] Oops: 0000 [#1] SMP
+[...]
+[   29.425175] RIP: 0010:[<ffffffffc04fe35a>]  [<ffffffffc04fe35a>] vp_free_vectors+0x6a/0x150 [virtio_pci]
+[   29.441405] RSP: 0018:ffff9a55c2dcfa10  EFLAGS: 00010206
+[   29.453491] RAX: 0000000000000000 RBX: ffff9a55c322c400 RCX: 0000000000000000
+[   29.467488] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff9a55c322c400
+[   29.481461] RBP: ffff9a55c2dcfa20 R08: 0000000000000000 R09: ffffc1b6806ff020
+[   29.495427] R10: 0000000000000e95 R11: 0000000000aaaaaa R12: 0000000000000000
+[   29.509414] R13: 0000000000010000 R14: ffff9a55bd2d9e98 R15: ffff9a55c322c400
+[   29.523407] FS:  00007fdcba69f8c0(0000) GS:ffff9a55c2840000(0000) knlGS:0000000000000000
+[   29.538472] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+[   29.551621] CR2: 0000000000000000 CR3: 000000003ce52000 CR4: 00000000003607a0
+[   29.565886] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+[   29.580055] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
+[   29.594122] Call Trace:
+[   29.603446]  [<ffffffffc04fe8a2>] vp_request_msix_vectors+0xe2/0x260 [virtio_pci]
+[   29.618017]  [<ffffffffc04fedc5>] vp_try_to_find_vqs+0x95/0x3b0 [virtio_pci]
+[   29.632152]  [<ffffffffc04ff117>] vp_find_vqs+0x37/0xb0 [virtio_pci]
+[   29.645582]  [<ffffffffc057bf63>] init_vq+0x153/0x260 [virtio_blk]
+[   29.658831]  [<ffffffffc057c1e8>] virtblk_probe+0xe8/0x87f [virtio_blk]
+[...]
+
+Cc: Gonglei <arei.gonglei@huawei.com>
+Signed-off-by: Longpeng <longpeng2@huawei.com>
+Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
+Reviewed-by: Gonglei <arei.gonglei@huawei.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/virtio/virtio_pci_common.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
+index 1c4797e53f686..80a3704939cdc 100644
+--- a/drivers/virtio/virtio_pci_common.c
++++ b/drivers/virtio/virtio_pci_common.c
+@@ -254,9 +254,11 @@ void vp_del_vqs(struct virtio_device *vdev)
+       for (i = 0; i < vp_dev->msix_used_vectors; ++i)
+               free_irq(pci_irq_vector(vp_dev->pci_dev, i), vp_dev);
+-      for (i = 0; i < vp_dev->msix_vectors; i++)
+-              if (vp_dev->msix_affinity_masks[i])
+-                      free_cpumask_var(vp_dev->msix_affinity_masks[i]);
++      if (vp_dev->msix_affinity_masks) {
++              for (i = 0; i < vp_dev->msix_vectors; i++)
++                      if (vp_dev->msix_affinity_masks[i])
++                              free_cpumask_var(vp_dev->msix_affinity_masks[i]);
++      }
+       if (vp_dev->msix_enabled) {
+               /* Disable the vector used for configuration */
+-- 
+2.20.1
+
diff --git a/queue-4.14/xtensa-fix-initialization-of-pt_regs-syscall-in-star.patch b/queue-4.14/xtensa-fix-initialization-of-pt_regs-syscall-in-star.patch
new file mode 100644 (file)
index 0000000..c9ba24a
--- /dev/null
@@ -0,0 +1,52 @@
+From ebeb90b3b3d5dd2b5611997a3a5d2e65dcdeef77 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Wed, 3 Apr 2019 20:22:42 -0700
+Subject: xtensa: fix initialization of pt_regs::syscall in start_thread
+
+[ Upstream commit 2663147dc7465cb29040a05cc4286fdd839978b5 ]
+
+New pt_regs should indicate that there's no syscall, not that there's
+syscall #0. While at it wrap macro body in do/while and parenthesize
+macro arguments.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/xtensa/include/asm/processor.h | 21 ++++++++++++---------
+ 1 file changed, 12 insertions(+), 9 deletions(-)
+
+diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h
+index a39cd81b741ad..3a0a8a53f2e72 100644
+--- a/arch/xtensa/include/asm/processor.h
++++ b/arch/xtensa/include/asm/processor.h
+@@ -195,15 +195,18 @@ struct thread_struct {
+ /* Clearing a0 terminates the backtrace. */
+ #define start_thread(regs, new_pc, new_sp) \
+-      memset(regs, 0, sizeof(*regs)); \
+-      regs->pc = new_pc; \
+-      regs->ps = USER_PS_VALUE; \
+-      regs->areg[1] = new_sp; \
+-      regs->areg[0] = 0; \
+-      regs->wmask = 1; \
+-      regs->depc = 0; \
+-      regs->windowbase = 0; \
+-      regs->windowstart = 1;
++      do { \
++              memset((regs), 0, sizeof(*(regs))); \
++              (regs)->pc = (new_pc); \
++              (regs)->ps = USER_PS_VALUE; \
++              (regs)->areg[1] = (new_sp); \
++              (regs)->areg[0] = 0; \
++              (regs)->wmask = 1; \
++              (regs)->depc = 0; \
++              (regs)->windowbase = 0; \
++              (regs)->windowstart = 1; \
++              (regs)->syscall = NO_SYSCALL; \
++      } while (0)
+ /* Forward declaration */
+ struct task_struct;
+-- 
+2.20.1
+