diff options
author | Vaibhav Jain <vaibhav@linux.ibm.com> | 2018-05-04 15:13:41 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2018-05-11 12:34:56 -0500 |
commit | 92d1a4e923fa427ab73f52850381b08c1bcf5676 (patch) | |
tree | a09962826cf06d9a14a041356320bad46f44ae68 /core | |
parent | 1613c72d4f739332b93213674a63005c331453b9 (diff) | |
download | skiboot-92d1a4e923fa427ab73f52850381b08c1bcf5676.zip skiboot-92d1a4e923fa427ab73f52850381b08c1bcf5676.tar.gz skiboot-92d1a4e923fa427ab73f52850381b08c1bcf5676.tar.bz2 |
core/opal: Fix recursion check in opal_run_pollers()
An earlier commit introduced a counter variable poller_recursion to
limit to the number number of error messages shown when opal_pollers
are run recursively. However the check for the counter value was
placed in a way that the poller recursion was only detected first 16
times and then allowed afterwards.
This patch fixes this by moving the check for the counter value inside
the conditional branch with some re-factoring so that opal_poller
recursion is not erroneously allowed after poll_recursion is detected
first 16 times.
Fixes: b6a729e118f4 ("Limit number of Poller recursion detected errors to display")
Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/opal.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/core/opal.c b/core/opal.c index 3642fb0..e3a3bbd 100644 --- a/core/opal.c +++ b/core/opal.c @@ -552,20 +552,25 @@ void opal_run_pollers(void) bool was_in_poller; /* Don't re-enter on this CPU, unless it was an OPAL re-entry */ - if (this_cpu()->in_opal_call == 1 && - this_cpu()->in_poller && poller_recursion < 16) { + if (this_cpu()->in_opal_call == 1 && this_cpu()->in_poller) { + /** * @fwts-label OPALPollerRecursion * @fwts-advice Recursion detected in opal_run_pollers(). This * indicates a bug in OPAL where a poller ended up running * pollers, which doesn't lead anywhere good. */ - disable_fast_reboot("Poller recursion detected."); - prlog(PR_ERR, "OPAL: Poller recursion detected.\n"); - backtrace(); poller_recursion++; + if (poller_recursion <= 16) { + disable_fast_reboot("Poller recursion detected."); + prlog(PR_ERR, "OPAL: Poller recursion detected.\n"); + backtrace(); + + } + if (poller_recursion == 16) prlog(PR_ERR, "OPAL: Squashing future poller recursion warnings (>16).\n"); + return; } was_in_poller = this_cpu()->in_poller; |