linux/drivers/misc/cxl
Frederic Barrat 197267d035 cxl: Fix driver use count
cxl keeps a driver use count, which is used with the hash memory model
on p8 to know when to upgrade local TLBIs to global and to trigger
callbacks to manage the MMU for PSL8.

If a process opens a context and closes without attaching or fails the
attachment, the driver use count is never decremented. As a
consequence, TLB invalidations remain global, even if there are no
active cxl contexts.

We should increment the driver use count when the process is attaching
to the cxl adapter, and not on open. It's not needed before the
adapter starts using the context and the use count is decremented on
the detach path, so it makes more sense.

It affects only the user api. The kernel api is already doing The
Right Thing.

Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org # v4.2+
Fixes: 7bb5d91a4d ("cxl: Rework context lifetimes")
Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-08-31 14:26:49 +10:00
..
Kconfig cxl: Export library to support IBM XSL 2017-07-03 23:07:03 +10:00
Makefile cxl: Export library to support IBM XSL 2017-07-03 23:07:03 +10:00
api.c cxl: Fix driver use count 2017-08-31 14:26:49 +10:00
base.c cxl: Add support for interrupts on the Mellanox CX4 2016-07-14 20:27:08 +10:00
context.c cxl: Fixes for Coherent Accelerator Interface Architecture 2.0 2017-06-23 16:26:23 +10:00
cxl.h cxl: Export library to support IBM XSL 2017-07-03 23:07:03 +10:00
cxllib.c cxl: Export library to support IBM XSL 2017-07-03 23:07:03 +10:00
debugfs.c cxl: Add psl9 specific code 2017-04-13 23:34:31 +10:00
fault.c powerpc/mm/cxl: Add barrier when setting mm cpumask 2017-08-31 14:26:39 +10:00
file.c cxl: Fix driver use count 2017-08-31 14:26:49 +10:00
flash.c cxl: Unlock on error in probe 2017-06-06 19:23:52 +10:00
guest.c cxl: Add psl9 specific code 2017-04-13 23:34:31 +10:00
hcalls.c cxl: Remove unused values in bare-metal environment. 2017-04-13 23:34:28 +10:00
hcalls.h cxl: Add guest-specific code 2016-03-09 23:36:52 +11:00
irq.c cxl: Add psl9 specific code 2017-04-13 23:34:31 +10:00
main.c cxl: Fixes for Coherent Accelerator Interface Architecture 2.0 2017-06-23 16:26:23 +10:00
native.c cxl: Export library to support IBM XSL 2017-07-03 23:07:03 +10:00
of.c cxl: replace loop with for_each_child_of_node(), remove unneeded of_node_put() 2016-10-04 16:19:23 +11:00
pci.c cxl: Export library to support IBM XSL 2017-07-03 23:07:03 +10:00
phb.c cxl: Fix error handling in _cxl_pci_associate_default_context() 2016-11-18 22:41:08 +11:00
sysfs.c cxl: Prevent adapter reset if an active context exists 2016-10-19 20:35:39 +11:00
trace.c cxl: Add tracepoints 2015-01-22 17:31:51 +11:00
trace.h cxl: Add psl9 specific code 2017-04-13 23:34:31 +10:00
vphb.c cxl: fix nested locking hang during EEH hotplug 2017-02-21 21:32:52 +11:00