From: Greg Kroah-Hartman Date: Mon, 28 Aug 2017 07:01:35 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v3.18.68~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=518a858a47bc0f920bd7402d2f364fbc7ccc10a2;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: asoc-rsnd-add-missing-initialization-of-adg-req_rate.patch asoc-rsnd-avoid-pointless-loop-in-rsnd_mod_interrupt.patch asoc-rsnd-don-t-call-update-callback-if-it-was-null.patch asoc-rsnd-ssi-24bit-data-needs-right-aligned-settings.patch --- diff --git a/queue-4.4/asoc-rsnd-add-missing-initialization-of-adg-req_rate.patch b/queue-4.4/asoc-rsnd-add-missing-initialization-of-adg-req_rate.patch new file mode 100644 index 00000000000..88423bf456e --- /dev/null +++ b/queue-4.4/asoc-rsnd-add-missing-initialization-of-adg-req_rate.patch @@ -0,0 +1,42 @@ +From 8b27418f300cafbdbbb8cfa9c29d398ed34d6723 Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Wed, 28 Oct 2015 16:03:48 +0100 +Subject: ASoC: rsnd: Add missing initialization of ADG req_rate + +From: Geert Uytterhoeven + +commit 8b27418f300cafbdbbb8cfa9c29d398ed34d6723 upstream. + +If the "clock-frequency" DT property is not found, req_rate is used +uninitialized, and the "audio_clkout" clock will be created with an +arbitrary clock rate. + +This uninitialized kernel stack data may leak to userspace through +/sys/kernel/debug/clk/clk_summary, cfr. the value in the "rate" column: + + clock enable_cnt prepare_cnt rate accuracy phase + -------------------------------------------------------------------- + audio_clkout 0 0 4001836240 0 0 + +Signed-off-by: Geert Uytterhoeven +Acked-by: Kuninori Morimoto +Signed-off-by: Mark Brown +Signed-off-by: Thong Ho +Signed-off-by: Nhan Nguyen +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/sh/rcar/adg.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/soc/sh/rcar/adg.c ++++ b/sound/soc/sh/rcar/adg.c +@@ -437,7 +437,7 @@ static void rsnd_adg_get_clkout(struct r + struct device *dev = rsnd_priv_to_dev(priv); + struct device_node *np = dev->of_node; + u32 ckr, rbgx, rbga, rbgb; +- u32 rate, req_rate, div; ++ u32 rate, req_rate = 0, div; + uint32_t count = 0; + unsigned long req_48kHz_rate, req_441kHz_rate; + int i; diff --git a/queue-4.4/asoc-rsnd-avoid-pointless-loop-in-rsnd_mod_interrupt.patch b/queue-4.4/asoc-rsnd-avoid-pointless-loop-in-rsnd_mod_interrupt.patch new file mode 100644 index 00000000000..38433162b6c --- /dev/null +++ b/queue-4.4/asoc-rsnd-avoid-pointless-loop-in-rsnd_mod_interrupt.patch @@ -0,0 +1,60 @@ +From 2daf71ad8da6cb57f919c9c876ee7e42530371df Mon Sep 17 00:00:00 2001 +From: Kuninori Morimoto +Date: Mon, 26 Oct 2015 08:41:53 +0000 +Subject: ASoC: rsnd: avoid pointless loop in rsnd_mod_interrupt() + +From: Kuninori Morimoto + +commit 2daf71ad8da6cb57f919c9c876ee7e42530371df upstream. + +Current Renesas sound driver doesn't have 1:1 relationship between +stream <-> mod because it is supporting MIX. Because of this reason +rsnd_mod_interrupt() is searching correspond mod by for loop. +But this loop is not needed, because each mod has own type. +This patch avoid pointless loop by using mod->type. + +This patch is good for SSI-parent support, because stream might have +2 SSI as SSI-parent/child. SSI interrupt handler will be called twice +if stream has SSI-parent without this patch. + +Signed-off-by: Kuninori Morimoto +Signed-off-by: Mark Brown +Signed-off-by: Thong Ho +Signed-off-by: Nhan Nguyen +Signed-off-by: Greg Kroah-Hartman + + +--- + sound/soc/sh/rcar/core.c | 19 ++++++++----------- + 1 file changed, 8 insertions(+), 11 deletions(-) + +--- a/sound/soc/sh/rcar/core.c ++++ b/sound/soc/sh/rcar/core.c +@@ -192,19 +192,16 @@ void rsnd_mod_interrupt(struct rsnd_mod + struct rsnd_priv *priv = rsnd_mod_to_priv(mod); + struct rsnd_dai_stream *io; + struct rsnd_dai *rdai; +- int i, j; ++ int i; + +- for_each_rsnd_dai(rdai, priv, j) { ++ for_each_rsnd_dai(rdai, priv, i) { ++ io = &rdai->playback; ++ if (mod == io->mod[mod->type]) ++ callback(mod, io); + +- for (i = 0; i < RSND_MOD_MAX; i++) { +- io = &rdai->playback; +- if (mod == io->mod[i]) +- callback(mod, io); +- +- io = &rdai->capture; +- if (mod == io->mod[i]) +- callback(mod, io); +- } ++ io = &rdai->capture; ++ if (mod == io->mod[mod->type]) ++ callback(mod, io); + } + } + diff --git a/queue-4.4/asoc-rsnd-don-t-call-update-callback-if-it-was-null.patch b/queue-4.4/asoc-rsnd-don-t-call-update-callback-if-it-was-null.patch new file mode 100644 index 00000000000..5b67466f52a --- /dev/null +++ b/queue-4.4/asoc-rsnd-don-t-call-update-callback-if-it-was-null.patch @@ -0,0 +1,30 @@ +From d7289565483c65094d0473555625a4acd89567d3 Mon Sep 17 00:00:00 2001 +From: Kuninori Morimoto +Date: Thu, 25 Feb 2016 05:51:12 +0000 +Subject: ASoC: rsnd: don't call update callback if it was NULL + +From: Kuninori Morimoto + +commit d7289565483c65094d0473555625a4acd89567d3 upstream. + +Signed-off-by: Kuninori Morimoto +Signed-off-by: Mark Brown +Signed-off-by: Thong Ho +Signed-off-by: Nhan Nguyen +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/sh/rcar/core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/soc/sh/rcar/core.c ++++ b/sound/soc/sh/rcar/core.c +@@ -1016,7 +1016,7 @@ static int rsnd_kctrl_put(struct snd_kco + } + } + +- if (change) ++ if (change && cfg->update) + cfg->update(cfg->io, mod); + + return change; diff --git a/queue-4.4/asoc-rsnd-ssi-24bit-data-needs-right-aligned-settings.patch b/queue-4.4/asoc-rsnd-ssi-24bit-data-needs-right-aligned-settings.patch new file mode 100644 index 00000000000..23b4645c651 --- /dev/null +++ b/queue-4.4/asoc-rsnd-ssi-24bit-data-needs-right-aligned-settings.patch @@ -0,0 +1,42 @@ +From f46a93b820eb3707faf238cd769a004e2504515f Mon Sep 17 00:00:00 2001 +From: Kuninori Morimoto +Date: Tue, 17 Nov 2015 08:28:11 +0000 +Subject: ASoC: rsnd: ssi: 24bit data needs right-aligned settings + +From: Kuninori Morimoto + +commit f46a93b820eb3707faf238cd769a004e2504515f upstream. + +Data left/right aligned is controlled by PDTA bit on SSICR. +But default is left-aligned. Thus 24bit sound will be very small sound +without this patch. + +Signed-off-by: Kuninori Morimoto +Signed-off-by: Mark Brown +Signed-off-by: Thong Ho +Signed-off-by: Nhan Nguyen +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/sh/rcar/ssi.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/sound/soc/sh/rcar/ssi.c ++++ b/sound/soc/sh/rcar/ssi.c +@@ -39,6 +39,7 @@ + #define SCKP (1 << 13) /* Serial Bit Clock Polarity */ + #define SWSP (1 << 12) /* Serial WS Polarity */ + #define SDTA (1 << 10) /* Serial Data Alignment */ ++#define PDTA (1 << 9) /* Parallel Data Alignment */ + #define DEL (1 << 8) /* Serial Data Delay */ + #define CKDV(v) (v << 4) /* Serial Clock Division Ratio */ + #define TRMD (1 << 1) /* Transmit/Receive Mode Select */ +@@ -286,7 +287,7 @@ static int rsnd_ssi_init(struct rsnd_mod + struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); + u32 cr; + +- cr = FORCE; ++ cr = FORCE | PDTA; + + /* + * always use 32bit system word for easy clock calculation. diff --git a/queue-4.4/series b/queue-4.4/series index ec4c8f68a4c..ebbaa5930f3 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -43,3 +43,7 @@ iio-hid-sensor-trigger-fix-the-race-with-user-space-powering-up-sensors.patch staging-rtl8188eu-add-rnx-n150nub-support.patch asoc-simple-card-don-t-fail-if-sysclk-setting-is-not-supported.patch asoc-rsnd-disable-src.out-only-when-stop-timing.patch +asoc-rsnd-avoid-pointless-loop-in-rsnd_mod_interrupt.patch +asoc-rsnd-add-missing-initialization-of-adg-req_rate.patch +asoc-rsnd-ssi-24bit-data-needs-right-aligned-settings.patch +asoc-rsnd-don-t-call-update-callback-if-it-was-null.patch