summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/fsl_dsp_proxy.c
AgeCommit message (Collapse)Author
2020-11-13MLK-24966 ASoC: fsl_dsp: Fix kernel crash when DSP has no responseZhang Peng
When DSP has no response with cplay and try to force exit, kernel met crash. Reason is kernel locks a mutex proxy->lock twice then kernel crash. Use MU_SendMessageTimeout instead MU_SendMessage then kernel can release the mutex. Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2020-08-14MLK-24501-5 dsp: add lpa pcm support.Bing Song
Use reserved memory as PCM mode need more memory. Use ping-pong buffer for PCM LPA playback to avoid underrun. Signed-off-by: Bing Song <bing.song@nxp.com> Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-08-14MLK-24501-3 dsp: interrupt suspend when lpa.Bing Song
Input buffer maybe return when suspending. Interrupt suspend if MU from DSP to ARM core. Signed-off-by: Bing Song <bing.song@nxp.com> Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2020-08-03MLK-24453 ASoC: fsl_dsp: Add pause&pause_release in dspZhang Peng
Add dsp support pause and pause_release cmd. Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2019-11-25MLK-20095-3: ASoC: fsl: Differentiate between QXP and QMDaniel 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 <shengjiu.wang@nxp.com> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-11-25MLK-20189-5: ASoC: fsl: dsp_proxy: Unlock proxy->lock on error pathDaniel Baluta
xf_cmd_send_recv returns with lock taken if waiting was interrupted by a signal. This fixes Coverity issues: CID5233120 / CID5233060 Reviewed-by: S.j. Wang <shengjiu.wang@nxp.com> Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-11-25MLK-20094: ASoC: fsl: dsp: Fix crash in compress cleanup pathDaniel Baluta
We must find a way to no longer touch resources after they are cleand up. Now, after a stress test we get the following crash: [ 2156.863772] fsl-dsp 596e8000.dsp: xf_pool_alloc failed [ 2156.869337] Unable to handle kernel NULL pointer dereference at virtual address 00000060 [ 2157.148594] [<ffff000008d8839c>] _raw_spin_lock+0x14/0x48 [ 2157.153995] [<ffff000008b3e0b8>] xf_cmd_send_recv_complete+0x40/0xf0 [ 2157.160354] [<ffff000008b3e470>] xf_close+0x40/0x88 [ 2157.165239] [<ffff000008b3f7a4>] xaf_comp_delete+0x5c/0x70 [ 2157.170730] [<ffff000008b40530>] dsp_platform_compr_free+0xa0/0xe8 [ 2157.176917] [<ffff000008b287fc>] soc_compr_free_fe+0x144/0x1a0 [ 2157.182754] [<ffff000008b11b24>] snd_compr_free+0x64/0x98 This happens because: 1) dsp_platform_process work handler waits in a loop for messages to arrive. 2) when cplay process finishes it cleans up most of the resources. 3) when another cplay process starts it reinitializes the resources including queues for example. 4) a message will be generated and kernel will crash because dsp_platform_process uses the older queues. A solution for this is to make sure dsp_platform_process work loop is stopped at cleanup time. We use is_active state and signal dsp_platform_process handler to finish because we are on the cleanup path. While at it replace cancel_work with cancel_work sync to be sure that work handler ends before going on with the rest of the cleanup. Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-11-25MLK-18497-5: ASoC: fsl: dsp_proxy: Introduce client APIDaniel Baluta
This will allow DSP driver to create/destroy a client on DSP audio-framework proxy. Registering a client on remote DSP proxy means creating a component. The implementation is similar with userspace application proxy implementation. Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-11-25MLK-18497-3: ASoC: fsl: dsp_proxy: Add new send/recv helpersDaniel Baluta
This commit adds 3 new function helpers for sending messages to DSP framework and waiting for response. While at it cleanup spaces around struct client fields. Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-11-25MLK-18497-2: ASoC: fsl: dsp_proxy: Add missing xf_unlockDaniel Baluta
xf_cmd_send_recv function returns with a lock taken in case of success. Fix this, now! This bug is present since the beginning of time and it didn't show up because no one used xd_cmd_alloc/xf_cmd_free. Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-11-25MLK-18497-1: ASoC: fsl: dsp_proxy: Fix license headersDaniel Baluta
This is a cleanup patch to have all the headers style consistent across DSP driver. Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-11-25MLK-18646: ASoC: fsl_dsp: fix the license issueShengjiu Wang
correct the license issue Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-11-25MLK-18279: ASoC: fsl_dsp: get the information of reserved memory from dtsWeiguang Kong
The reserved memory for dsp is defined in dts file, however, the dsp driver has also defined the address and size of this reserved memory, which is repeated and inflexible. So by cancelling the definition in dsp driver and use system API to get the information of reserved memory from dts dynamically to fix this problem. Signed-off-by: Weiguang Kong <weiguang.kong@nxp.com>
2019-11-25MLK-17747: dsp: use the name of dsp instead of hifiWeiguang Kong
In order to avoid the name problem going forward with integration with Qcom, Qcom has their own dsp and hifi is competitor, so the hifi name should not be used in our code. So use the name of dsp instead of hifi to fix this problem. Signed-off-by: Weiguang Kong <weiguang.kong@nxp.com>