* [PATCH] powerpc/xive: Fix missing check of rc != OPAL_BUSY
@ 2017-04-20 5:55 Michael Ellerman
2017-04-21 4:09 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Michael Ellerman @ 2017-04-20 5:55 UTC (permalink / raw)
To: linuxppc-dev; +Cc: benh, dan.carpenter
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: 243e25112d06 ("powerpc/xive: Native exploitation of the XIVE interrupt controller")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/sysdev/xive/native.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/sysdev/xive/native.c b/arch/powerpc/sysdev/xive/native.c
index 5fae59186cb2..1a726229a427 100644
--- a/arch/powerpc/sysdev/xive/native.c
+++ b/arch/powerpc/sysdev/xive/native.c
@@ -180,6 +180,7 @@ static void __xive_native_disable_queue(u32 vp_id, struct xive_q *q, u8 prio)
/* Disable the queue in HW */
for (;;) {
rc = opal_xive_set_queue_info(vp_id, prio, 0, 0, 0);
+ if (rc != OPAL_BUSY)
break;
msleep(1);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: powerpc/xive: Fix missing check of rc != OPAL_BUSY
2017-04-20 5:55 [PATCH] powerpc/xive: Fix missing check of rc != OPAL_BUSY Michael Ellerman
@ 2017-04-21 4:09 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2017-04-21 4:09 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: dan.carpenter
On Thu, 2017-04-20 at 05:55:55 UTC, Michael Ellerman wrote:
> 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: 243e25112d06 ("powerpc/xive: Native exploitation of the XIVE interrupt controller")
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Applied to powerpc next.
https://git.kernel.org/powerpc/c/686978b15cef8314c3b3f38f0124e0
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-04-21 4:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-20 5:55 [PATCH] powerpc/xive: Fix missing check of rc != OPAL_BUSY Michael Ellerman
2017-04-21 4:09 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).