Interrupt subsystem update for cascaded interrupts - #1053
Conversation
|
@lyakh It is a huge list. I checked some of them and enjoy them. Could you split them to small ones ? |
There was a problem hiding this comment.
It shouldn't be there. You just choose it in *_defconfig file or with select statements
There was a problem hiding this comment.
If you place them in defconfigs, that means, they would be selectable by the user, does that really make sense? What sense can it make to enable TRACE_DMA on a system, that doesn't have that capability? But yes, I can make this a "select" from all platforms apart from SUECREEK, that would be better, I think, thanks.
There was a problem hiding this comment.
For capability issue you have depends on. Decision to use feature should be selectable.
There was a problem hiding this comment.
Can you add some comments to fields? I know there are already lot of undocumented stuff but we should be more verbose when adding new code.
There was a problem hiding this comment.
I think this one can be visible to the user.
There was a problem hiding this comment.
The idea is, that the user or "selects" or *_defconfig select what specific hardware is available on the system. Some platforms can have DW_UART, others X_UART, others still Y_UART etc. And there are features in the SOF, that depend on "some" UART. So, all those specific UART implementations select UART to tell the code, that yes, UARTs are available on this system. Why would you make this selectable by the user? Are you proposing to make it possible to select DW_UART and deselect UART? What would that result in?
There was a problem hiding this comment.
0x90000 - magic number, also I don't know if we should add trace points for things that may be called many times, I guess you will be masking/unmasking. I thought trace points are for things that should be done once and in order, like boot sequence, fw load etc.
@lgirdwood Should give you more input about this
There was a problem hiding this comment.
oops, that's a debug left-over, will remove, thanks for spotting!
|
For what triggered review request for me (the small DMIC related changes) this looks OK. Apparently there's need to do fixes to pass the CI checks. |
|
@RanderWang thanks, I'm glad you liked it :-) But TBH I'm not sure I understand why splitting it would make it easier. Whether you make it 5 series of 7 commits each, or 7 series of 5 commits each or whatever - it's still 35. And they are (almost) all interdependent. So, it wouldn't be possible to, say, extract 10 of them, that are independent, that touch other files. Some of them can be swapped of course, some have no dependencies and can be extracted from the series, but most of it is really a huge gradual change. So, if you split it into 5 series with 7 commits each, you'll have to wait with each series until all previous ones have been reviewed and merged. |
lgirdwood
left a comment
There was a problem hiding this comment.
I've stopped reviewing, looks like this needs squashed and split into multiple PRs. Overall right direction and good work.
There was a problem hiding this comment.
Lets not use NULL here since it's not a UUID for removal. We could safely use timer (even though we don't use it in client code)
There was a problem hiding this comment.
why ? please state reason in the comment.
There was a problem hiding this comment.
ditto for all NULL unregisters.
There was a problem hiding this comment.
please comment what this block is checking for
There was a problem hiding this comment.
net loss of 4 bytes for no gain ?
There was a problem hiding this comment.
This is needed, because interrupts will become virtual later. They will be mapped at run-time based on their interrupt controller parent and the physical interrupt number on that controller. So, we want to map interrupts once and then use the virtual IRQ number. See patch 493b086
There was a problem hiding this comment.
Ok, but is the virtual number constant for each platform. i.e. APL virt IRQ 10 is always SSP0 ? If not then this will be painful to debug.
There was a problem hiding this comment.
As long as the board configuration doesn't change, yes, they will stay constant. The only thing, that can change them is adding new or removing existing interrupt controllers. I don't think that would happen too often. We can add trace to the mapping function, as long as the IPC interrupt is a DSP native one. Or we can dump a mapping at the end of booting and then print any new mappings.
There was a problem hiding this comment.
Dumping the mapping is nice. Lets do this is a subsequent PR later on.
There was a problem hiding this comment.
ditto, if compiler is providing this then there is no need to store it locally.
There was a problem hiding this comment.
Lets not use NULL since its being used internally as a UUID.
There was a problem hiding this comment.
The CPU core for each task will only be known at task creation time. i.e. after topology has been loaded. So we cannot hard code to current CPU unless this is being run on ALL CPUs.
There was a problem hiding this comment.
@lgirdwood Sorry, where is this done? I see
interrupt_register(PLATFORM_IRQ_TASK_LOW, IRQ_AUTO_UNMASK, _irq_task,
task_irq_low_get());
where PLATFORM_IRQ_TASK_LOW is IRQ_NUM_SOFTWARE[234] on all platforms, i.e. a DSP interrupt. Similar for MED and HIGH. That means they are registered on the current CPU. What am I missing?
There was a problem hiding this comment.
Not yet implemented on other cores atm, topology can request core > 0 but code will assign 0 (although this will change with upcoming PRs).
There was a problem hiding this comment.
hm, which PR is this? I think it should actually become better with these changes: instead of mangling on bitfields you'd call interrupt_enable() with a specific CPU, that's it. And it would be a good test case for that!
There was a problem hiding this comment.
would it be possible to merge this first and then port their work on top?
There was a problem hiding this comment.
possibly, both are large pieces of work, but have a small overlap surface so merging should not be too bad.
There was a problem hiding this comment.
Please start using #if (CONFIG_*) instead of defined, like in recent changes in sof (#if defined CONFIG_ -> #if CONFIG_)
|
@lgirdwood what's your preferred way to proceed with this PR? I realise that it is rather large, but splitting it doesn't really make it easier IMHO. Bear in mind, that the last 5 patches don't really belong to the PR. As for squashing - I think that would make patches less clear. I can see a couple of patches that are already a bit bigger than what one would normally want to have, but I don't see any patches, that are too small :-) Github really isn't the best tool for such reviews... I can email them, if that helps? |
First step is to address comments and resend. We don't need the macro updates/fixes, they can go in another PR that can be merged immediately. Dont need the UART driver either in the PR (it can be a another PR). |
|
@lgirdwood sure, most comments are non-controversial and easy to address. I'll take out two macro-fixing patches as well of course. I see at least two larger issues:
|
No, changing an API to later change it back makes no sense. It only creates more uncertainty. |
It isn't very pretty, I agree, but I thought easier development, debugging and review were a good reason for that. But np, I can redo that part. |
|
@tlauda I'm beginning (too late but still) to doubt: are we really sure that caches aren't coherent on xtensa between cores? |
|
I'm sure. |
|
@tlauda that's a pity... Do we have any datasheets where this is described? |
|
@tlauda @lgirdwood this manual cache management really gets very intrusive, error-prone, pollutes the sources a lot, and probably causes non-negligible performance reduction. Are there other ways to handle that? If we collect all that data, that we know, that different CPUs will access in a common area or even section, maybe we can simplify that management. Is it possible to make that area non-cacheable? That would possibly cost even more performance-wise. How are caches invalidated / written back - with a cache-line granularity? We could try to manually optimise for cache-line lengths, but as any manual optimisation, that might be hard to do right and to keep maintaining. Or we could manually flush / invalidate that whole area when beginning to handle any of our SMP-critical data and before returning from those functions. Or would flushing a couple of K of data be worse than repeated flushing of a handful of bytes? Any other options? |
|
@lyakh manual cache management is unavoidable. It compiles out on platforms that manage it in HW. Having cache aware list accessors and locks APIs will simplify things a lot, so these should probably be created first as a new PR. e.g. We also need to be aware that some operation are global (like IRQ registration) and some are local like the IRQ handler flow. This would influence when and where we would need to use cache ops i.e. IRQ handler would not need to invalidate global IRQ list but rather a sub list/object for that IRQ/level. |
|
@xiulipan I don't understand this log https://sof-ci.01.org/sofpr/PR1053/build2609/devicetest/CFL_RVP_HDA/multiple-pipeline-capture.sh/multiple-pipeline-capture.sh.txt - is it a timeout? Is this what you'd like me to check? |
|
@xiulipan I've just run on an HDA system and they all completed normally |
|
I cannot find the actual failure in the above test at https://quickbuild.igk.intel.com/build/4062204 - it says KW found something, but there's no information what and where it found. |
|
SOFCI TEST |
|
@xiulipan Is this real fail or some problem with kernel? |
|
@tlauda @lyakh @ClarexZhou @Jiangxinx |
|
@xiulipan @ClarexZhou @Jiangxinx This is urgent. I would like to merge it as soon as possible. Could you execute manual tests? |
|
SOFCI TEST |
1 similar comment
|
SOFCI TEST |
|
@tlauda when you follow the "details" link, you get all fields as "passed"... |
|
I tested BYT and APL platform, found one new issue on BYT platform: Failed while do playback and capture at same time: I/O error (100%). By the way, apl still can not pass multiple-pipeline-capture.sh ,and also can not pass multiple-pipeline-capture.sh on daily version. Env Step Output log file |
|
@Jiangxinx If I understand you correctly multiple-pipeline-capture on APL is no regression from this PR, but simultaneous playback and capture on BYT is. |
|
@tlauda Yes ,I have updated the simultaneous playback and capture issue information. |
|
multiple-pipeline-capture isn't a regression, also failed on daily sof on CFL. see #1674 And test this PR on GLK i2s notebook, CML HDA notebook, CFL-S HDA RVP and ICL-HDA RVP: No regression. Kernel(topic/sof-dev): f745362 |
|
@ClarexZhou @Jiangxinx Thanks for checking! Why the playback + capture fails on BYT, but CI reports PASS? |
|
@tlauda I think CI have not finished aplay, this new regression only can be reproduced after finished aplay. |
|
@Jiangxinx what topology did you test with BYT? And what BYT platform? A MinnowBoard? |
|
@lyakh MinnowBoard: sof-byt-nocodec.tplg & sof-byt-rt5651.tplg |
|
@lyakh @tlauda @Jiangxinx @ClarexZhou That is why I would like to manually notify here, it seem with issue #1674 we will get a timeout in real. But it seems our parser for the test result could not recognize timeout there. I have raise a bug for the test framework. Also we find that the new added multiple capture test case may cause some test failure, not sure if this comes from code base or the PR. So I think we can check the daily build test result and then we can see if the PR have issue. We are still debugging about the new test case to see if we are doing some invalid test. |
|
@lyakh @tlauda @fredoh9 |
|
@xiulipan Great, thanks for the update. Yes, we should definitely add also playback to extend our test coverage. This way we won't need such heavy manual PR testing in the future. |
|
@Jiangxinx @xiulipan have you actually tried aplay audio on MinnowBoard with rt5651? It comes out distorted for me with the head of the current master branch (I think it's a known issue when pulseaudio is used). As for this PR - I've just tried simultaneous playback and record with my PR and with the master head and I get the same result - both work (apart from the audio quality of course). In the trace there's also a flood of messages with both firmware versions. I used to test, what do you use? |
|
@tlauda @lyakh @Jiangxinx @xiulipan - I'm going to merge this today as it looks like this BYT+PA issue is unrelated. |
|
@lgirdwood Let's do this before merging any other patch, so there is no need for rebase. |
|
@lgirdwood thanks, appreciated! |
The first 35 patches are the actual interrupt subsystem modification to support cascaded interrupt controllers. Then 3 patches re-add the DW UART driver, here just for illustration, since they are handled in #957 . The last 2 patches add a DW INTC driver and enable it on Sue Creek. I expect a couple of comments here and there at least, so I pushed all those patches to this branch. In the final version, of course, they should not be present, at least the UART patches.
This patch series allows the removal of interrupt-map.h, but it is also included from host tools, so I didn't remove it for now. Once the header is removed, we should also remove "select IRQ_MAP" and "config IRQ_MAP" entries from Kconfig files.