]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 May 2020 13:31:58 +0000 (15:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 May 2020 13:31:58 +0000 (15:31 +0200)
added patches:
asoc-fsl_ssi-remove-explicit-register-defaults.patch
asoc-imx-spdif-fix-crash-on-suspend.patch
asoc-wm8960-fix-wm8960_sysclk_pll-mode.patch
netlink-not-trim-skb-for-mmaped-socket-when-dump.patch

queue-4.4/asoc-fsl_ssi-remove-explicit-register-defaults.patch [new file with mode: 0644]
queue-4.4/asoc-imx-spdif-fix-crash-on-suspend.patch [new file with mode: 0644]
queue-4.4/asoc-wm8960-fix-wm8960_sysclk_pll-mode.patch [new file with mode: 0644]
queue-4.4/netlink-not-trim-skb-for-mmaped-socket-when-dump.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/asoc-fsl_ssi-remove-explicit-register-defaults.patch b/queue-4.4/asoc-fsl_ssi-remove-explicit-register-defaults.patch
new file mode 100644 (file)
index 0000000..c46999d
--- /dev/null
@@ -0,0 +1,136 @@
+From 5c408fee254633a5be69505bc86c6b034f871ab4 Mon Sep 17 00:00:00 2001
+From: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>
+Date: Mon, 18 Jan 2016 20:07:44 +0100
+Subject: ASoC: fsl_ssi: remove explicit register defaults
+
+From: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
+
+commit 5c408fee254633a5be69505bc86c6b034f871ab4 upstream.
+
+There is no guarantee that on fsl_ssi module load
+SSI registers will have their power-on-reset values.
+
+In fact, if the driver is reloaded the values in
+registers will be whatever they were set to previously.
+
+However, the cache needs to be fully populated at probe
+time to avoid non-atomic allocations during register
+access.
+
+Special case here is imx21-class SSI, since
+according to datasheet it don't have SACC{ST,EN,DIS}
+regs.
+
+This fixes hard lockup on fsl_ssi module reload,
+at least in AC'97 mode.
+
+Fixes: 05cf237972fe ("ASoC: fsl_ssi: Add driver suspend and resume to support MEGA Fast")
+Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
+Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/fsl/fsl_ssi.c |   42 ++++++++++++++++++++++--------------------
+ 1 file changed, 22 insertions(+), 20 deletions(-)
+
+--- a/sound/soc/fsl/fsl_ssi.c
++++ b/sound/soc/fsl/fsl_ssi.c
+@@ -112,20 +112,6 @@ struct fsl_ssi_rxtx_reg_val {
+       struct fsl_ssi_reg_val tx;
+ };
+-static const struct reg_default fsl_ssi_reg_defaults[] = {
+-      {0x10, 0x00000000},
+-      {0x18, 0x00003003},
+-      {0x1c, 0x00000200},
+-      {0x20, 0x00000200},
+-      {0x24, 0x00040000},
+-      {0x28, 0x00040000},
+-      {0x38, 0x00000000},
+-      {0x48, 0x00000000},
+-      {0x4c, 0x00000000},
+-      {0x54, 0x00000000},
+-      {0x58, 0x00000000},
+-};
+-
+ static bool fsl_ssi_readable_reg(struct device *dev, unsigned int reg)
+ {
+       switch (reg) {
+@@ -174,8 +160,7 @@ static const struct regmap_config fsl_ss
+       .val_bits = 32,
+       .reg_stride = 4,
+       .val_format_endian = REGMAP_ENDIAN_NATIVE,
+-      .reg_defaults = fsl_ssi_reg_defaults,
+-      .num_reg_defaults = ARRAY_SIZE(fsl_ssi_reg_defaults),
++      .num_reg_defaults_raw = CCSR_SSI_SACCDIS / sizeof(uint32_t) + 1,
+       .readable_reg = fsl_ssi_readable_reg,
+       .volatile_reg = fsl_ssi_volatile_reg,
+       .writeable_reg = fsl_ssi_writeable_reg,
+@@ -184,6 +169,7 @@ static const struct regmap_config fsl_ss
+ struct fsl_ssi_soc_data {
+       bool imx;
++      bool imx21regs; /* imx21-class SSI - no SACC{ST,EN,DIS} regs */
+       bool offline_config;
+       u32 sisr_write_mask;
+ };
+@@ -285,6 +271,7 @@ static struct fsl_ssi_soc_data fsl_ssi_m
+ static struct fsl_ssi_soc_data fsl_ssi_imx21 = {
+       .imx = true,
++      .imx21regs = true,
+       .offline_config = true,
+       .sisr_write_mask = 0,
+ };
+@@ -568,8 +555,12 @@ static void fsl_ssi_setup_ac97(struct fs
+        */
+       regmap_write(regs, CCSR_SSI_SACNT,
+                       CCSR_SSI_SACNT_AC97EN | CCSR_SSI_SACNT_FV);
+-      regmap_write(regs, CCSR_SSI_SACCDIS, 0xff);
+-      regmap_write(regs, CCSR_SSI_SACCEN, 0x300);
++
++      /* no SACC{ST,EN,DIS} regs on imx21-class SSI */
++      if (!ssi_private->soc->imx21regs) {
++              regmap_write(regs, CCSR_SSI_SACCDIS, 0xff);
++              regmap_write(regs, CCSR_SSI_SACCEN, 0x300);
++      }
+       /*
+        * Enable SSI, Transmit and Receive. AC97 has to communicate with the
+@@ -1381,6 +1372,7 @@ static int fsl_ssi_probe(struct platform
+       struct resource *res;
+       void __iomem *iomem;
+       char name[64];
++      struct regmap_config regconfig = fsl_ssi_regconfig;
+       of_id = of_match_device(fsl_ssi_ids, &pdev->dev);
+       if (!of_id || !of_id->data)
+@@ -1422,15 +1414,25 @@ static int fsl_ssi_probe(struct platform
+               return PTR_ERR(iomem);
+       ssi_private->ssi_phys = res->start;
++      if (ssi_private->soc->imx21regs) {
++              /*
++               * According to datasheet imx21-class SSI
++               * don't have SACC{ST,EN,DIS} regs.
++               */
++              regconfig.max_register = CCSR_SSI_SRMSK;
++              regconfig.num_reg_defaults_raw =
++                      CCSR_SSI_SRMSK / sizeof(uint32_t) + 1;
++      }
++
+       ret = of_property_match_string(np, "clock-names", "ipg");
+       if (ret < 0) {
+               ssi_private->has_ipg_clk_name = false;
+               ssi_private->regs = devm_regmap_init_mmio(&pdev->dev, iomem,
+-                      &fsl_ssi_regconfig);
++                      &regconfig);
+       } else {
+               ssi_private->has_ipg_clk_name = true;
+               ssi_private->regs = devm_regmap_init_mmio_clk(&pdev->dev,
+-                      "ipg", iomem, &fsl_ssi_regconfig);
++                      "ipg", iomem, &regconfig);
+       }
+       if (IS_ERR(ssi_private->regs)) {
+               dev_err(&pdev->dev, "Failed to init register map\n");
diff --git a/queue-4.4/asoc-imx-spdif-fix-crash-on-suspend.patch b/queue-4.4/asoc-imx-spdif-fix-crash-on-suspend.patch
new file mode 100644 (file)
index 0000000..e9938f7
--- /dev/null
@@ -0,0 +1,39 @@
+From 9954859185c6e8359e71121037b627f1e294057d Mon Sep 17 00:00:00 2001
+From: Lars-Peter Clausen <lars@metafoo.de>
+Date: Tue, 26 Jan 2016 13:54:15 +0100
+Subject: ASoC: imx-spdif: Fix crash on suspend
+
+From: Lars-Peter Clausen <lars@metafoo.de>
+
+commit 9954859185c6e8359e71121037b627f1e294057d upstream.
+
+When registering a ASoC card the driver data of the parent device is set to
+point to the card. This driver data is used in the
+snd_soc_suspend()/resume() callbacks.
+
+The imx-spdif driver overwrites the driver data with custom data which
+causes snd_soc_suspend() to crash.  Since the custom driver is not used
+anywhere simply deleting the line which sets the custom driver data fixes
+the issue.
+
+Fixes: 43ac946922b3 ("ASoC: imx-spdif: add snd_soc_pm_ops for spdif machine driver")
+Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
+Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/fsl/imx-spdif.c |    2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/sound/soc/fsl/imx-spdif.c
++++ b/sound/soc/fsl/imx-spdif.c
+@@ -72,8 +72,6 @@ static int imx_spdif_audio_probe(struct
+               goto end;
+       }
+-      platform_set_drvdata(pdev, data);
+-
+ end:
+       of_node_put(spdif_np);
diff --git a/queue-4.4/asoc-wm8960-fix-wm8960_sysclk_pll-mode.patch b/queue-4.4/asoc-wm8960-fix-wm8960_sysclk_pll-mode.patch
new file mode 100644 (file)
index 0000000..928f75d
--- /dev/null
@@ -0,0 +1,71 @@
+From 6bb7451429084cefcb3a18fff809f7992595d2af Mon Sep 17 00:00:00 2001
+From: Stuart Henderson <stuart.henderson@cirrus.com>
+Date: Tue, 19 Jan 2016 13:09:09 +0000
+Subject: ASoC: wm8960: Fix WM8960_SYSCLK_PLL mode
+
+From: Stuart Henderson <stuart.henderson@cirrus.com>
+
+commit 6bb7451429084cefcb3a18fff809f7992595d2af upstream.
+
+With the introduction of WM8960_SYSCLK_AUTO mode, WM8960_SYSCLK_PLL mode was
+made unusable.  Ensure we're not PLL mode before trying to use MCLK.
+
+Fixes: 3176bf2d7ccd ("ASoC: wm8960: update pll and clock setting function")
+Signed-off-by: Stuart Henderson <stuart.henderson@cirrus.com>
+Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/soc/codecs/wm8960.c |   32 +++++++++++++++++---------------
+ 1 file changed, 17 insertions(+), 15 deletions(-)
+
+--- a/sound/soc/codecs/wm8960.c
++++ b/sound/soc/codecs/wm8960.c
+@@ -631,29 +631,31 @@ static int wm8960_configure_clocking(str
+               return -EINVAL;
+       }
+-      /* check if the sysclk frequency is available. */
+-      for (i = 0; i < ARRAY_SIZE(sysclk_divs); ++i) {
+-              if (sysclk_divs[i] == -1)
+-                      continue;
+-              sysclk = freq_out / sysclk_divs[i];
+-              for (j = 0; j < ARRAY_SIZE(dac_divs); ++j) {
+-                      if (sysclk == dac_divs[j] * lrclk) {
++      if (wm8960->clk_id != WM8960_SYSCLK_PLL) {
++              /* check if the sysclk frequency is available. */
++              for (i = 0; i < ARRAY_SIZE(sysclk_divs); ++i) {
++                      if (sysclk_divs[i] == -1)
++                              continue;
++                      sysclk = freq_out / sysclk_divs[i];
++                      for (j = 0; j < ARRAY_SIZE(dac_divs); ++j) {
++                              if (sysclk != dac_divs[j] * lrclk)
++                                      continue;
+                               for (k = 0; k < ARRAY_SIZE(bclk_divs); ++k)
+                                       if (sysclk == bclk * bclk_divs[k] / 10)
+                                               break;
+                               if (k != ARRAY_SIZE(bclk_divs))
+                                       break;
+                       }
++                      if (j != ARRAY_SIZE(dac_divs))
++                              break;
+               }
+-              if (j != ARRAY_SIZE(dac_divs))
+-                      break;
+-      }
+-      if (i != ARRAY_SIZE(sysclk_divs)) {
+-              goto configure_clock;
+-      } else if (wm8960->clk_id != WM8960_SYSCLK_AUTO) {
+-              dev_err(codec->dev, "failed to configure clock\n");
+-              return -EINVAL;
++              if (i != ARRAY_SIZE(sysclk_divs)) {
++                      goto configure_clock;
++              } else if (wm8960->clk_id != WM8960_SYSCLK_AUTO) {
++                      dev_err(codec->dev, "failed to configure clock\n");
++                      return -EINVAL;
++              }
+       }
+       /* get a available pll out frequency and set pll */
+       for (i = 0; i < ARRAY_SIZE(sysclk_divs); ++i) {
diff --git a/queue-4.4/netlink-not-trim-skb-for-mmaped-socket-when-dump.patch b/queue-4.4/netlink-not-trim-skb-for-mmaped-socket-when-dump.patch
new file mode 100644 (file)
index 0000000..89ad632
--- /dev/null
@@ -0,0 +1,35 @@
+From aa3a022094fac7f6e48050e139fa8a5a2e3265ce Mon Sep 17 00:00:00 2001
+From: Ken-ichirou MATSUZAWA <chamaken@gmail.com>
+Date: Fri, 29 Jan 2016 10:45:50 +0900
+Subject: netlink: not trim skb for mmaped socket when dump
+
+From: Ken-ichirou MATSUZAWA <chamaken@gmail.com>
+
+commit aa3a022094fac7f6e48050e139fa8a5a2e3265ce upstream.
+
+We should not trim skb for mmaped socket since its buf size is fixed
+and userspace will read as frame which data equals head. mmaped
+socket will not call recvmsg, means max_recvmsg_len is 0,
+skb_reserve was not called before commit: db65a3aaf29e.
+
+Fixes: db65a3aaf29e (netlink: Trim skb to alloc size to avoid MSG_TRUNC)
+Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/netlink/af_netlink.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/net/netlink/af_netlink.c
++++ b/net/netlink/af_netlink.c
+@@ -2179,7 +2179,8 @@ static int netlink_dump(struct sock *sk)
+        * reasonable static buffer based on the expected largest dump of a
+        * single netdev. The outcome is MSG_TRUNC error.
+        */
+-      skb_reserve(skb, skb_tailroom(skb) - alloc_size);
++      if (!netlink_rx_is_mmaped(sk))
++              skb_reserve(skb, skb_tailroom(skb) - alloc_size);
+       netlink_skb_set_owner_r(skb, sk);
+       if (nlk->dump_done_errno > 0)
index 45fe3ab0f7e8deac12bee036420e96ab57769b6f..9eae2a5f40d57ccf7b83bd0e03bc5ffab00b6ff0 100644 (file)
@@ -12,3 +12,7 @@ perf-hists-fix-histc_mem_dcacheline-width-setting.patch
 powerpc-perf-remove-ppmu_has_sslot-flag-for-power8.patch
 perf-x86-fix-uninitialized-value-usage.patch
 exynos4-is-fix-a-format-string-bug.patch
+asoc-wm8960-fix-wm8960_sysclk_pll-mode.patch
+asoc-imx-spdif-fix-crash-on-suspend.patch
+netlink-not-trim-skb-for-mmaped-socket-when-dump.patch
+asoc-fsl_ssi-remove-explicit-register-defaults.patch