linux_dsm_epyc7002/Documentation/ABI/testing
Vaibhav Jain 70b565bbdb cxl: Prevent adapter reset if an active context exists
This patch prevents resetting the cxl adapter via sysfs in presence of
one or more active cxl_context on it. This protects against an
unrecoverable error caused by PSL owning a dirty cache line even after
reset and host tries to touch the same cache line. In case a force reset
of the card is required irrespective of any active contexts, the int
value -1 can be stored in the 'reset' sysfs attribute of the card.

The patch introduces a new atomic_t member named contexts_num inside
struct cxl that holds the number of active context attached to the card
, which is checked against '0' before proceeding with the reset. To
prevent against a race condition where a context is activated just after
reset check is performed, the contexts_num is atomically set to '-1'
after reset-check to indicate that no more contexts can be activated on
the card anymore.

Before activating a context we atomically test if contexts_num is
non-negative and if so, increment its value by one. In case the value of
contexts_num is negative then it indicates that the card is about to be
reset and context activation is error-ed out at that point.

Fixes: 62fa19d4b4 ("cxl: Add ability to reset the card")
Cc: stable@vger.kernel.org # v4.0+
Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-10-19 20:35:39 +11:00
..
configfs-acpi ACPI: add support for loading SSDTs via configfs 2016-07-08 21:52:36 +02:00
configfs-iio
configfs-rdma_cm
configfs-spear-pcie-gadget
configfs-stp-policy
configfs-usb-gadget
configfs-usb-gadget-acm
configfs-usb-gadget-ecm
configfs-usb-gadget-eem
configfs-usb-gadget-ffs
configfs-usb-gadget-hid
configfs-usb-gadget-loopback
configfs-usb-gadget-mass-storage
configfs-usb-gadget-midi
configfs-usb-gadget-ncm
configfs-usb-gadget-obex
configfs-usb-gadget-phonet
configfs-usb-gadget-printer
configfs-usb-gadget-rndis
configfs-usb-gadget-serial
configfs-usb-gadget-sourcesink
configfs-usb-gadget-subset
configfs-usb-gadget-tcm
configfs-usb-gadget-uac1
configfs-usb-gadget-uac2
configfs-usb-gadget-uvc Documentation: configfs-usb-gadget-uvc: fix kernel version 2016-05-31 11:12:58 +03:00
debugfs-driver-genwqe
debugfs-ec
debugfs-ideapad
debugfs-olpc
debugfs-pfo-nx-crypto
debugfs-pktcdvd
dev-kmsg
evm
gpio-cdev
ima_policy
procfs-diskstats
pstore
sysfs-ata
sysfs-block
sysfs-block-bcache
sysfs-block-dm
sysfs-block-rssd
sysfs-block-zram zram: introduce per-device debug_stat sysfs node 2016-05-20 17:58:30 -07:00
sysfs-bus-acpi
sysfs-bus-amba
sysfs-bus-bcma
sysfs-bus-coresight-devices-etb10
sysfs-bus-coresight-devices-etm3x
sysfs-bus-coresight-devices-etm4x
sysfs-bus-coresight-devices-funnel
sysfs-bus-coresight-devices-stm
sysfs-bus-coresight-devices-tmc
sysfs-bus-css
sysfs-bus-event_source-devices-events
sysfs-bus-event_source-devices-format
sysfs-bus-event_source-devices-hv_24x7
sysfs-bus-event_source-devices-hv_gpci
sysfs-bus-fcoe
sysfs-bus-hsi
sysfs-bus-i2c-devices-fsa9480
sysfs-bus-i2c-devices-hm6352
sysfs-bus-i2c-devices-lm3533
sysfs-bus-iio iio:core: timestamping clock selection support 2016-06-30 19:41:38 +01:00
sysfs-bus-iio-accel-bmc150
sysfs-bus-iio-adc-hi8435
sysfs-bus-iio-chemical-vz89x
sysfs-bus-iio-frequency-ad9523
sysfs-bus-iio-frequency-adf4350
sysfs-bus-iio-gyro-bmg160
sysfs-bus-iio-health-afe440x
sysfs-bus-iio-humidity-hdc100x
sysfs-bus-iio-ina2xx-adc
sysfs-bus-iio-light-lm3533-als
sysfs-bus-iio-magnetometer-hmc5843
sysfs-bus-iio-meas-spec
sysfs-bus-iio-mpu6050
sysfs-bus-iio-proximity-as3935 iio: proximity: as3935: correct IIO_CHAN_INFO_RAW output 2016-05-22 20:53:36 +01:00
sysfs-bus-iio-trigger-sysfs
sysfs-bus-iio-vf610
sysfs-bus-intel_th-devices-gth
sysfs-bus-intel_th-devices-msc
sysfs-bus-intel_th-devices-pti
sysfs-bus-intel_th-output-devices
sysfs-bus-mcb
sysfs-bus-mdio
sysfs-bus-media
sysfs-bus-mei
sysfs-bus-pci
sysfs-bus-pci-devices-cciss
sysfs-bus-pci-drivers-ehci_hcd
sysfs-bus-pci-drivers-janz-cmodio
sysfs-bus-platform
sysfs-bus-rbd rbd: add force close option 2016-08-24 23:49:17 +02:00
sysfs-bus-rpmsg
sysfs-bus-umc
sysfs-bus-usb
sysfs-bus-usb-devices-usbsevseg
sysfs-bus-usb-lvstest
sysfs-c2port
sysfs-cfq-target-latency
sysfs-class
sysfs-class-backlight-driver-adp8870
sysfs-class-backlight-driver-lm3533
sysfs-class-bdi
sysfs-class-cxl cxl: Prevent adapter reset if an active context exists 2016-10-19 20:35:39 +11:00
sysfs-class-devfreq
sysfs-class-extcon
sysfs-class-fpga-manager
sysfs-class-infiniband
sysfs-class-iommu
sysfs-class-iommu-amd-iommu
sysfs-class-iommu-intel-iommu
sysfs-class-lcd
sysfs-class-led Documentation: move oneshot trigger attributes documentation to ABI 2016-08-29 15:06:32 +02:00
sysfs-class-led-driver-lm3533
sysfs-class-led-flash
sysfs-class-led-trigger-oneshot Documentation: move oneshot trigger attributes documentation to ABI 2016-08-29 15:06:32 +02:00
sysfs-class-led-trigger-usbport usb: core: Introduce a USB port LED trigger 2016-09-27 12:20:17 +02:00
sysfs-class-leds-gt683r
sysfs-class-mei
sysfs-class-mic.txt Documentation: mic: fix kernel version 2016-08-30 14:45:50 +02:00
sysfs-class-mtd
sysfs-class-net
sysfs-class-net-batman-adv batman-adv: update elp interval documentation 2016-06-30 10:29:43 +02:00
sysfs-class-net-cdc_ncm
sysfs-class-net-grcan
sysfs-class-net-janz-ican3
sysfs-class-net-mesh
sysfs-class-net-qmi
sysfs-class-net-queues
sysfs-class-net-statistics
sysfs-class-pktcdvd
sysfs-class-power power: supply: Change Krzysztof Kozlowski's email to kernel.org 2016-08-17 14:15:58 +02:00
sysfs-class-power-twl4030
sysfs-class-powercap
sysfs-class-pwm pwm: sysfs: Add PWM capture support 2016-06-10 16:01:40 +02:00
sysfs-class-rc
sysfs-class-rc-nuvoton
sysfs-class-regulator
sysfs-class-rtc-rtc0-device-rtc_calibration
sysfs-class-scsi_host
sysfs-class-scsi_tape
sysfs-class-stm
sysfs-class-stm_source
sysfs-class-uwb_rc
sysfs-class-uwb_rc-wusbhc
sysfs-class-watchdog
sysfs-class-zram
sysfs-dev
sysfs-devices
sysfs-devices-edac
sysfs-devices-firmware_node
sysfs-devices-lpss_ltr
sysfs-devices-memory
sysfs-devices-mmc
sysfs-devices-online
sysfs-devices-platform-_UDC_-gadget
sysfs-devices-platform-docg3
sysfs-devices-platform-sh_mobile_lcdc_fb
sysfs-devices-power
sysfs-devices-power_resources_D0
sysfs-devices-power_resources_D1
sysfs-devices-power_resources_D2
sysfs-devices-power_resources_D3hot
sysfs-devices-power_resources_wakeup
sysfs-devices-power_state
sysfs-devices-real_power_state
sysfs-devices-resource_in_use
sysfs-devices-soc
sysfs-devices-sun
sysfs-devices-system-cpu arm64: cpuinfo: Expose MIDR_EL1 and REVIDR_EL1 to sysfs 2016-07-12 16:09:37 +01:00
sysfs-devices-system-ibm-rtl
sysfs-devices-system-xen_cpu
sysfs-driver-genwqe
sysfs-driver-hid
sysfs-driver-hid-corsair
sysfs-driver-hid-lenovo
sysfs-driver-hid-logitech-lg4ff HID: hid-logitech: Documentation updates/corrections 2016-09-26 15:39:56 +02:00
sysfs-driver-hid-multitouch
sysfs-driver-hid-picolcd
sysfs-driver-hid-prodikeys
sysfs-driver-hid-roccat-kone
sysfs-driver-hid-srws1
sysfs-driver-hid-wiimote
sysfs-driver-input-axp-pek
sysfs-driver-intel-rapid-start
sysfs-driver-pciback
sysfs-driver-ppi
sysfs-driver-samsung-laptop
sysfs-driver-st
sysfs-driver-tegra-fuse
sysfs-driver-toshiba_acpi
sysfs-driver-toshiba_haps
sysfs-driver-wacom HID: wacom: leds: use the ledclass instead of custom made sysfs files 2016-08-05 13:39:19 +02:00
sysfs-driver-xen-blkback
sysfs-driver-xen-blkfront
sysfs-firmware-acpi
sysfs-firmware-dmi-entries
sysfs-firmware-dmi-tables
sysfs-firmware-efi
sysfs-firmware-efi-esrt
sysfs-firmware-efi-runtime-map
sysfs-firmware-gsmi
sysfs-firmware-log
sysfs-firmware-memmap
sysfs-firmware-ofw
sysfs-firmware-qemu_fw_cfg
sysfs-firmware-sfi
sysfs-firmware-sgi_uv
sysfs-fs-ext4
sysfs-fs-f2fs
sysfs-fs-nilfs2
sysfs-fs-xfs
sysfs-hypervisor-pmu
sysfs-ibft
sysfs-kernel-boot_params
sysfs-kernel-fscaps
sysfs-kernel-iommu_groups
sysfs-kernel-irq genirq: Expose interrupt information through sysfs 2016-09-14 15:28:15 +02:00
sysfs-kernel-livepatch
sysfs-kernel-mm
sysfs-kernel-mm-hugepages
sysfs-kernel-mm-ksm
sysfs-kernel-slab
sysfs-kernel-uids
sysfs-kernel-vmcoreinfo
sysfs-memory-page-offline
sysfs-module
sysfs-ocfs2
sysfs-platform-asus-laptop
sysfs-platform-asus-wmi
sysfs-platform-at91
sysfs-platform-brcmstb-gisb-arb
sysfs-platform-chipidea-usb-otg
sysfs-platform-dell-laptop
sysfs-platform-eeepc-laptop
sysfs-platform-hidma
sysfs-platform-hidma-mgmt
sysfs-platform-i2c-demux-pinctrl
sysfs-platform-ideapad-laptop
sysfs-platform-kim
sysfs-platform-msi-laptop
sysfs-platform-tahvo-usb
sysfs-platform-ts5500
sysfs-platform-twl4030-usb
sysfs-platform-usbip-vudc
sysfs-power
sysfs-pps
sysfs-profiling
sysfs-ptp
sysfs-tty
sysfs-wusb_cbaf