linux/drivers/misc
Vaibhav Jain ea9a26d117 cxl: Force context lock during EEH flow
During an eeh event when the cxl card is fenced and card sysfs attr
perst_reloads_same_image is set following warning message is seen in the
kernel logs:

  Adapter context unlocked with 0 active contexts
  ------------[ cut here ]------------
  WARNING: CPU: 12 PID: 627 at
  ../drivers/misc/cxl/main.c:325 cxl_adapter_context_unlock+0x60/0x80 [cxl]

Even though this warning is harmless, it clutters the kernel log
during an eeh event. This warning is triggered as the EEH callback
cxl_pci_error_detected doesn't obtain a context-lock before forcibly
detaching all active context and when context-lock is released during
call to cxl_configure_adapter from cxl_pci_slot_reset, a warning in
cxl_adapter_context_unlock is triggered.

To fix this warning, we acquire the adapter context-lock via
cxl_adapter_context_lock() in the eeh callback
cxl_pci_error_detected() once all the virtual AFU PHBs are notified
and their contexts detached. The context-lock is released in
cxl_pci_slot_reset() after the adapter is successfully reconfigured
and before the we call the slot_reset callback on slice attached
device-drivers.

Fixes: 70b565bbdb ("cxl: Prevent adapter reset if an active context exists")
Cc: stable@vger.kernel.org # v4.9+
Reported-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Tested-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-05-02 22:41:41 +10:00
..
altera-stapl
c2port
cb710
cxl cxl: Force context lock during EEH flow 2017-05-02 22:41:41 +10:00
echo
eeprom sched/headers: Prepare to remove <linux/cred.h> inclusion from <linux/sched.h> 2017-03-02 08:42:31 +01:00
genwqe sched/headers: Prepare for new header dependencies before moving code to <linux/sched/signal.h> 2017-03-02 08:42:29 +01:00
ibmasm sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
lis3lv02d sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
mei sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
mic Merge branch 'WIP.sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-03-03 10:16:38 -08:00
sgi-gru mm: convert generic code to 5-level paging 2017-03-09 11:48:47 -08:00
sgi-xp net: use core MTU range checking in misc drivers 2016-10-20 14:51:10 -04:00
ti-st drivers: misc: ti-st: Use int instead of fuzzy char for callback status 2016-07-17 19:59:26 +02:00
vmw_vmci sched/headers: Prepare to remove spurious <linux/sched.h> inclusion dependencies 2017-03-02 08:42:41 +01:00
ad525x_dpot-i2c.c
ad525x_dpot-spi.c
ad525x_dpot.c misc: ad525x_dpot: Fix the enabling of the "otpXen" attributes 2016-03-01 16:55:13 -08:00
ad525x_dpot.h
apds990x.c
apds9802als.c
arm-charlcd.c
atmel_tclib.c
atmel-ssc.c misc: atmel-ssc: register as sound DAI if #sound-dai-cells is present 2016-12-15 12:13:31 +00:00
bh1770glc.c
cs5535-mfgpt.c
ds1682.c
dummy-irq.c
enclosure.c
fsa9480.c
hmc6352.c
hpilo.c drivers/misc/hpilo: Changes to support new security states in iLO5 FW 2016-09-27 12:53:46 +02:00
hpilo.h
ics932s401.c
ioc4.c
isl29003.c
isl29020.c
Kconfig misc: panel: Move all suboptions into a big if section 2017-02-10 15:32:53 +01:00
kgdbts.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task.h> 2017-03-02 08:42:35 +01:00
lattice-ecp3-config.c
lkdtm_bugs.c char/misc driver patches for 4.11-rc1 2017-02-22 11:38:22 -08:00
lkdtm_core.c char/misc driver patches for 4.11-rc1 2017-02-22 11:38:22 -08:00
lkdtm_heap.c sched/headers: Prepare to remove <linux/cred.h> inclusion from <linux/sched.h> 2017-03-02 08:42:31 +01:00
lkdtm_perms.c lkdtm: Do not use flush_icache_range() on user addresses 2016-11-10 15:34:56 +01:00
lkdtm_rodata.c lkdtm: Mark lkdtm_rodata_do_nothing() notrace 2016-08-31 13:12:38 +02:00
lkdtm_usercopy.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h> 2017-03-02 08:42:36 +01:00
lkdtm.h lkdtm: Convert to refcount_t testing 2017-02-10 09:04:20 +01:00
Makefile misc: sram: Integrate protect-exec reserved sram area type 2017-01-25 11:48:03 +01:00
panel.c misc: panel: Abstract temporary backlight handling 2017-02-10 15:34:02 +01:00
pch_phub.c misc: pch_phub: Add UART_CLK quirk for Boston platform 2016-08-31 15:45:18 +02:00
phantom.c
pti.c
qcom-coincell.c ARM: qcom: silence an uninitialized variable warning 2016-05-01 14:20:04 -07:00
spear13xx_pcie_gadget.c
sram-exec.c misc: sram: Introduce support code for protect-exec sram type 2017-01-25 11:48:03 +01:00
sram.c misc: sram: Integrate protect-exec reserved sram area type 2017-01-25 11:48:03 +01:00
sram.h misc: sram: Integrate protect-exec reserved sram area type 2017-01-25 11:48:03 +01:00
ti_dac7512.c
tifm_7xx1.c
tifm_core.c
tsl2550.c
vexpress-syscfg.c sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
vmw_balloon.c