]> git.baikalelectronics.ru Git - kernel.git/commit
cxl: Fix driver use count
authorFrederic Barrat <fbarrat@linux.vnet.ibm.com>
Wed, 30 Aug 2017 10:15:49 +0000 (12:15 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 31 Aug 2017 04:26:49 +0000 (14:26 +1000)
commit08c0469563f8a57d22b86a914b333da9bdf57cb1
tree7cedf1314b7c02aa2d0100ef3de500a42ec99273
parent658ffb59895a1c43431e7446671c4b2d81212c5e
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: 19fed1c88c44 ("cxl: Rework context lifetimes")
Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/misc/cxl/api.c
drivers/misc/cxl/file.c