aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/xive/native.c
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2017-04-20 14:43:19 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2017-04-20 14:43:19 +1000
commit686978b15cef8314c3b3f38f0124e070b98eae37 (patch)
treeeb5ebabe7c22abe66386505bc597d27a0d2345fa /arch/powerpc/sysdev/xive/native.c
parentpowerpc/64s: Remove SAO feature from Power9 DD1 (diff)
downloadlinux-dev-686978b15cef8314c3b3f38f0124e070b98eae37.tar.xz
linux-dev-686978b15cef8314c3b3f38f0124e070b98eae37.zip
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: 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>
Diffstat (limited to 'arch/powerpc/sysdev/xive/native.c')
-rw-r--r--arch/powerpc/sysdev/xive/native.c1
1 files changed, 1 insertions, 0 deletions
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);
}