risc-v/mpfs: ihc: cleanup DEBUGASSERTs and irq enabling #11247
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replace DEBUGASSERTs with sanity checks. DEBUGASSERT()s are not necessarily enabled at all, thus risking the functionality especially in that case. Remove PANICs as well.
Don't enable the ihc irq too early. If enabled, and the master is already up, the irq is being issued so that the system gets stuck or is severely slowed down. Master may be already up if this NuttX hart only is rebooted, for example.
Summary
IHC is supposed to work in parallel with Linux. In order to keep the whole system robust, remove all DEBUGASSERT()s and DEBUGPANIC()s from IHC. Replace them with more meaningful sanity checks.
IHC maybe already partly active, if one NuttX hart is rebooted, but Linux isn't. In that case, the system gets way too many interrupts before it even gets up to handle them. Thus, relocate the irq enabling so that it happens only when the internals (OpenAMP etc) are fully set up.
Impact
MPFS / Polarfire IHC
Testing
Polarfire based devices: 3x Linux harts, one NuttX hart, with fierce RPMSG traffic between them; and rebooting NuttX manually repeatedly.