linux/drivers/misc/cxl
Ian Munsie 5e7823c9bc cxl: Fix bug where AFU disable operation had no effect
The AFU disable operation has a bug where it will not clear the enable
bit and therefore will have no effect. To date this has likely been
masked by fact that we perform an AFU reset before the disable, which
also has the effect of clearing the enable bit, making the following
disable operation effectively a noop on most hardware. This patch
modifies the afu_control function to take a parameter to clear from the
AFU control register so that the disable operation can clear the
appropriate bit.

This bug was uncovered on the Mellanox CX4, which uses an XSL rather
than a PSL. On the XSL the reset operation will not complete while the
AFU is enabled, meaning the enable bit was still set at the start of the
disable and as a result this bug was hit and the disable also timed out.

Because of this difference in behaviour between the PSL and XSL, this
patch now makes the reset dependent on the card using a PSL to avoid
waiting for a timeout on the XSL. It is entirely possible that we may be
able to drop the reset altogether if it turns out we only ever needed it
due to this bug - however I am not willing to drop it without further
regression testing and have added comments to the code explaining the
background.

This also fixes a small issue where the AFU_Cntl register was read
outside of the lock that protects it.

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-07-08 22:11:18 +10:00
..
api.c cxl: Add set and get private data to context struct 2016-06-28 18:35:08 +10:00
base.c cxl: Parse device tree and create cxl device(s) at boot 2016-03-09 23:39:59 +11:00
context.c powerpc updates for 4.7 2016-05-20 10:12:41 -07:00
cxl.h cxl: Fix bug where AFU disable operation had no effect 2016-07-08 22:11:18 +10:00
debugfs.c cxl: Abstract the differences between the PSL and XSL 2016-06-16 23:08:54 +10:00
fault.c powerpc/mm: Replace _PAGE_USER with _PAGE_PRIVILEGED 2016-05-01 18:32:26 +10:00
file.c cxl: Add mechanism for delivering AFU driver specific events 2016-06-28 18:34:56 +10:00
flash.c cxl: static-ify variables to fix sparse warnings 2016-06-16 22:49:27 +10:00
guest.c cxl: Update process element after allocating interrupts 2016-06-16 23:08:49 +10:00
hcalls.c cxl: Add tracepoints around the cxl hcall 2016-03-09 23:40:01 +11:00
hcalls.h cxl: Add guest-specific code 2016-03-09 23:36:52 +11:00
irq.c cxl: Keep IRQ mappings on context teardown 2016-04-27 12:04:31 +10:00
Kconfig cxl: Add mechanism for delivering AFU driver specific events 2016-06-28 18:34:56 +10:00
main.c cxl: Adapter failure handling 2016-03-09 23:40:00 +11:00
Makefile cxl: Support to flash a new image on the adapter from a guest 2016-03-09 23:39:56 +11:00
native.c cxl: Fix bug where AFU disable operation had no effect 2016-07-08 22:11:18 +10:00
of.c cxl: Add guest-specific code 2016-03-09 23:36:52 +11:00
pci.c cxl: Fix bug where AFU disable operation had no effect 2016-07-08 22:11:18 +10:00
sysfs.c cxl: Allow initialization on timebase sync failures 2016-04-22 21:45:44 +10:00
trace.c cxl: Add tracepoints 2015-01-22 17:31:51 +11:00
trace.h cxl: Add tracepoints around the cxl hcall 2016-03-09 23:40:01 +11:00
vphb.c cxl: Make vPHB device node match adapter's 2016-06-16 23:11:30 +10:00