* [PATCH AUTOSEL 5.15 10/24] ASoC: wm8962: Wait for updated value of WM8962_CLOCKING1 register
[not found] <20221128174027.1441921-1-sashal@kernel.org>
@ 2022-11-28 17:40 ` Sasha Levin
2022-11-28 17:40 ` [PATCH AUTOSEL 5.15 13/24] ASoC: rt711-sdca: fix the latency time of clock stop prepare state machine transitions Sasha Levin
` (2 subsequent siblings)
3 siblings, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2022-11-28 17:40 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Sasha Levin, alsa-devel, Charles Keepax, patches, tiwai,
lgirdwood, chi.minghao, Mark Brown, Chancel Liu, steve, aford173
From: Chancel Liu <chancel.liu@nxp.com>
[ Upstream commit 3ca507bf99611c82dafced73e921c1b10ee12869 ]
DSPCLK_DIV field in WM8962_CLOCKING1 register is used to generate
correct frequency of LRCLK and BCLK. Sometimes the read-only value
can't be updated timely after enabling SYSCLK. This results in wrong
calculation values. Delay is introduced here to wait for newest value
from register. The time of the delay should be at least 500~1000us
according to test.
Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20221109121354.123958-1-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/wm8962.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index 09a73b854964..779f7097d336 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -2490,6 +2490,14 @@ static void wm8962_configure_bclk(struct snd_soc_component *component)
snd_soc_component_update_bits(component, WM8962_CLOCKING2,
WM8962_SYSCLK_ENA_MASK, WM8962_SYSCLK_ENA);
+ /* DSPCLK_DIV field in WM8962_CLOCKING1 register is used to generate
+ * correct frequency of LRCLK and BCLK. Sometimes the read-only value
+ * can't be updated timely after enabling SYSCLK. This results in wrong
+ * calculation values. Delay is introduced here to wait for newest
+ * value from register. The time of the delay should be at least
+ * 500~1000us according to test.
+ */
+ usleep_range(500, 1000);
dspclk = snd_soc_component_read(component, WM8962_CLOCKING1);
if (snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_ON)
--
2.35.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH AUTOSEL 5.15 13/24] ASoC: rt711-sdca: fix the latency time of clock stop prepare state machine transitions
[not found] <20221128174027.1441921-1-sashal@kernel.org>
2022-11-28 17:40 ` [PATCH AUTOSEL 5.15 10/24] ASoC: wm8962: Wait for updated value of WM8962_CLOCKING1 register Sasha Levin
@ 2022-11-28 17:40 ` Sasha Levin
2022-11-28 17:40 ` [PATCH AUTOSEL 5.15 16/24] ALSA: seq: Fix function prototype mismatch in snd_seq_expand_var_event Sasha Levin
2022-11-28 17:40 ` [PATCH AUTOSEL 5.15 19/24] ASoC: soc-pcm: Add NULL check in BE reparenting Sasha Levin
3 siblings, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2022-11-28 17:40 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Sasha Levin, oder_chiou, alsa-devel, tiwai, lgirdwood, Mark Brown,
Shuming Fan
From: Shuming Fan <shumingf@realtek.com>
[ Upstream commit c7d7d4e7bb1290cc473610b0bb96d9fa606d00e7 ]
Due to the hardware behavior, it takes some time for CBJ detection/impedance sensing/de-bounce.
The ClockStop_NotFinished flag will be raised until these functions are completed.
In ClockStopMode0 mode case, the SdW controller might check this flag from D3 to D0 when the
jack detection interrupt happened.
Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20221116090318.5017-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt711-sdca-sdw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/rt711-sdca-sdw.c b/sound/soc/codecs/rt711-sdca-sdw.c
index a085b2f530aa..31e77d462ef3 100644
--- a/sound/soc/codecs/rt711-sdca-sdw.c
+++ b/sound/soc/codecs/rt711-sdca-sdw.c
@@ -230,7 +230,7 @@ static int rt711_sdca_read_prop(struct sdw_slave *slave)
}
/* set the timeout values */
- prop->clk_stop_timeout = 20;
+ prop->clk_stop_timeout = 700;
/* wake-up event */
prop->wake_capable = 1;
--
2.35.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH AUTOSEL 5.15 16/24] ALSA: seq: Fix function prototype mismatch in snd_seq_expand_var_event
[not found] <20221128174027.1441921-1-sashal@kernel.org>
2022-11-28 17:40 ` [PATCH AUTOSEL 5.15 10/24] ASoC: wm8962: Wait for updated value of WM8962_CLOCKING1 register Sasha Levin
2022-11-28 17:40 ` [PATCH AUTOSEL 5.15 13/24] ASoC: rt711-sdca: fix the latency time of clock stop prepare state machine transitions Sasha Levin
@ 2022-11-28 17:40 ` Sasha Levin
2022-11-28 17:40 ` [PATCH AUTOSEL 5.15 19/24] ASoC: soc-pcm: Add NULL check in BE reparenting Sasha Levin
3 siblings, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2022-11-28 17:40 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Sasha Levin, alsa-devel, Kees Cook, Takashi Iwai, llvm,
ndesaulniers, Gustavo A. R. Silva, Takashi Iwai, nathan,
kernel test robot
From: Kees Cook <keescook@chromium.org>
[ Upstream commit 05530ef7cf7c7d700f6753f058999b1b5099a026 ]
With clang's kernel control flow integrity (kCFI, CONFIG_CFI_CLANG),
indirect call targets are validated against the expected function
pointer prototype to make sure the call target is valid to help mitigate
ROP attacks. If they are not identical, there is a failure at run time,
which manifests as either a kernel panic or thread getting killed.
seq_copy_in_user() and seq_copy_in_kernel() did not have prototypes
matching snd_seq_dump_func_t. Adjust this and remove the casts. There
are not resulting binary output differences.
This was found as a result of Clang's new -Wcast-function-type-strict
flag, which is more sensitive than the simpler -Wcast-function-type,
which only checks for type width mismatches.
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/lkml/202211041527.HD8TLSE1-lkp@intel.com
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: alsa-devel@alsa-project.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20221118232346.never.380-kees@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/core/seq/seq_memory.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c
index b7aee23fc387..47ef6bc30c0e 100644
--- a/sound/core/seq/seq_memory.c
+++ b/sound/core/seq/seq_memory.c
@@ -113,15 +113,19 @@ EXPORT_SYMBOL(snd_seq_dump_var_event);
* expand the variable length event to linear buffer space.
*/
-static int seq_copy_in_kernel(char **bufptr, const void *src, int size)
+static int seq_copy_in_kernel(void *ptr, void *src, int size)
{
+ char **bufptr = ptr;
+
memcpy(*bufptr, src, size);
*bufptr += size;
return 0;
}
-static int seq_copy_in_user(char __user **bufptr, const void *src, int size)
+static int seq_copy_in_user(void *ptr, void *src, int size)
{
+ char __user **bufptr = ptr;
+
if (copy_to_user(*bufptr, src, size))
return -EFAULT;
*bufptr += size;
@@ -151,8 +155,7 @@ int snd_seq_expand_var_event(const struct snd_seq_event *event, int count, char
return newlen;
}
err = snd_seq_dump_var_event(event,
- in_kernel ? (snd_seq_dump_func_t)seq_copy_in_kernel :
- (snd_seq_dump_func_t)seq_copy_in_user,
+ in_kernel ? seq_copy_in_kernel : seq_copy_in_user,
&buf);
return err < 0 ? err : newlen;
}
--
2.35.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH AUTOSEL 5.15 19/24] ASoC: soc-pcm: Add NULL check in BE reparenting
[not found] <20221128174027.1441921-1-sashal@kernel.org>
` (2 preceding siblings ...)
2022-11-28 17:40 ` [PATCH AUTOSEL 5.15 16/24] ALSA: seq: Fix function prototype mismatch in snd_seq_expand_var_event Sasha Levin
@ 2022-11-28 17:40 ` Sasha Levin
3 siblings, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2022-11-28 17:40 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Sasha Levin, alsa-devel, lgirdwood, tiwai, Mark Brown,
Srinivasa Rao Mandadapu
From: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
[ Upstream commit db8f91d424fe0ea6db337aca8bc05908bbce1498 ]
Add NULL check in dpcm_be_reparent API, to handle
kernel NULL pointer dereference error.
The issue occurred in fuzzing test.
Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Link: https://lore.kernel.org/r/1669098673-29703-1-git-send-email-quic_srivasam@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/soc-pcm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 48f71bb81a2f..de837bacf219 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1171,6 +1171,8 @@ static void dpcm_be_reparent(struct snd_soc_pcm_runtime *fe,
return;
be_substream = snd_soc_dpcm_get_substream(be, stream);
+ if (!be_substream)
+ return;
for_each_dpcm_fe(be, stream, dpcm) {
if (dpcm->fe == fe)
--
2.35.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-28 17:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20221128174027.1441921-1-sashal@kernel.org>
2022-11-28 17:40 ` [PATCH AUTOSEL 5.15 10/24] ASoC: wm8962: Wait for updated value of WM8962_CLOCKING1 register Sasha Levin
2022-11-28 17:40 ` [PATCH AUTOSEL 5.15 13/24] ASoC: rt711-sdca: fix the latency time of clock stop prepare state machine transitions Sasha Levin
2022-11-28 17:40 ` [PATCH AUTOSEL 5.15 16/24] ALSA: seq: Fix function prototype mismatch in snd_seq_expand_var_event Sasha Levin
2022-11-28 17:40 ` [PATCH AUTOSEL 5.15 19/24] ASoC: soc-pcm: Add NULL check in BE reparenting Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).