Repository navigation
cavs: ipc: added ipc received and processed counters - #1441
Conversation
|
Forgive my ignorance of the firmware IPC, but if you want to debug jointly with the kernel we'd need to break down how many host/kernel-initiated IPCs were received/processed and how many firmware initiated- IPCs were sent/acked? The kernel has separate code flows for each. |
29baf3a to
7468563
Compare
|
@xiulipan |
|
@plbossart |
|
@plbossart @bkokoszx I think these counters can be added independently on both sides. |
Yea, we can get these values with slim driver, but when using full stack we need you to dump them for us. @xiulipan @plbossart Can someone from SW team add it? We need it asap for ipc timeouts debugging. |
|
I've made something like this: https://github.com/jajanusz/linux/commits/ipc-debug |
@jajanusz I added comments directly. The one thing I'd like clarity on is whether the change of the FW_END definition is backwards compatible, no sure what it is used for in firmware. |
There was a problem hiding this comment.
How about those "dropping msg" happened in line 117? At the case handled_counter will be never equal to recceived_counter?
There was a problem hiding this comment.
@keyonjie
If I understand correctly in our current IPC flow, we do not have any IPC's queuing. Driver can send new IPC only when firmware accomplishes previous ipc task and triggers interrupt to host.
It happens in 177 line:
ipc->host_pending = 0;
/* write 1 to clear busy, and trigger interrupt to host*/
#if CAVS_VERSION == CAVS_VERSION_1_5
ipc_write(IPC_DIPCT, ipc_read(IPC_DIPCT) | IPC_DIPCT_BUSY);
So in current flow we will never have situation that the variable _ipc->host_pending will be set to true in line 117.
7468563 to
439425f
Compare
|
IRT kernel side: According to the comments in thesofproject/linux#955 we can get these values from /sys/kernel/debug/sof/regs I wonder if we need to have it permanently added to FW, it's something that you turn on when you have IPC issues. Other registers there have more general usage f.e. trace point is for debugging whole boot-up process, these values are something that you add temporary for debugging very specific case and then remove them. |
|
@jajanusz |
Well, It's better than having it all the time. Can you add it under DEBUG menu? |
|
I'll update. |
439425f to
5b211e4
Compare
|
@jajanusz |
5b211e4 to
51a7786
Compare
There was a problem hiding this comment.
This should not be conditional, counters should always be at these offsets even if disabled.
There was a problem hiding this comment.
these will need to be added to kernel headers too.
There was a problem hiding this comment.
Updated. I've make PR on the kernel side:
thesofproject/linux#976
There was a problem hiding this comment.
@lgirdwood What's the point of having them in headers, if these registers are conditional. They can be there, but they don't have to. 3 first registers are used always and logged to the dmesg. These 2 are of new kind that is for debugging very specific purpose (and they may not even be there - depends on kconfig) I'm not sure if kernel should care about them at all. If we want these registers to be added to the kernel code we should log them all the time like I wanted to do in thesofproject/linux#955 . Otherwise as @plbossart mentioned somewhere earlier we will end up with bunch of registers definitions that are not used and people will ask, why they are there at all.
So we should adapt the policy that we log all of them on some kind of related error or we make kernel not care about them and developer will just get what he wants from debugfs.
There was a problem hiding this comment.
If you make this conditional, then the kernel needs a mechanism to know if those counters are present/valid.
The problem with debugfs is that there is no serialization with other events, e.g. you really want to show those counters when there is an IPC timeout, which you can't do with debugfs.
There was a problem hiding this comment.
@lgirdwood
Can't we make those memory windows conditional?
I've added counters for processed and received ipc tasks. They are dropped after trace points in memory window. Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
51a7786 to
5866406
Compare
I've added counters for processed and received ipc tasks.
They are dropped in memory window after trace points.
They can help verify whether firmware handled ipc task correctly.
Signed-off-by: Bartosz Kokoszko bartoszx.kokoszko@linux.intel.com