Skip to content

Commit 92d1a4e

Browse files
vaibhav92stewartsmith
authored andcommitted
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: b6a729e ("Limit number of Poller recursion detected errors to display") Signed-off-by: Vaibhav Jain <[email protected]> Signed-off-by: Stewart Smith <[email protected]>
1 parent 1613c72 commit 92d1a4e

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

core/opal.c

+10-5
Original file line numberDiff line numberDiff line change
@@ -552,20 +552,25 @@ void opal_run_pollers(void)
552552
bool was_in_poller;
553553

554554
/* Don't re-enter on this CPU, unless it was an OPAL re-entry */
555-
if (this_cpu()->in_opal_call == 1 &&
556-
this_cpu()->in_poller && poller_recursion < 16) {
555+
if (this_cpu()->in_opal_call == 1 && this_cpu()->in_poller) {
556+
557557
/**
558558
* @fwts-label OPALPollerRecursion
559559
* @fwts-advice Recursion detected in opal_run_pollers(). This
560560
* indicates a bug in OPAL where a poller ended up running
561561
* pollers, which doesn't lead anywhere good.
562562
*/
563-
disable_fast_reboot("Poller recursion detected.");
564-
prlog(PR_ERR, "OPAL: Poller recursion detected.\n");
565-
backtrace();
566563
poller_recursion++;
564+
if (poller_recursion <= 16) {
565+
disable_fast_reboot("Poller recursion detected.");
566+
prlog(PR_ERR, "OPAL: Poller recursion detected.\n");
567+
backtrace();
568+
569+
}
570+
567571
if (poller_recursion == 16)
568572
prlog(PR_ERR, "OPAL: Squashing future poller recursion warnings (>16).\n");
573+
569574
return;
570575
}
571576
was_in_poller = this_cpu()->in_poller;

0 commit comments

Comments
 (0)