linux-brain/arch/powerpc/platforms/powernv
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
..
eeh-powernv.c powerpc/powernv: Use CPU-endian hub diag-data type in pnv_eeh_get_and_dump_hub_diag() 2016-10-04 16:29:23 +11:00
idle.c powerpc/powernv: Use deepest stop state when cpu is offlined 2016-07-15 20:18:42 +10:00
Kconfig powerpc/powernv: Add opal-prd channel 2015-06-05 08:32:21 +10:00
Makefile powerpc/powernv: Split cxl code out into a separate file 2016-07-14 20:26:31 +10:00
npu-dma.c powerpc/sparse: Make a bunch of things static 2016-09-13 17:35:47 +10:00
opal-async.c powerpc/opal: Fix EBUSY bug in acquiring tokens 2017-12-20 10:07:28 +01:00
opal-dump.c powerpc/powernv : Drop reference added by kset_find_obj() 2016-08-29 12:48:21 +10:00
opal-elog.c powerpc/powernv : Drop reference added by kset_find_obj() 2016-08-29 12:48:21 +10:00
opal-flash.c powerpc/powernv: Add interfaces for flash device access 2015-04-11 20:49:21 +10:00
opal-hmi.c powerpc/powernv: Use the "unknown" checkstop type as a fallback 2016-04-11 20:30:40 +10:00
opal-irqchip.c powerpc: Remove all usages of NO_IRQ 2016-09-20 20:57:12 +10:00
opal-kmsg.c powerpc/powernv: Fix OPAL_CONSOLE_FLUSH prototype and usages 2016-01-13 12:35:17 +11:00
opal-lpc.c powerpc/powernv: Properly fix LPC debugfs endianness 2014-10-31 17:09:04 +11:00
opal-memory-errors.c powerpc/powernv: Fix spelling mistake "Retrived" -> "Retrieved" 2016-06-28 13:52:18 +10:00
opal-msglog.c powerpc/powernv: don't create OPAL msglog sysfs entry if memcons init fails 2016-02-22 20:31:55 +11:00
opal-nvram.c powerpc/powernv: Add pstore support on powernv 2015-03-23 14:06:10 +11:00
opal-power.c powerpc/powernv: Add poweroff (EPOW, DPO) events support for PowerNV platform 2015-07-16 13:34:36 +10:00
opal-prd.c powerpc/powernv: Drop owner assignment from platform_driver 2015-11-24 14:21:28 +11:00
opal-rtc.c powerpc/powernv: Only delay opal_rtc_read() retry when necessary 2015-12-27 19:12:40 +11:00
opal-sensor.c powerpc/opal: Add inline function to get rc from an ASYNC_COMP opal_msg 2016-06-29 17:33:18 +10:00
opal-sysparam.c powerpc/opal: Add inline function to get rc from an ASYNC_COMP opal_msg 2016-06-29 17:33:18 +10:00
opal-tracepoints.c powerpc: Introduce asm-prototypes.h 2016-06-16 22:39:54 +10:00
opal-wrappers.S powerpc/powernv: Fix opal_exit tracepoint opcode 2017-05-14 14:00:14 +02:00
opal-xscom.c powerpc/powernv: remove FW_FEATURE_OPALv3 and just use FW_FEATURE_OPAL 2015-12-17 22:40:54 +11:00
opal.c powerpc/book3s: Fix MCE console messages for unrecoverable MCE. 2016-08-09 19:46:54 +10:00
pci-cxl.c powerpc: Remove all usages of NO_IRQ 2016-09-20 20:57:12 +10:00
pci-ioda.c powerpc/powernv/ioda2: Gracefully fail if too many TCE levels requested 2017-12-14 09:28:21 +01:00
pci.c powerpc/powernv: Use CPU-endian PEST in pnv_pci_dump_p7ioc_diag_data() 2016-10-04 16:29:59 +11:00
pci.h dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
powernv.h powerpc/powernv: Use deepest stop state when cpu is offlined 2016-07-15 20:18:42 +10:00
rng.c powerpc: Use hardware RNG for arch_get_random_seed_* not arch_get_random_* 2015-07-23 19:52:03 +10:00
setup.c powerpc/powernv/cpufreq: Fix the frequency read by /proc/cpuinfo 2017-12-20 10:07:27 +01:00
smp.c powerpc/powernv: Fix CPU hotplug to handle waking on HVI 2017-02-14 15:25:40 -08:00
subcore-asm.S powerpc/powernv: Add support for POWER8 split core on powernv 2014-05-28 13:35:37 +10:00
subcore.c powerpc/powernv: Create separate subcores CPU feature bit 2016-02-22 20:47:46 +11:00
subcore.h powernv/powerpc: Add winkle support for offline cpus 2014-12-15 10:46:41 +11:00