linux/drivers
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
..
accessibility
acpi acpi/nfit: Fix memory corruption/Unregister mce decoder on failure 2017-07-17 11:43:58 -07:00
amba
android
ata
atm atm: zatm: Fix an error handling path in 'zatm_init_one()' 2017-07-18 11:37:46 -07:00
auxdisplay
base Power management fixes for v4.13-rc2 2017-07-20 14:56:46 -07:00
bcma
block block/ps3vram: Check return of ps3vram_cache_init 2017-08-17 23:03:44 +10:00
bluetooth
bus
cdrom
char
clk
clocksource clocksource/drivers/timer-of: Handle of_irq_get_byname() result correctly 2017-07-17 22:43:00 +02:00
connector
cpufreq Merge branches 'intel_pstate' and 'pm-domains' 2017-07-20 18:57:15 +02:00
cpuidle powerpc/powernv/idle: Disable LOSE_FULL_CONTEXT states when stop-api fails 2017-08-08 20:21:23 +10:00
crypto powerpc/powernv: Move GET_FIELD/SET_FIELD to vas.h 2017-08-31 14:26:20 +10:00
dax device-dax: fix sysfs duplicate warnings 2017-07-18 17:49:14 -07:00
dca
devfreq
dio
dma
dma-buf Merge branch 'drm-misc-next-fixes' into drm-misc-fixes 2017-07-17 11:56:07 -04:00
edac
eisa
extcon
firewire
firmware
fmc
fpga
fsi drivers/fsi: fix fsi_slave_mode prototype 2017-07-17 16:13:54 +02:00
gpio
gpu imx-drm: fix parallel display regression and typo in plane format list 2017-07-21 14:04:44 +10:00
hid HID: hid-logitech-hidpp: add NULL check on devm_kmemdup() return value 2017-07-20 15:45:39 +02:00
hsi
hv
hwmon
hwspinlock
hwtracing
i2c
ide ide: avoid warning for timings calculation 2017-07-21 04:37:22 +01:00
idle
iio
infiniband RDMA/core: Initialize port_num in qp_attr 2017-07-20 11:24:13 -04:00
input
iommu
ipack
irqchip irqchip/digicolor: Drop unnecessary static 2017-07-18 21:59:23 +02:00
isdn
leds
lguest
lightnvm
macintosh macintosh/rack-meter: Make of_device_ids const 2017-08-21 17:21:34 +10:00
mailbox
mcb
md Merge tag 'md/4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md 2017-07-18 11:51:08 -07:00
media
memory
memstick
message
mfd
misc cxl: Fix driver use count 2017-08-31 14:26:49 +10:00
mmc
mtd
mux mux: mux-core: unregister mux_class in mux_exit() 2017-07-17 16:38:35 +02:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-07-20 16:33:39 -07:00
nfc
ntb
nubus
nvdimm libnvdimm: fix badblock range handling of ARS range 2017-07-17 11:43:58 -07:00
nvme nvmet: don't report 0-bytes in serial number 2017-07-20 08:41:56 -06:00
nvmem nvmem: rockchip-efuse: amend compatible rk322x-efuse to rk3228-efuse 2017-07-17 16:15:57 +02:00
of
oprofile
parisc
parport
pci
pcmcia
perf
phy
pinctrl
platform
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi SCSI fixes on 20170715 2017-07-17 12:26:12 -07:00
sfi
sh
sn
soc
spi
spmi
ssb
staging staging: rtl8188eu: add TL-WN722N v2 support 2017-07-18 09:04:22 +02:00
target
tc
tee
thermal
thunderbolt thunderbolt: Correct access permissions for active NVM contents 2017-07-17 15:55:08 +02:00
tty powerpc/udbg: Reduce the footgun potential of EARLY_DEBUG_LPAR(_HVSI) 2017-07-31 16:56:45 +10:00
uio
usb xhci: fix memleak in xhci_run() 2017-07-20 14:40:36 +02:00
uwb
vfio
vhost
video
virt
virtio
vlynq
vme
w1 w1: omap-hdq: fix error return code in omap_hdq_probe() 2017-07-17 16:48:15 +02:00
watchdog
xen xen/balloon: don't online new memory initially 2017-07-23 08:13:18 +02:00
zorro
Kconfig
Makefile