linux_dsm_epyc7002/arch/powerpc/platforms/powernv
William A. Kennington III 71e24d7731 powerpc/opal: Fix EBUSY bug in acquiring tokens
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>
2017-11-06 20:17:41 +11:00
..
copy-paste.h powerpc/powernv/vas: Define copy/paste interfaces 2017-08-31 14:26:38 +10:00
eeh-powernv.c powerpc/powernv: Rework EEH initialization on powernv 2017-09-26 11:19:07 +10:00
idle.c powerpc/powernv: Clear LPCR[PECE1] via stop-api only for deep state offline 2017-09-20 13:30:09 +10:00
Kconfig powerpc/powernv/vas: Define vas_init() and vas_exit() 2017-08-31 14:26:26 +10:00
Makefile powerpc/powernv/vas: Define vas_init() and vas_exit() 2017-08-31 14:26:26 +10:00
memtrace.c powerpc/powernv: Enable removal of memory for in memory tracing 2017-08-24 22:14:38 +10:00
npu-dma.c powerpc updates for 4.14 2017-09-07 10:15:40 -07:00
opal-async.c powerpc/opal: Fix EBUSY bug in acquiring tokens 2017-11-06 20:17:41 +11:00
opal-dump.c powerpc/powernv : Drop reference added by kset_find_obj() 2016-08-29 12:48:21 +10:00
opal-elog.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
opal-flash.c powerpc: Add const to bin_attribute structures 2017-08-17 21:56:26 +10:00
opal-hmi.c powerpc-opal: Fix a typo in a comment line of two file headers 2017-10-22 12:16:36 +02:00
opal-imc.c powerpc/powernv: Fix build error in opal-imc.c when NUMA=n 2017-08-28 22:09:57 +10:00
opal-irqchip.c powerpc/powernv: Make opal_event_shutdown() callable from IRQ context 2017-10-06 20:03:08 +11: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: Create asm/debugfs.h and move powerpc_debugfs_root there 2017-04-11 07:46:03 +10:00
opal-memory-errors.c powerpc-opal: Fix a typo in a comment line of two file headers 2017-10-22 12:16:36 +02:00
opal-msglog.c powerpc/powernv: Report size of OPAL memcons log 2017-01-25 13:33: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-powercap.c powerpc/powernv: Add support for powercap framework 2017-08-10 22:39:53 +10:00
opal-prd.c powerpc/powernv: use memdup_user 2017-07-24 21:48:42 +10:00
opal-psr.c powerpc/powernv: Add support to set power-shifting-ratio 2017-08-10 22:40:01 +10:00
opal-rtc.c powerpc/powernv: Only delay opal_rtc_read() retry when necessary 2015-12-27 19:12:40 +11:00
opal-sensor-groups.c powerpc/powernv: Add support to clear sensor groups data 2017-08-10 22:40:05 +10:00
opal-sensor.c powerpc/powernv: Handle OPAL_WRONG_STATE in opal_get_sensor_data() 2017-03-31 15:22:56 +11: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 tracing: Have the reg function allow to fail 2016-12-09 09:13:30 -05:00
opal-wrappers.S powerpc/powernv: Use FIXUP_ENDIAN_HV in OPAL return 2017-11-06 16:48:09 +11:00
opal-xscom.c powerpc: Convert to using %pOF instead of full_name 2017-08-23 22:27:04 +10:00
opal.c powerpc/powernv: Use kernel crash path for machine checks 2017-08-31 14:26:04 +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: Reserve a hole which appears after enabling IOV 2017-11-06 16:48:12 +11:00
pci.c powerpc/powernv: Enable PCI peer-to-peer 2017-08-08 11:27:30 +10:00
pci.h powerpc/powernv: Rework EEH initialization on powernv 2017-09-26 11:19:07 +10:00
powernv.h powerpc/powernv: Flush console before platform error reboot 2017-08-31 14:26:03 +10:00
rng.c powerpc: Convert to using %pOF instead of full_name 2017-08-23 22:27:04 +10:00
setup.c powerpc/powernv: Enable TM without suspend if possible 2017-10-21 09:33:05 +11:00
smp.c powerpc/powernv: Implement NMI IPI with OPAL_SIGNAL_SYSTEM_RESET 2017-10-04 11:27:27 +11: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 updates for 4.13 2017-07-07 13:55:45 -07:00
subcore.h powernv/powerpc: Add winkle support for offline cpus 2014-12-15 10:46:41 +11:00
vas-window.c powerpc/powernv/vas: Define copy/paste interfaces 2017-08-31 14:26:38 +10:00
vas.c powerpc/powernv/vas: Define vas_init() and vas_exit() 2017-08-31 14:26:26 +10:00
vas.h powerpc/powernv/vas: Define copy/paste interfaces 2017-08-31 14:26:38 +10:00