11 Nov, 2019
1 commit
01 Nov, 2019
1 commit
14 Apr, 2019
1 commit
-
With small buffer size, the resume will be triggered after suspend
immediately, if we reserve the period done message to be sent with
the next command, one period time later, it will cause underrun in
m4 side, for ALSA thought the appl_ptr is updated, but the command
won't be sent to M4 immediately, M4 don't have enough data to play.In this patch, we check that if the left size in the buffer is less
that one period, the work queue will be triggered to send the period
done message immediately.Fixes: 348d47695622 ("MLK-21307: ASoC: fsl_rpmsg_i2s: optimize
the message sent to m4")
Signed-off-by: Shengjiu Wang(cherry picked from commit 3dfecae40765329c0b7de1157f97ade24ecfce6d)
12 Apr, 2019
5 commits
-
M4 complain that there are two much period done message sent to m4, that
M4 don't have enough time to handle these messages.The solution for this issue is to reduce the number of period done message.
We allocate a specific memory for period done message, every time there is
period done coming, it will be writed to this memory, not write it directly
to the work queue, that queue will not be overflow, and the old period done
message will be overwrited.In the rpmsg_i2s_work, we first check if there is period done message, then
send it first, after that, send the command in queue.Signed-off-by: Shengjiu Wang
Reviewed-by: Daniel Baluta
(cherry picked from commit caabdfa176453cc7c8d6521f7865a670a7265a18) -
Previously we add snd_soc_find_dai to check if the codec is probed or
not, but this bring kernel dump issue when CONFIG_LOCKDEP=y.[ 2.823379] WARNING: CPU: 2 PID: 1 at sound/soc/soc-core.c:1016 snd_soc_find_dai+0x144/0x150
[ 2.831827] Modules linked in:
[ 2.834907] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.14.78-00007-g524e1b1f0b3f #18
[ 2.842748] Hardware name: FSL i.MX8MM EVK board (DT)
[ 2.847811] task: ffff8000624f0000 task.stack: ffff000008078000
[ 2.853745] PC is at snd_soc_find_dai+0x144/0x150
[ 2.858462] LR is at snd_soc_find_dai+0x140/0x150...
[ 3.469675] Call trace:
[ 3.472135] Exception stack(0xffff00000807ba40 to 0xffff00000807bb80)
[ 3.478590] ba40: 0000000000000000 00000000ffffffff 0000000000000000 0000000000000002
[ 3.4864333.596564] [] bus_add_driver+0x110/0x230
[ 3.602149] [] driver_register+0x68/0x100
[ 3.607735] [] __platform_driver_register+0x54/0x60
[ 3.614191] [] imx_rpmsg_driver_init+0x20/0x28
[ 3.620213] [] do_one_initcall+0x44/0x130
[ 3.625801] [] kernel_init_freeable+0x1e0/0x280
[ 3.631909] [] kernel_init+0x18/0x110
[ 3.637148] [] ret_from_fork+0x10/0x1cSo we could't resolve the warning "snd_soc_register_card failed (-517)".
Fixes: 2bf5f9704785 ("MLK-19854-1: ASoC: imx-cs42888: fix error when m4
image is not loaded")
Signed-off-by: Shengjiu Wang(cherry picked from commit 58ffdf239288cfa6904640fc8432c182cf56589b)
-
Previously we add snd_soc_find_dai to check if the codec is probed or
not, but this bring kernel dump issue when CONFIG_LOCKDEP=y.[ 2.823379] WARNING: CPU: 2 PID: 1 at sound/soc/soc-core.c:1016 snd_soc_find_dai+0x144/0x150
[ 2.831827] Modules linked in:
[ 2.834907] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.14.78-00007-g524e1b1f0b3f #18
[ 2.842748] Hardware name: FSL i.MX8MM EVK board (DT)
[ 2.847811] task: ffff8000624f0000 task.stack: ffff000008078000
[ 2.853745] PC is at snd_soc_find_dai+0x144/0x150
[ 2.858462] LR is at snd_soc_find_dai+0x140/0x150...
[ 3.469675] Call trace:
[ 3.472135] Exception stack(0xffff00000807ba40 to 0xffff00000807bb80)
[ 3.478590] ba40: 0000000000000000 00000000ffffffff 0000000000000000 0000000000000002
[ 3.4864333.596564] [] bus_add_driver+0x110/0x230
[ 3.602149] [] driver_register+0x68/0x100
[ 3.607735] [] __platform_driver_register+0x54/0x60
[ 3.614191] [] imx_rpmsg_driver_init+0x20/0x28
[ 3.620213] [] do_one_initcall+0x44/0x130
[ 3.625801] [] kernel_init_freeable+0x1e0/0x280
[ 3.631909] [] kernel_init+0x18/0x110
[ 3.637148] [] ret_from_fork+0x10/0x1cSo we could't resolve the warning "snd_soc_register_card failed (-517)".
Fixes: a52c88bc3932 ("MLK-19854-1: ASoC: imx-wm8960: fix error when m4
image is not loaded")
Signed-off-by: Shengjiu Wang(cherry picked from commit f5d9013702e172a243da74a42941a62283bbe4a8)
-
Previously we add snd_soc_find_dai to check if the codec is probed or
not, but this bring kernel dump issue when CONFIG_LOCKDEP=y.[ 2.823379] WARNING: CPU: 2 PID: 1 at sound/soc/soc-core.c:1016 snd_soc_find_dai+0x144/0x150
[ 2.831827] Modules linked in:
[ 2.834907] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.14.78-00007-g524e1b1f0b3f #18
[ 2.842748] Hardware name: FSL i.MX8MM EVK board (DT)
[ 2.847811] task: ffff8000624f0000 task.stack: ffff000008078000
[ 2.853745] PC is at snd_soc_find_dai+0x144/0x150
[ 2.858462] LR is at snd_soc_find_dai+0x140/0x150...
[ 3.469675] Call trace:
[ 3.472135] Exception stack(0xffff00000807ba40 to 0xffff00000807bb80)
[ 3.478590] ba40: 0000000000000000 00000000ffffffff 0000000000000000 0000000000000002
[ 3.4864333.596564] [] bus_add_driver+0x110/0x230
[ 3.602149] [] driver_register+0x68/0x100
[ 3.607735] [] __platform_driver_register+0x54/0x60
[ 3.614191] [] imx_rpmsg_driver_init+0x20/0x28
[ 3.620213] [] do_one_initcall+0x44/0x130
[ 3.625801] [] kernel_init_freeable+0x1e0/0x280
[ 3.631909] [] kernel_init+0x18/0x110
[ 3.637148] [] ret_from_fork+0x10/0x1cSo we could't resolve the warning "snd_soc_register_card failed (-517)".
Fixes: 75632b22a332 ("MLK-20247: ASoC: imx-rpmsg: fix error when
m4 image is not loaded")
Signed-off-by: Shengjiu Wang(cherry picked from commit bbc1868d1c3ec448301d76606e7199f74aa35581)
-
With CONFIG_LOCKDEP=y, there will kernel dump
[ 55.305563] INFO: trying to register non-static key.
[ 55.310540] the code is fine but needs lockdep annotation.
[ 55.316027] turning off the locking correctness validator.
[ 55.321520] CPU: 0 PID: 32 Comm: kworker/0:1 Tainted: G W 4.14.78-00007-g524e1b1f0b3f #18
[ 55.330827] Hardware name: FSL i.MX8MM EVK board (DT)
[ 55.335892] Workqueue: events rpmsg_work_handler
[ 55.340515] Call trace:
[ 55.342971] [] dump_backtrace+0x0/0x270
[ 55.348375] [] show_stack+0x24/0x30
[ 55.353433] [] dump_stack+0xb8/0xf0
[ 55.358490] [] register_lock_class+0x364/0x548
[ 55.364501] [] __lock_acquire+0x7c/0x18a8
[ 55.370077] [] lock_acquire+0xc8/0x290
[ 55.375394] [] _raw_spin_lock_irqsave+0x54/0x70
[ 55.381493] [] i2s_rpmsg_cb+0xe8/0x1b0
[ 55.386810] [] rpmsg_recv_done+0x144/0x210
[ 55.392476] [] vring_interrupt+0x44/0x78
[ 55.397966] [] imx_mu_rpmsg_callback+0x6c/0x80
[ 55.403977] [] notifier_call_chain+0x5c/0x98
[ 55.409813] [] __blocking_notifier_call_chain+0x58/0xa0
[ 55.416605] [] blocking_notifier_call_chain+0x3c/0x50
[ 55.423223] [] rpmsg_work_handler+0x88/0xe8
[ 55.428974] [] process_one_work+0x290/0x738
[ 55.434723] [] worker_thread+0x58/0x460
[ 55.440127] [] kthread+0x104/0x130
[ 55.445096] [] ret_from_fork+0x10/0x1cThe reason is that the spin lock is not initilized.
Signed-off-by: Shengjiu Wang
(cherry picked from commit 0e98ac55f17f6505f92c515c3c04581039e21865)
27 Mar, 2019
1 commit
-
Because we are re-initializing the proxy at close it might
happen that work is still pending which causes the following crash:[ 94.699835] Unable to handle kernel NULL pointer dereference at virtual address 00000008
[ 94.707923] Mem abort info:
[ 94.710722] Exception class = DABT (current EL), IL = 32 bits
[ 94.716637] SET = 0, FnV = 0
[ 94.719686] EA = 0, S1PTW = 0
[ 94.722822] Data abort info:
[ 94.725698] ISV = 0, ISS = 0x00000005
[ 94.729530] CM = 0, WnR = 0
[ 94.732504] user pgtable: 4k pages, 48-bit VAs, pgd = ffff8008d9ba3000
[ 94.739035] [0000000000000008] *pgd=0000000938419003, *pud=0000000000000000
[ 94.746015] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[ 94.751589] Modules linked in:
[ 94.754652] CPU: 0 PID: 2068 Comm: kworker/0:2 Not tainted 4.14.98-dirty #75
[ 94.761700] Hardware name: Freescale i.MX8QM MEK (DT)
[ 94.766768] task: ffff8008f23ae200 task.stack: ffff000014378000
[ 94.772705] PC is at process_one_work+0x34/0x414
[ 94.777325] LR is at process_one_work+0x1e0/0x414In order to fix this, we make sure that no work is pending before starting
the re-initialization.Signed-off-by: Daniel Baluta
Reviewed-by: Shengjiu Wang
(cherry picked from commit 2c00c24be5f8b63636e3f9005e15a3de42058438)
13 Mar, 2019
3 commits
-
The channel num (9 - 15) should not be supported in tdm & daisy chain
mode for there is two dataline, this channel number can't be
symmetrically distributed on two dataline (the first one is fixed to
be 8 channel)Fixes commit 8d29874365c3 ("MLK-17817-2: ASoC: imx-ak4458: enable 16
channels in TDM mode")Signed-off-by: Shengjiu Wang
(cherry picked from commit 0bc47b31660efd3dbbeee7e51fca6f75e7ecb69f) -
We designed length of msg queue to be 0x18, which is too
small if the period size = 512bytes, sometimes the queue
will be full, which cause the msg is replaced by new one.
which is not acceptable.So we need to enlarge the length of msg queue and add
protection when msg queue is full, if the msg queue is full
with the cmd (START, STOP, PAUSE...), driver will return
error, with the cmd (I2S_TX_POINTER, I2S_TX_PERIOD_DONE)
driver will drop the cmd.Signed-off-by: Shengjiu Wang
(cherry picked from commit 31def064871336af7780d01a6ed8c5ed075b7e48) -
Fixes commit 4028bd0f76fd ("MLK-21002-2: ASoC: imx-pcm-rpmsg: don't
remove timer at suspend")if the timer isn't removed at suspend, there will be interrupt
from M4 side when the period size is small to wake up system quickly
So we need to revert the previous fix and add timer in resume stateSigned-off-by: Shengjiu Wang
(cherry picked from commit a23d1df081f1ed33bc8dc7fffc42d1dfa3db2366)
01 Mar, 2019
2 commits
-
If timer is deleted in suspend, when the suspend is resumed
by pressing the power key, there will be no timer until the buffer
empty, and the hw_ptr will not be updated.So the timer should not be removed at suspend.
Signed-off-by: Shengjiu Wang
(cherry picked from commit 9a17ce36ecef46ea5ec88d4b89b117abe8eebf8f) -
In LPA, we use the timer to simulate the interrupt, if the period time
is 1s, the timer is 500ms, which means the interrupt is more frequent
than actual.With pause ALSA will update the hw_ptr_jiffies, because the interrupt
is more frequent, so sometimes in snd_pcm_update_hw_ptr0, the condition
delta > new_hw_ptr will be true, then the new_hw_ptr will be added whole
buffer_size, which cause the whole buffer be flushed.if (in_interrupt) {
/* we know that one period was processed */
/* delta = "expected next hw_ptr" for in_interrupt != 0 */
delta = runtime->hw_ptr_interrupt + runtime->period_size;
if (delta > new_hw_ptr) {
/* check for double acknowledged interrupts */
hdelta = curr_jiffies - runtime->hw_ptr_jiffies;
if (hdelta > runtime->hw_ptr_buffer_jiffies/2 + 1) {
hw_base += runtime->buffer_size;
if (hw_base >= runtime->boundary) {
hw_base = 0;
crossed_boundary++;
}
new_hw_ptr = hw_base + pos;
goto __delta;
}
}
}So even we use the timer to simulate the interrupt, the timer should
be same as the period time, otherwise will cause issue.Signed-off-by: Shengjiu Wang
(cherry picked from commit 9a9af932118774083119dba72c5c6133852ba926)
22 Feb, 2019
1 commit
-
cs42xx8 will call regcache_sync to refresh its register cache. However,
it will send a long msg which length is greater than the max buffer size
of virtual i2c driver. It will cause the regcache_sync operation failed.
So, use the single read/write to send i2c msg in regcache functions.Signed-off-by: Clark Wang
12 Feb, 2019
25 commits
-
With non fsl-imx8qxp-mek-dsp.dts, the clock is not assigned
to dsp node, which cause error message when kernel boot up.Signed-off-by: Shengjiu Wang
Reviewed-by: Daniel Baluta -
Add clocks for peripheral devices
Signed-off-by: Shengjiu Wang
-
Remove the clock operation in cpu dai, all clock will be
moved to platform driver.
The reason is that the suspend and resume of dsp is handled in
platform driver, if the clock is disabled before the suspend,
the dsp framework can't access the registers of device in suspend.Signed-off-by: Shengjiu Wang
-
Revert "MLK-18497-13: ASoC: fsl: dsp: Skip SDRAM section update if
fw is already loaded"This reverts commit a0cffd9a9299362f2b3a4d24b78a8574b736fdfa.
This is just to avoid reconfigure the edma isr handler in dsp
framework, which should be handled by dsp framework.Signed-off-by: Shengjiu Wang
-
we can call the snd_pcm_period_elapsed in timer's callback
to achieve pseudo period wake up, so the nonblock constraint
can be removedSigned-off-by: Shengjiu Wang
-
We set system address offset select to 0 on QM because of the following reasons:
* SC_C_OFS_PERIPH, it is not available for QM
* SC_C_OFS_AUDIO, it is not used
* SC_C_OFS_IRQ, needs to get outside of the VPU.A simplified version of the code is:
if (dsp_priv->dsp_board_type == DSP_IMX8QXP_TYPE) {
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_SEL, 1);
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_PERIPH, 0x5A);
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_IRQ, 0x51);
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_AUDIO, 0x80);
}
} else {
sc_misc_set_control(ipcHndl, SC_R_DSP, SC_C_OFS_SEL, 0);
}Reviewed-by: Shengjiu Wang
Signed-off-by: Daniel Baluta -
On QM the DSP is inside the VPU subsystem while in QXP
it is inside the Audio DMA subsystem. For this reason
there are "subtle" differences.Introduce new compatible string for QM to help us correctly
configure the DSP depending on the board they run.dsp_mem_msg structure is shared with the DSP, so by introducing
new member dsp_board_type we can let DSP know on which target it runs.Reviewed-by: Shengjiu Wang
Signed-off-by: Daniel Baluta -
for non ideal ratio mode, the clock rate should divide the sample rate
with no remainder, and the quotient should be less than 1024.Signed-off-by: Shengjiu Wang
-
When 3 asrc pair are working in parallel, there will be
error log randomlyoutput DMA task timeout
fsl-asrc 2034000.asrc: Pair B: failed to process buffer: -62The reason is that the initialization is not finished for
some pair, the prefill data is failed to be input in FIFO.The patch is to increase the retry times to make sure that
initialization is success.Signed-off-by: Shengjiu Wang
-
support S8 format for p2p
Signed-off-by: Shengjiu Wang
-
support input data width with 8bit for m2m
Signed-off-by: Shengjiu Wang
-
Fix identation issue.
Signed-off-by: Cosmin-Gabriel Samoila
Reviewed-by: Shengjiu Wang -
The patch fixes the following build warnings:
sound/soc/codecs/ak4458.c: In function ‘ak4458_hw_params’:
warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
u8 dfs1, dfs2;
^~~Signed-off-by: Jason Liu
CC: Shengjiu Wang
Acked-by: Shengjiu Wang -
Compare with imx6, the conversion of 8kHz 5channel to 176kHz is ok.
And compare the output we found that about every 48K bytes, there will be
additional data be added, which cause noise.In this case, there will be two sg_nodes, for the maxmum output size exceed
the ASRC_MAX_BUFFER_SIZE, each size is ASRC_MAX_BUFFER_SIZE, it is 49152.
the value can't be exact divided by channel * word_with * watermark = 40.
So the EDMA can't finish the copy with correct size.There is limitation of EMDA described in commit 3519b67ac01c
("MLK-19151: ASoC: fsl_asrc: fix dma timeout issue for imx8qxp")EDMA just copy 49120 bytes, there will 32 bytes wrong data.
According to this limitation, this commit is to change the maxburst to 1
for EDMA case, then EDMA can do what we expect correctly.Signed-off-by: Shengjiu Wang
-
In TDM mode with Daisy Chain enabled (CPLD mode 0x04) DAC1 and DAC2
AK4458 codecs on audio board are able to play 16 channels, so extend
the TDM mode constraint to 16 channels.Signed-off-by: Viorel Suman
-
Enable Daisy Chain if in TDM mode and the number of played
channels is bigger than the maximum supported number of channels.Signed-off-by: Viorel Suman
-
We enable the ASRC clocks from CPU side. We only need
the following clocks: "mem", "ipg" and "asrc0..3".Signed-off-by: Daniel Baluta
Reviewed-by: Shengjiu Wang -
If the FMT of tx and rx is different, there will be issue. for example
tx is working at TDM mode, but rx want to work at I2S mode, this case
is not supported in current ALSA driver, the best way to support this
is to distinguish substream in set_fmt function.Signed-off-by: Shengjiu Wang
-
TDM mode can only work with codec slave mode, and the mclk
frequency should be 256FS.Signed-off-by: Shengjiu Wang
-
add more rates in constraint list, Fixes commit ee959e2c9b18
("MLK-19581-3: ASoC: fsl_rpmsg_i2s: support multipul rate and DSD format")Signed-off-by: Shengjiu Wang
-
The patch enable mapping the number of pins required to play or record
a specific number of channels to a specific dataline mask.Three consequent elements in "fsl,dataline" and "fsl,dataline,dsd" defines a
particular mapping, for instance for: fsl,dataline = "0 0xff 0xff 2 0x11 0x11"
there are two mappings defined:default (0 pins) "rx" and "tx" dataline masks: 0 0xff 0xff
2 pins "rx" and "tx" dataline masks: 2 0x11 0x11In case if property is missing, then default value "0 0x1 0x1" is considered.
Signed-off-by: Viorel Suman
-
Change source and header License comment to SPDX format.
Signed-off-by: Cosmin-Gabriel Samoila
Reviewed-by: Daniel Baluta -
When CONFIG_PM is not defined, the runtime suspend and resume
are unused so we should use __maybe_unused attribute.Signed-off-by: Cosmin-Gabriel Samoila
Reviewed-by: Daniel Baluta -
It is error prone to use soc_enum array for controls because introducing
new controls must always be done at the end of array or it will add
offset to existing controls.Signed-off-by: Cosmin-Gabriel Samoila
Reviewed-by: Daniel Baluta -
The rpmsg wm8960 codec driver is completed to support
full function, not only the volume control. which cause
an issue that there is no sound when recording, the reason
is that the MIC Bias not enabled, and it should be enabled
through audio routing.Signed-off-by: Shengjiu Wang