linux-brain/arch/powerpc/platforms
William A. Kennington III d7e7c431d6 powerpc/opal: Fix EBUSY bug in acquiring tokens
[ Upstream commit 71e24d7731 ]

The current code checks the completion map to look for the first token
that is complete. In some cases, a completion can come in but the
token can still be on lease to the caller processing the completion.
If this completed but unreleased token is the first token found in the
bitmap by another tasks trying to acquire a token, then the
__test_and_set_bit call will fail since the token will still be on
lease. The acquisition will then fail with an EBUSY.

This patch reorganizes the acquisition code to look at the
opal_async_token_map for an unleased token. If the token has no lease
it must have no outstanding completions so we should never see an
EBUSY, unless we have leased out too many tokens. Since
opal_async_get_token_inrerruptible is protected by a semaphore, we
will practically never see EBUSY anymore.

Fixes: 8d72482322 ("powerpc/powernv: Infrastructure to support OPAL async completion")
Signed-off-by: William A. Kennington III <wak@google.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-20 10:07:28 +01:00
..
8xx powerpc: Remove all usages of NO_IRQ 2016-09-20 20:57:12 +10:00
40x powerpc updates for 4.8 # 1 2016-07-30 21:01:36 -07:00
44x powerpc: Remove all usages of NO_IRQ 2016-09-20 20:57:12 +10:00
52xx powerpc: Remove all usages of NO_IRQ 2016-09-20 20:57:12 +10:00
82xx powerpc/e8248e: Select PHYLIB only if NETDEVICES is enabled 2016-09-24 23:59:47 -05:00
83xx powerpc/83xx: factor out the common codes of setup arch functions 2016-09-25 02:38:53 -05:00
85xx powerpc: Convert fsl_rstcr_restart to a reset handler 2016-09-25 02:38:50 -05:00
86xx powerpc: Convert fsl_rstcr_restart to a reset handler 2016-09-25 02:38:50 -05:00
512x powerpc: Remove all usages of NO_IRQ 2016-09-20 20:57:12 +10:00
amigaone powerpc: Move 32-bit probe() machine to later in the boot process 2016-07-21 19:06:42 +10:00
cell powerpc/spufs: Fix hash faults for kernel regions 2017-06-07 12:07:46 +02:00
chrp powerpc: Remove all usages of NO_IRQ 2016-09-20 20:57:12 +10:00
embedded6xx powerpc: Remove all usages of NO_IRQ 2016-09-20 20:57:12 +10:00
maple powerpc: Remove all usages of NO_IRQ 2016-09-20 20:57:12 +10:00
pasemi powerpc: Remove all usages of NO_IRQ 2016-09-20 20:57:12 +10:00
powermac powerpc updates for 4.9 2016-10-07 20:19:31 -07:00
powernv powerpc/opal: Fix EBUSY bug in acquiring tokens 2017-12-20 10:07:28 +01:00
ps3 powerpc/64: Simplify adaptation to new ISA v3.00 HPTE format 2017-01-19 20:18:06 +01:00
pseries powerpc/pseries: Fix parent_dn reference leak in add_dt_node() 2017-10-05 09:44:00 +02:00
fsl_uli1575.c of/irq: Refactor interrupt-map parsing 2013-10-24 11:43:04 +01:00
Kconfig RTC for 4.8 2016-08-05 09:48:22 -04:00
Kconfig.cputype powerpc: Set default CPU type to POWER8 for little endian builds 2016-10-04 16:15:00 +11:00
Makefile powerpc: Remove platforms/wsp and associated pieces 2014-06-11 16:35:38 +10:00