diff mbox series

[RESEND-PATCH] core/opal: Fix recursion check in opal_run_pollers()

Message ID 20180504094341.24907-1-vaibhav@linux.ibm.com
State Accepted
Headers show
Series [RESEND-PATCH] core/opal: Fix recursion check in opal_run_pollers() | expand

Commit Message

Vaibhav Jain May 4, 2018, 9:43 a.m. UTC
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>
---
Changelog:

Resend -> Previous patch didn't make to the skiboot mailing list due to
       	  a list membership glitch.
---
 core/opal.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

Comments

Stewart Smith May 11, 2018, 8:03 p.m. UTC | #1
Vaibhav Jain <vaibhav@linux.ibm.com> writes:
> 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>
> ---
> Changelog:
>
> Resend -> Previous patch didn't make to the skiboot mailing list due to
>        	  a list membership glitch.
> ---
>  core/opal.c | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)

thanks! Merged to master as of 92d1a4e923fa427ab73f52850381b08c1bcf5676
diff mbox series

Patch

diff --git a/core/opal.c b/core/opal.c
index 3642fb04..e3a3bbde 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;