Commit 686978b1 authored by Michael Ellerman's avatar Michael Ellerman

powerpc/xive: Fix missing check of rc != OPAL_BUSY

Dan Carpenter noticed that the code in __xive_native_disable_queue() has a for
loop with an unconditional break in the middle, which doesn't make a lot of
sense.

What the code's supposed to do is loop as long as OPAL says it's busy, if we get
any other return code, either success or failure, then we should break the loop.

So add the missing check.

Fixes: 243e2511 ("powerpc/xive: Native exploitation of the XIVE interrupt controller")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent ca80d5d0
...@@ -180,6 +180,7 @@ static void __xive_native_disable_queue(u32 vp_id, struct xive_q *q, u8 prio) ...@@ -180,6 +180,7 @@ static void __xive_native_disable_queue(u32 vp_id, struct xive_q *q, u8 prio)
/* Disable the queue in HW */ /* Disable the queue in HW */
for (;;) { for (;;) {
rc = opal_xive_set_queue_info(vp_id, prio, 0, 0, 0); rc = opal_xive_set_queue_info(vp_id, prio, 0, 0, 0);
if (rc != OPAL_BUSY)
break; break;
msleep(1); msleep(1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment