Repository navigation
Conversation
daa60ce to
7ab1736
Compare
|
I've decided to actually make PR of that, because we need to increase debug capabilities. Maybe it's not ultimate solution, but something we may start with. The problem with this one is that it's too specific - it's literally for just proving that ipc handler on FW side did its job and didn't hand in ipc handler or irq. When we will want to debug other things we won't just add more registers in FW and then dump them in SW. It's not so practical. Maybe we can add Kconfig option to dump whole window on error? This way when debugging FW we can add whatever we want in unused registers and we will be able to see them without changes in kernel code. We should still consider traces as default logging/debugging - memwnd registers would be used for things that cannot use traces, f.e. before traces mechanism is even set up - for now we have only trace point, but sometimes it's not sufficient. |
|
|
||
| dev_dbg(sdev->dev, "ipc received: %u processed: %u\n", | ||
| ipc_rec, ipc_proc); | ||
|
|
There was a problem hiding this comment.
this should be dev_err()
Also it's only supported for HDaudio so the right place to add this log is in intel/hda.c (hda_ipc_dump)
There was a problem hiding this comment.
Ok, you wrote that you want it on IPC timeout so I wanted to be it closer to ipc timeout message, but yea, it's not worth polluting ipc with hda for that, so i'll move it to hda.
Read IPC counters provided by firmware and log them on IPC timeout to help debug. Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
We already had this, you can get the whole dump from the node /sys/kernel/debug/sof/regs.
|
keyonjie
left a comment
There was a problem hiding this comment.
No objection about the code itself since it will be printed at error case only, though I think this could be unnecessary since we already had this in the node /sys/kernel/debug/sof/regs.
But is it whole window (4kb?) or just few registers from the beginning? Also are there all memory windows or just first one? |
@keyonjie If I see correctly it's in ipc_get_windows and it's called only on fw_ready. We need something that will be dumped on error also, f.e. on ipc timeout. |
Also it looks empty with default settings. Do I need to enable something in Kconfig? |
| ipc_proc = snd_sof_dsp_read(sdev, HDA_DSP_BAR, | ||
| HDA_DSP_SRAM_REG_FW_IPC_PROCESSED_COUNT); | ||
|
|
||
| dev_err(sdev->dev, "error: ipc received: %u processed: %u\n", |
There was a problem hiding this comment.
| dev_err(sdev->dev, "error: ipc received: %u processed: %u\n", | |
| dev_err(sdev->dev, "error: DSP ipc received: %u processed: %u\n", |
| dev_err(sdev->dev, | ||
| "error: host status 0x%8.8x dsp status 0x%8.8x mask 0x%8.8x\n", | ||
| hipcie, hipct, hipcctl); | ||
|
|
There was a problem hiding this comment.
@jajanusz
Please add some inline comments to explain what is doing here.
|
@xiulipan I'd like rather that some driver developer answer my questions that I asked first, because on them depends if it's really needed. |
|
@jajanusz
I only see this with question mark. To answer this, this is called debugfs to us. And you can dump the hda and dsp debugfs file You can just read from this, they are always readable :) And if you have some question for driver side feel free to ask and @ me. I will be glad to answer. |
|
@xiulipan I meant all questions that I asked @keyonjie
But is it whole window (4kb?) or just few registers from the beginning? Also are there all memory windows or just first one? |
It's 4KB(the size come from FW_READY), the whole memory window. You can read back the latest value of it at any time after FW_READY. |
No, you don't need enable anything in Kconfig, you can read back the latest value of it at any time after FW_READY: test-Bobba:/root/# hexdump /sys/kernel/debug/sof/regs |
|
@plbossart @keyonjie Right, looks like we can use /sys/kernel/debug/sof/regs to get these values after FW_READY and AFAIK they are not needed before FW_READY, so we can drop this PR. However we may still need some way to dump these values before FW_READY, for FW boot debugging. I don't know how kernel developers look at things like this, but maybe we can add some Kconfig option to dump registers on every error straight to the dmesg in case when error occurs before FW_READY. |
Read IPC counters provided by firmware and log them on IPC timeout to help
debug.
Intended to work with thesofproject/sof#1441
Signed-off-by: Janusz Jankowski janusz.jankowski@linux.intel.com