From: Greg Kroah-Hartman Date: Thu, 30 Apr 2020 13:11:03 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v5.4.37~45 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a6a0a50cc52fa0ad822b030860ccce90599c6da7;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: asoc-q6dsp6-q6afe-dai-add-missing-channels-to-mi2s-dais.patch asoc-tas571x-disable-regulators-on-failed-probe.patch asoc-wm8960-fix-wrong-clock-after-suspend-resume.patch iio-ad7797-use-correct-attribute_group.patch nfsd-memory-corruption-in-nfsd4_lock.patch usb-dwc3-gadget-do-link-recovery-for-ss-and-ssp.patch usb-gadget-udc-bdc-remove-unnecessary-null-checks-in-bdc_req_complete.patch --- diff --git a/queue-4.19/asoc-q6dsp6-q6afe-dai-add-missing-channels-to-mi2s-dais.patch b/queue-4.19/asoc-q6dsp6-q6afe-dai-add-missing-channels-to-mi2s-dais.patch new file mode 100644 index 00000000000..8cf5d947595 --- /dev/null +++ b/queue-4.19/asoc-q6dsp6-q6afe-dai-add-missing-channels-to-mi2s-dais.patch @@ -0,0 +1,119 @@ +From 0c824ec094b5cda766c80d88c2036e28c24a4cb1 Mon Sep 17 00:00:00 2001 +From: Stephan Gerhold +Date: Wed, 15 Apr 2020 17:00:50 +0200 +Subject: ASoC: q6dsp6: q6afe-dai: add missing channels to MI2S DAIs + +From: Stephan Gerhold + +commit 0c824ec094b5cda766c80d88c2036e28c24a4cb1 upstream. + +For some reason, the MI2S DAIs do not have channels_min/max defined. +This means that snd_soc_dai_stream_valid() returns false, +i.e. the DAIs have neither valid playback nor capture stream. + +It's quite surprising that this ever worked correctly, +but in 5.7-rc1 this is now failing badly: :) + +Commit 0e9cf4c452ad ("ASoC: pcm: check if cpu-dai supports a given stream") +introduced a check for snd_soc_dai_stream_valid() before calling +hw_params(), which means that the q6i2s_hw_params() function +was never called, eventually resulting in: + + qcom-q6afe aprsvc:q6afe:4:4: no line is assigned + +... even though "qcom,sd-lines" is set in the device tree. + +Commit 9b5db059366a ("ASoC: soc-pcm: dpcm: Only allow playback/capture if supported") +now even avoids creating PCM devices if the stream is not supported, +which means that it is failing even earlier with e.g.: + + Primary MI2S: ASoC: no backend playback stream + +Avoid all that trouble by adding channels_min/max for the MI2S DAIs. + +Fixes: 24c4cbcfac09 ("ASoC: qdsp6: q6afe: Add q6afe dai driver") +Signed-off-by: Stephan Gerhold +Reviewed-by: Srinivas Kandagatla +Cc: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20200415150050.616392-1-stephan@gerhold.net +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/qcom/qdsp6/q6afe-dai.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +--- a/sound/soc/qcom/qdsp6/q6afe-dai.c ++++ b/sound/soc/qcom/qdsp6/q6afe-dai.c +@@ -899,6 +899,8 @@ static struct snd_soc_dai_driver q6afe_d + SNDRV_PCM_RATE_16000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE, ++ .channels_min = 1, ++ .channels_max = 8, + .rate_min = 8000, + .rate_max = 48000, + }, +@@ -914,6 +916,8 @@ static struct snd_soc_dai_driver q6afe_d + SNDRV_PCM_RATE_16000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE, ++ .channels_min = 1, ++ .channels_max = 8, + .rate_min = 8000, + .rate_max = 48000, + }, +@@ -928,6 +932,8 @@ static struct snd_soc_dai_driver q6afe_d + .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | + SNDRV_PCM_RATE_16000, + .formats = SNDRV_PCM_FMTBIT_S16_LE, ++ .channels_min = 1, ++ .channels_max = 8, + .rate_min = 8000, + .rate_max = 48000, + }, +@@ -943,6 +949,8 @@ static struct snd_soc_dai_driver q6afe_d + SNDRV_PCM_RATE_16000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE, ++ .channels_min = 1, ++ .channels_max = 8, + .rate_min = 8000, + .rate_max = 48000, + }, +@@ -957,6 +965,8 @@ static struct snd_soc_dai_driver q6afe_d + .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | + SNDRV_PCM_RATE_16000, + .formats = SNDRV_PCM_FMTBIT_S16_LE, ++ .channels_min = 1, ++ .channels_max = 8, + .rate_min = 8000, + .rate_max = 48000, + }, +@@ -972,6 +982,8 @@ static struct snd_soc_dai_driver q6afe_d + SNDRV_PCM_RATE_16000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE, ++ .channels_min = 1, ++ .channels_max = 8, + .rate_min = 8000, + .rate_max = 48000, + }, +@@ -986,6 +998,8 @@ static struct snd_soc_dai_driver q6afe_d + .rates = SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_8000 | + SNDRV_PCM_RATE_16000, + .formats = SNDRV_PCM_FMTBIT_S16_LE, ++ .channels_min = 1, ++ .channels_max = 8, + .rate_min = 8000, + .rate_max = 48000, + }, +@@ -1001,6 +1015,8 @@ static struct snd_soc_dai_driver q6afe_d + SNDRV_PCM_RATE_16000, + .formats = SNDRV_PCM_FMTBIT_S16_LE | + SNDRV_PCM_FMTBIT_S24_LE, ++ .channels_min = 1, ++ .channels_max = 8, + .rate_min = 8000, + .rate_max = 48000, + }, diff --git a/queue-4.19/asoc-tas571x-disable-regulators-on-failed-probe.patch b/queue-4.19/asoc-tas571x-disable-regulators-on-failed-probe.patch new file mode 100644 index 00000000000..a0d6d1b538a --- /dev/null +++ b/queue-4.19/asoc-tas571x-disable-regulators-on-failed-probe.patch @@ -0,0 +1,92 @@ +From 9df8ba7c63073508e5aa677dade48fcab6a6773e Mon Sep 17 00:00:00 2001 +From: Philipp Puschmann +Date: Tue, 14 Apr 2020 13:27:54 +0200 +Subject: ASoC: tas571x: disable regulators on failed probe + +From: Philipp Puschmann + +commit 9df8ba7c63073508e5aa677dade48fcab6a6773e upstream. + +If probe fails after enabling the regulators regulator_put is called for +each supply without having them disabled before. This produces some +warnings like + +WARNING: CPU: 0 PID: 90 at drivers/regulator/core.c:2044 _regulator_put.part.0+0x154/0x15c +[] (unwind_backtrace) from [] (show_stack+0x10/0x14) +[] (show_stack) from [] (__warn+0xd0/0xf4) +[] (__warn) from [] (warn_slowpath_fmt+0x64/0xc4) +[] (warn_slowpath_fmt) from [] (_regulator_put.part.0+0x154/0x15c) +[] (_regulator_put.part.0) from [] (regulator_put+0x28/0x38) +[] (regulator_put) from [] (regulator_bulk_free+0x28/0x38) +[] (regulator_bulk_free) from [] (release_nodes+0x1d0/0x22c) +[] (release_nodes) from [] (really_probe+0x108/0x34c) +[] (really_probe) from [] (driver_probe_device+0xb8/0x16c) +[] (driver_probe_device) from [] (device_driver_attach+0x58/0x60) +[] (device_driver_attach) from [] (__driver_attach+0x58/0xcc) +[] (__driver_attach) from [] (bus_for_each_dev+0x78/0xc0) +[] (bus_for_each_dev) from [] (bus_add_driver+0x188/0x1e0) +[] (bus_add_driver) from [] (driver_register+0x74/0x108) +[] (driver_register) from [] (i2c_register_driver+0x3c/0x88) +[] (i2c_register_driver) from [] (do_one_initcall+0x58/0x250) +[] (do_one_initcall) from [] (do_init_module+0x60/0x244) +[] (do_init_module) from [] (load_module+0x2180/0x2540) +[] (load_module) from [] (sys_finit_module+0xd0/0xe8) +[] (sys_finit_module) from [] (__sys_trace_return+0x0/0x20) + +Fixes: 3fd6e7d9a146 (ASoC: tas571x: New driver for TI TAS571x power amplifiers) +Signed-off-by: Philipp Puschmann +Link: https://lore.kernel.org/r/20200414112754.3365406-1-p.puschmann@pironex.de +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/codecs/tas571x.c | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +--- a/sound/soc/codecs/tas571x.c ++++ b/sound/soc/codecs/tas571x.c +@@ -824,8 +824,10 @@ static int tas571x_i2c_probe(struct i2c_ + + priv->regmap = devm_regmap_init(dev, NULL, client, + priv->chip->regmap_config); +- if (IS_ERR(priv->regmap)) +- return PTR_ERR(priv->regmap); ++ if (IS_ERR(priv->regmap)) { ++ ret = PTR_ERR(priv->regmap); ++ goto disable_regs; ++ } + + priv->pdn_gpio = devm_gpiod_get_optional(dev, "pdn", GPIOD_OUT_LOW); + if (IS_ERR(priv->pdn_gpio)) { +@@ -849,7 +851,7 @@ static int tas571x_i2c_probe(struct i2c_ + + ret = regmap_write(priv->regmap, TAS571X_OSC_TRIM_REG, 0); + if (ret) +- return ret; ++ goto disable_regs; + + usleep_range(50000, 60000); + +@@ -865,12 +867,20 @@ static int tas571x_i2c_probe(struct i2c_ + */ + ret = regmap_update_bits(priv->regmap, TAS571X_MVOL_REG, 1, 0); + if (ret) +- return ret; ++ goto disable_regs; + } + +- return devm_snd_soc_register_component(&client->dev, ++ ret = devm_snd_soc_register_component(&client->dev, + &priv->component_driver, + &tas571x_dai, 1); ++ if (ret) ++ goto disable_regs; ++ ++ return ret; ++ ++disable_regs: ++ regulator_bulk_disable(priv->chip->num_supply_names, priv->supplies); ++ return ret; + } + + static int tas571x_i2c_remove(struct i2c_client *client) diff --git a/queue-4.19/asoc-wm8960-fix-wrong-clock-after-suspend-resume.patch b/queue-4.19/asoc-wm8960-fix-wrong-clock-after-suspend-resume.patch new file mode 100644 index 00000000000..00e4b31adf5 --- /dev/null +++ b/queue-4.19/asoc-wm8960-fix-wrong-clock-after-suspend-resume.patch @@ -0,0 +1,40 @@ +From 1e060a453c8604311fb45ae2f84f67ed673329b4 Mon Sep 17 00:00:00 2001 +From: Shengjiu Wang +Date: Tue, 21 Apr 2020 19:28:45 +0800 +Subject: ASoC: wm8960: Fix wrong clock after suspend & resume + +From: Shengjiu Wang + +commit 1e060a453c8604311fb45ae2f84f67ed673329b4 upstream. + +After suspend & resume, wm8960_hw_params may be called when +bias_level is not SND_SOC_BIAS_ON, then wm8960_configure_clocking +is not called. But if sample rate is changed at that time, then +the output clock rate will be not correct. + +So judgement of bias_level is SND_SOC_BIAS_ON in wm8960_hw_params +is not necessary and it causes above issue. + +Fixes: 3176bf2d7ccd ("ASoC: wm8960: update pll and clock setting function") +Signed-off-by: Shengjiu Wang +Acked-by: Charles Keepax +Link: https://lore.kernel.org/r/1587468525-27514-1-git-send-email-shengjiu.wang@nxp.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/codecs/wm8960.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/sound/soc/codecs/wm8960.c ++++ b/sound/soc/codecs/wm8960.c +@@ -863,8 +863,7 @@ static int wm8960_hw_params(struct snd_p + + wm8960->is_stream_in_use[tx] = true; + +- if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_ON && +- !wm8960->is_stream_in_use[!tx]) ++ if (!wm8960->is_stream_in_use[!tx]) + return wm8960_configure_clocking(component); + + return 0; diff --git a/queue-4.19/iio-ad7797-use-correct-attribute_group.patch b/queue-4.19/iio-ad7797-use-correct-attribute_group.patch new file mode 100644 index 00000000000..2b765d893e6 --- /dev/null +++ b/queue-4.19/iio-ad7797-use-correct-attribute_group.patch @@ -0,0 +1,36 @@ +From 28535877ac5b2b84f0d394fd67a5ec71c0c48b10 Mon Sep 17 00:00:00 2001 +From: YueHaibing +Date: Tue, 10 Mar 2020 22:16:54 +0800 +Subject: iio:ad7797: Use correct attribute_group + +From: YueHaibing + +commit 28535877ac5b2b84f0d394fd67a5ec71c0c48b10 upstream. + +It should use ad7797_attribute_group in ad7797_info, +according to commit ("iio:ad7793: Add support for the ad7796 and ad7797"). + +Scale is fixed for the ad7796 and not programmable, hence +should not have the scale_available attribute. + +Fixes: fd1a8b912841 ("iio:ad7793: Add support for the ad7796 and ad7797") +Signed-off-by: YueHaibing +Reviewed-by: Lars-Peter Clausen +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/adc/ad7793.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/adc/ad7793.c ++++ b/drivers/iio/adc/ad7793.c +@@ -542,7 +542,7 @@ static const struct iio_info ad7797_info + .read_raw = &ad7793_read_raw, + .write_raw = &ad7793_write_raw, + .write_raw_get_fmt = &ad7793_write_raw_get_fmt, +- .attrs = &ad7793_attribute_group, ++ .attrs = &ad7797_attribute_group, + .validate_trigger = ad_sd_validate_trigger, + }; + diff --git a/queue-4.19/nfsd-memory-corruption-in-nfsd4_lock.patch b/queue-4.19/nfsd-memory-corruption-in-nfsd4_lock.patch new file mode 100644 index 00000000000..03f14087184 --- /dev/null +++ b/queue-4.19/nfsd-memory-corruption-in-nfsd4_lock.patch @@ -0,0 +1,37 @@ +From e1e8399eee72e9d5246d4d1bcacd793debe34dd3 Mon Sep 17 00:00:00 2001 +From: Vasily Averin +Date: Fri, 27 Mar 2020 07:50:40 +0300 +Subject: nfsd: memory corruption in nfsd4_lock() + +From: Vasily Averin + +commit e1e8399eee72e9d5246d4d1bcacd793debe34dd3 upstream. + +New struct nfsd4_blocked_lock allocated in find_or_allocate_block() +does not initialized nbl_list and nbl_lru. +If conflock allocation fails rollback can call list_del_init() +access uninitialized fields and corrupt memory. + +v2: just initialize nbl_list and nbl_lru right after nbl allocation. + +Fixes: 76d348fadff5 ("nfsd: have nfsd4_lock use blocking locks for v4.1+ lock") +Signed-off-by: Vasily Averin +Reviewed-by: Jeff Layton +Signed-off-by: Chuck Lever +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nfsd/nfs4state.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/fs/nfsd/nfs4state.c ++++ b/fs/nfsd/nfs4state.c +@@ -252,6 +252,8 @@ find_or_allocate_block(struct nfs4_locko + if (!nbl) { + nbl= kmalloc(sizeof(*nbl), GFP_KERNEL); + if (nbl) { ++ INIT_LIST_HEAD(&nbl->nbl_list); ++ INIT_LIST_HEAD(&nbl->nbl_lru); + fh_copy_shallow(&nbl->nbl_fh, fh); + locks_init_lock(&nbl->nbl_lock); + nfsd4_init_cb(&nbl->nbl_cb, lo->lo_owner.so_client, diff --git a/queue-4.19/series b/queue-4.19/series index 9bfc7f1db84..c99190dcb6f 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -2,3 +2,10 @@ remoteproc-fix-wrong-rvring-index-computation.patch mtd-cfi-fix-deadloop-in-cfi_cmdset_0002.c-do_write_buffer.patch include-uapi-linux-swab.h-fix-userspace-breakage-use-__bits_per_long-for-swap.patch binder-take-read-mode-of-mmap_sem-in-binder_alloc_free_page.patch +usb-dwc3-gadget-do-link-recovery-for-ss-and-ssp.patch +usb-gadget-udc-bdc-remove-unnecessary-null-checks-in-bdc_req_complete.patch +iio-ad7797-use-correct-attribute_group.patch +asoc-q6dsp6-q6afe-dai-add-missing-channels-to-mi2s-dais.patch +asoc-tas571x-disable-regulators-on-failed-probe.patch +asoc-wm8960-fix-wrong-clock-after-suspend-resume.patch +nfsd-memory-corruption-in-nfsd4_lock.patch diff --git a/queue-4.19/usb-dwc3-gadget-do-link-recovery-for-ss-and-ssp.patch b/queue-4.19/usb-dwc3-gadget-do-link-recovery-for-ss-and-ssp.patch new file mode 100644 index 00000000000..25aac602dd0 --- /dev/null +++ b/queue-4.19/usb-dwc3-gadget-do-link-recovery-for-ss-and-ssp.patch @@ -0,0 +1,54 @@ +From d0550cd20e52558ecf6847a0f96ebd5d944c17e4 Mon Sep 17 00:00:00 2001 +From: Thinh Nguyen +Date: Fri, 31 Jan 2020 16:25:50 -0800 +Subject: usb: dwc3: gadget: Do link recovery for SS and SSP + +From: Thinh Nguyen + +commit d0550cd20e52558ecf6847a0f96ebd5d944c17e4 upstream. + +The controller always supports link recovery for device in SS and SSP. +Remove the speed limit check. Also, when the device is in RESUME or +RESET state, it means the controller received the resume/reset request. +The driver must send the link recovery to acknowledge the request. They +are valid states for the driver to send link recovery. + +Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver") +Fixes: ee5cd41c9117 ("usb: dwc3: Update speed checks for SuperSpeedPlus") +Signed-off-by: Thinh Nguyen +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/dwc3/gadget.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +--- a/drivers/usb/dwc3/gadget.c ++++ b/drivers/usb/dwc3/gadget.c +@@ -1577,7 +1577,6 @@ static int __dwc3_gadget_wakeup(struct d + u32 reg; + + u8 link_state; +- u8 speed; + + /* + * According to the Databook Remote wakeup request should +@@ -1587,16 +1586,13 @@ static int __dwc3_gadget_wakeup(struct d + */ + reg = dwc3_readl(dwc->regs, DWC3_DSTS); + +- speed = reg & DWC3_DSTS_CONNECTSPD; +- if ((speed == DWC3_DSTS_SUPERSPEED) || +- (speed == DWC3_DSTS_SUPERSPEED_PLUS)) +- return 0; +- + link_state = DWC3_DSTS_USBLNKST(reg); + + switch (link_state) { ++ case DWC3_LINK_STATE_RESET: + case DWC3_LINK_STATE_RX_DET: /* in HS, means Early Suspend */ + case DWC3_LINK_STATE_U3: /* in HS, means SUSPEND */ ++ case DWC3_LINK_STATE_RESUME: + break; + default: + return -EINVAL; diff --git a/queue-4.19/usb-gadget-udc-bdc-remove-unnecessary-null-checks-in-bdc_req_complete.patch b/queue-4.19/usb-gadget-udc-bdc-remove-unnecessary-null-checks-in-bdc_req_complete.patch new file mode 100644 index 00000000000..ecd99f3602b --- /dev/null +++ b/queue-4.19/usb-gadget-udc-bdc-remove-unnecessary-null-checks-in-bdc_req_complete.patch @@ -0,0 +1,47 @@ +From 09b04abb70f096333bef6bc95fa600b662e7ee13 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Sat, 28 Mar 2020 18:12:46 -0700 +Subject: usb: gadget: udc: bdc: Remove unnecessary NULL checks in bdc_req_complete + +From: Nathan Chancellor + +commit 09b04abb70f096333bef6bc95fa600b662e7ee13 upstream. + +When building with Clang + -Wtautological-pointer-compare: + +drivers/usb/gadget/udc/bdc/bdc_ep.c:543:28: warning: comparison of +address of 'req->queue' equal to a null pointer is always false +[-Wtautological-pointer-compare] + if (req == NULL || &req->queue == NULL || &req->usb_req == NULL) + ~~~~~^~~~~ ~~~~ +drivers/usb/gadget/udc/bdc/bdc_ep.c:543:51: warning: comparison of +address of 'req->usb_req' equal to a null pointer is always false +[-Wtautological-pointer-compare] + if (req == NULL || &req->queue == NULL || &req->usb_req == NULL) + ~~~~~^~~~~~~ ~~~~ +2 warnings generated. + +As it notes, these statements will always evaluate to false so remove +them. + +Fixes: efed421a94e6 ("usb: gadget: Add UDC driver for Broadcom USB3.0 device controller IP BDC") +Link: https://github.com/ClangBuiltLinux/linux/issues/749 +Signed-off-by: Nathan Chancellor +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/udc/bdc/bdc_ep.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/gadget/udc/bdc/bdc_ep.c ++++ b/drivers/usb/gadget/udc/bdc/bdc_ep.c +@@ -540,7 +540,7 @@ static void bdc_req_complete(struct bdc_ + { + struct bdc *bdc = ep->bdc; + +- if (req == NULL || &req->queue == NULL || &req->usb_req == NULL) ++ if (req == NULL) + return; + + dev_dbg(bdc->dev, "%s ep:%s status:%d\n", __func__, ep->name, status);