From: Greg Kroah-Hartman Date: Mon, 4 May 2020 13:31:58 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v4.4.222~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2452a73cad830ebf08738f2f5add6e2ab808d937;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches 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 --- 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 index 00000000000..c46999de396 --- /dev/null +++ b/queue-4.4/asoc-fsl_ssi-remove-explicit-register-defaults.patch @@ -0,0 +1,136 @@ +From 5c408fee254633a5be69505bc86c6b034f871ab4 Mon Sep 17 00:00:00 2001 +From: "Maciej S. Szmigiero" +Date: Mon, 18 Jan 2016 20:07:44 +0100 +Subject: ASoC: fsl_ssi: remove explicit register defaults + +From: Maciej S. Szmigiero + +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 +Tested-by: Fabio Estevam +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + 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); ++ ®config); + } 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, ®config); + } + 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 index 00000000000..e9938f7f7c7 --- /dev/null +++ b/queue-4.4/asoc-imx-spdif-fix-crash-on-suspend.patch @@ -0,0 +1,39 @@ +From 9954859185c6e8359e71121037b627f1e294057d Mon Sep 17 00:00:00 2001 +From: Lars-Peter Clausen +Date: Tue, 26 Jan 2016 13:54:15 +0100 +Subject: ASoC: imx-spdif: Fix crash on suspend + +From: Lars-Peter Clausen + +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 +Signed-off-by: Lars-Peter Clausen +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..928f75d77c1 --- /dev/null +++ b/queue-4.4/asoc-wm8960-fix-wm8960_sysclk_pll-mode.patch @@ -0,0 +1,71 @@ +From 6bb7451429084cefcb3a18fff809f7992595d2af Mon Sep 17 00:00:00 2001 +From: Stuart Henderson +Date: Tue, 19 Jan 2016 13:09:09 +0000 +Subject: ASoC: wm8960: Fix WM8960_SYSCLK_PLL mode + +From: Stuart Henderson + +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 +Reviewed-by: Charles Keepax +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..89ad6328c75 --- /dev/null +++ b/queue-4.4/netlink-not-trim-skb-for-mmaped-socket-when-dump.patch @@ -0,0 +1,35 @@ +From aa3a022094fac7f6e48050e139fa8a5a2e3265ce Mon Sep 17 00:00:00 2001 +From: Ken-ichirou MATSUZAWA +Date: Fri, 29 Jan 2016 10:45:50 +0900 +Subject: netlink: not trim skb for mmaped socket when dump + +From: Ken-ichirou MATSUZAWA + +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 +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + 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) diff --git a/queue-4.4/series b/queue-4.4/series index 45fe3ab0f7e..9eae2a5f40d 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -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