ASoC: SOF: refine interrupt function on BDW & HSW#381
ASoC: SOF: refine interrupt function on BDW & HSW#381plbossart merged 1 commit intothesofproject:topic/sof-devfrom
Conversation
|
@plbossart I know you are curious about why msg is zero in IPCX on BDW. This is caused by our imperfect design of msg_id. our msg_id is a 32bit cmd. On APL msg_id is set like: It is lucky that cmd never overwrite some bits on APL, CNL, BYT, but on BDW it would overwrite SHIM_IPCX_DONE. This makes interrupt out of order. So that is why we don't set msg_id in SHIM_IPCX. Actually msg_id is not useful now, so IPC works on BDW |
|
@RanderWang I didn't understand your explanations but will give you the benefit of doubt. Can you please rebase since there are conflicts with Keyon's cleanup |
This patch follows commit:
ASoC: SOF: byt: fix IPC handled wrong issue
Align with apl/cnl, to fix the issue with dmesg shows "error: rx list
empty but received ...", add mask check for interrupt handling.
two special change:
(1) remove memory read in IRQ function, it be done in ipc_msgs_rx
So this memory read is duplicated.
(2) msg id is stored in ipcx not in hdr. Now we set zero in ipcx
and hdr is zero, so no problem
is found.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
71baf44 to
4157b30
Compare
|
Test and update the PR , it works on BDW. The msg_id issue is a little obscure, I also spent some time to find this. Just talk about APL. snd_sof_dsp_write(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCI, HDA_DSP_REG_HIPCI is a 32bit register and only the 32th bit, named HDA_DSP_REG_HIPCI_BUSY, is used and other bits is unused. So we use other bits to take msg_id which uses LSB 31bits and let the 32th bit untouched. But on BDW, the 31th bit, named SHIM_IPCX_DONE, is used for IPC. So msg_id would overwrite this bit. |
|
And I think the difference between bdw_send_msg and hda_dsp_ipc_send_msg, byt_send_msg is obscure, Someone in open source community may report a bug. I think we should refine the msg id. |
|
@RanderWang We may need msg id if we implement compound ipc in the future. |
yes, but not set msg id in a 32bit register |
|
@RanderWang if you believe the IPC definition is incorrect/confusing/suboptimal, please file a separate issue and suggest a fix. It's very difficult to follow your line of thought and what exactly you are referring to. Thanks! |
Add and use snd_pcm_stream_lock_nested() in snd_pcm_link/unlink implementation. The code is fine, but generates a lockdep complaint: ============================================ WARNING: possible recursive locking detected 5.7.1mq+ #381 Tainted: G O -------------------------------------------- pulseaudio/4180 is trying to acquire lock: ffff888402d6f508 (&group->lock){-...}-{2:2}, at: snd_pcm_common_ioctl+0xda8/0xee0 [snd_pcm] but task is already holding lock: ffff8883f7a8cf18 (&group->lock){-...}-{2:2}, at: snd_pcm_common_ioctl+0xe4e/0xee0 [snd_pcm] other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&group->lock); lock(&group->lock); *** DEADLOCK *** May be due to missing lock nesting notation 2 locks held by pulseaudio/4180: #0: ffffffffa1a05190 (snd_pcm_link_rwsem){++++}-{3:3}, at: snd_pcm_common_ioctl+0xca0/0xee0 [snd_pcm] #1: ffff8883f7a8cf18 (&group->lock){-...}-{2:2}, at: snd_pcm_common_ioctl+0xe4e/0xee0 [snd_pcm] [...] Cc: stable@vger.kernel.org Fixes: f57f3df ("ALSA: pcm: More fine-grained PCM link locking") Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Link: https://lore.kernel.org/r/37252c65941e58473b1219ca9fab03d48f47e3e3.1591610330.git.mirq-linux@rere.qmqm.pl Signed-off-by: Takashi Iwai <tiwai@suse.de>
commit e18035c upstream. Add and use snd_pcm_stream_lock_nested() in snd_pcm_link/unlink implementation. The code is fine, but generates a lockdep complaint: ============================================ WARNING: possible recursive locking detected 5.7.1mq+ thesofproject#381 Tainted: G O -------------------------------------------- pulseaudio/4180 is trying to acquire lock: ffff888402d6f508 (&group->lock){-...}-{2:2}, at: snd_pcm_common_ioctl+0xda8/0xee0 [snd_pcm] but task is already holding lock: ffff8883f7a8cf18 (&group->lock){-...}-{2:2}, at: snd_pcm_common_ioctl+0xe4e/0xee0 [snd_pcm] other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&group->lock); lock(&group->lock); *** DEADLOCK *** May be due to missing lock nesting notation 2 locks held by pulseaudio/4180: #0: ffffffffa1a05190 (snd_pcm_link_rwsem){++++}-{3:3}, at: snd_pcm_common_ioctl+0xca0/0xee0 [snd_pcm] thesofproject#1: ffff8883f7a8cf18 (&group->lock){-...}-{2:2}, at: snd_pcm_common_ioctl+0xe4e/0xee0 [snd_pcm] [...] Cc: stable@vger.kernel.org Fixes: f57f3df ("ALSA: pcm: More fine-grained PCM link locking") Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Link: https://lore.kernel.org/r/37252c65941e58473b1219ca9fab03d48f47e3e3.1591610330.git.mirq-linux@rere.qmqm.pl Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch follows commit:
ASoC: SOF: byt: fix IPC handled wrong issue(thesofproject/sof@4734afb)
Align with apl/cnl, to fix the issue with dmesg shows "error: rx list
empty but received ...", add mask check for interrupt handling.
two special change:
(1) remove memory read in IRQ function, it be done in ipc_msgs_rx
So this memory read is duplicated.
(2) msg id is stored in ipcx not in hdr. Now we set zero in ipcx
and hdr is zero, so no problem is found.
Test on BDW, pass.
Signed-off-by: Keyon Jie yang.jie@linux.intel.com
Signed-off-by: Rander Wang rander.wang@linux.intel.com