remarkable-linux/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 Documentation: iio: Add IIO software devices docs 2016-05-04 11:44:15 +01:00
configfs-rdma_cm IB/cma: Add configfs for rdma_cm 2015-12-23 10:39:52 -05:00
configfs-spear-pcie-gadget
configfs-stp-policy stm class: Introduce an abstraction for System Trace Module devices 2015-10-04 20:28:58 +01:00
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 Doc: ABI: configfs-usb-gadget-sourcesink: add two entries for depth of queue 2015-12-15 09:12:41 -06:00
configfs-usb-gadget-subset
configfs-usb-gadget-tcm usb: gadget: f_tcm: add configfs support 2015-12-20 19:40:45 -08:00
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 gpio: add a userspace character device ABI 2016-02-09 11:09:52 +01:00
ima_policy ima: support for kexec image and initramfs 2016-02-21 09:06:16 -05:00
procfs-diskstats
pstore
sysfs-ata
sysfs-block block: Export integrity data interval size in sysfs 2015-10-21 14:42:41 -06:00
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 coresight: etb10: splitting sysFS "status" entry 2016-05-01 14:12:14 -07:00
sysfs-bus-coresight-devices-etm3x coresight: etm3x: adding documentation for sysFS's cpu interface 2015-10-17 22:03:00 -07:00
sysfs-bus-coresight-devices-etm4x coresight: etm4x: adding config and traceid registers 2016-05-01 14:12:14 -07:00
sysfs-bus-coresight-devices-funnel
sysfs-bus-coresight-devices-stm coresight: stm: adding driver for CoreSight STM component 2016-05-03 14:59:30 -07:00
sysfs-bus-coresight-devices-tmc coresight: tmc: adding sysFS management entries 2016-05-03 14:59:30 -07:00
sysfs-bus-css
sysfs-bus-event_source-devices-events
sysfs-bus-event_source-devices-format
sysfs-bus-event_source-devices-hv_24x7 Documentation: fix common spelling mistakes 2016-04-28 07:51:59 -06:00
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 iio: adc: hi8435: Holt HI-8435 threshold detector 2015-09-23 20:23:18 +01:00
sysfs-bus-iio-chemical-vz89x iio: chemical: add SGX VZ89x VOC sensor support 2015-09-23 20:23:26 +01:00
sysfs-bus-iio-frequency-ad9523
sysfs-bus-iio-frequency-adf4350
sysfs-bus-iio-gyro-bmg160
sysfs-bus-iio-health-afe440x iio: health/afe440x: Make gain settings a modifier for the stages 2016-05-04 11:11:30 +01:00
sysfs-bus-iio-humidity-hdc100x iio: humidity: add HDC100x support 2015-09-23 20:23:19 +01:00
sysfs-bus-iio-ina2xx-adc iio: ina2xx: add ABI documentation entry sysfs-bus-iio-ina2xx-adc 2015-12-19 15:08:00 +00:00
sysfs-bus-iio-light-lm3533-als
sysfs-bus-iio-magnetometer-hmc5843 iio: hmc5843: Add ABI documentation file for hmc5843 2016-02-21 20:22:23 +00:00
sysfs-bus-iio-meas-spec Add ms8607 meas-spec driver support 2015-10-11 10:21:21 +01:00
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 Documentation: iio-trig-sysfs: Add remove_trigger attribute ABI 2015-08-16 10:51:23 +01:00
sysfs-bus-iio-vf610 iio: dac: vf610_dac: Add IIO DAC driver for Vybrid SoC 2016-02-24 20:52:55 +00:00
sysfs-bus-intel_th-devices-gth intel_th: Add Global Trace Hub driver 2015-10-04 20:28:58 +01:00
sysfs-bus-intel_th-devices-msc intel_th: Add Memory Storage Unit driver 2015-10-04 20:28:58 +01:00
sysfs-bus-intel_th-devices-pti intel_th: Add PTI output driver 2015-10-04 20:28:58 +01:00
sysfs-bus-intel_th-output-devices intel_th: Add driver infrastructure for Intel(R) Trace Hub devices 2015-10-04 20:28:58 +01:00
sysfs-bus-mcb mcb: export bus information via sysfs 2016-05-03 15:07:35 -07:00
sysfs-bus-mdio
sysfs-bus-media
sysfs-bus-mei mei: bus: export client protocol version 2015-09-20 19:30:10 -07:00
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 usb: core: lpm: add sysfs node for usb3 lpm permit 2015-12-01 14:58:18 -08:00
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 fpga manager: add sysfs interface document 2015-10-07 18:07:20 +01:00
sysfs-class-infiniband IB/core: Add gid attributes to sysfs 2015-12-23 10:35:11 -05:00
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 net: cdc_ncm: add "ndp_to_end" sysfs attribute 2015-12-06 22:52:18 -05:00
sysfs-class-net-grcan
sysfs-class-net-janz-ican3
sysfs-class-net-mesh Doc: update email address 2015-12-16 00:21:40 +08:00
sysfs-class-net-qmi net: qmi_wwan: document the qmi/raw_ip sysfs file 2015-12-04 16:56:23 -05:00
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 [media] media: rc: nuvoton: switch attribute wakeup_data to text 2016-03-05 08:22:03 -03:00
sysfs-class-regulator
sysfs-class-rtc-rtc0-device-rtc_calibration
sysfs-class-scsi_host
sysfs-class-scsi_tape
sysfs-class-stm stm class: Support devices that override software assigned masters 2016-05-03 14:59:30 -07:00
sysfs-class-stm_source stm class: Introduce an abstraction for System Trace Module devices 2015-10-04 20:28:58 +01:00
sysfs-class-uwb_rc
sysfs-class-uwb_rc-wusbhc
sysfs-class-watchdog watchdog: Read device status through sysfs attributes 2015-12-27 16:55:57 +01:00
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 HID: corsair: Add Corsair Vengeance K90 driver 2015-09-30 21:28:10 +02:00
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 Documentation: fix common spelling mistakes 2016-04-28 07:51:59 -06:00
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 tpm: update PPI documentation to address the location change. 2015-10-19 01:01:20 +02:00
sysfs-driver-samsung-laptop
sysfs-driver-st st: allow debug output to be enabled or disabled via sysfs 2015-11-09 17:17:27 -08:00
sysfs-driver-tegra-fuse
sysfs-driver-toshiba_acpi Documentation/ABI: Update sysfs-driver-toshiba_acpi file 2016-03-23 10:05:37 -07:00
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 Documentation: fix common spelling mistakes 2016-04-28 07:51:59 -06:00
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 firmware: create directory hierarchy for sysfs fw_cfg entries 2016-02-09 17:37:39 -08:00
sysfs-firmware-sfi
sysfs-firmware-sgi_uv
sysfs-fs-ext4
sysfs-fs-f2fs f2fs: introduce lifetime write IO statistics 2016-02-22 16:07:23 -08:00
sysfs-fs-nilfs2
sysfs-fs-xfs
sysfs-hypervisor-pmu xen/PMU: Sysfs interface for setting Xen PMU mode 2015-08-20 12:24:26 +01:00
sysfs-ibft ibft: Expose iBFT acpi header via sysfs 2016-05-16 11:14:29 -04:00
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 livepatch: function,sympos scheme in livepatch sysfs directory 2015-12-03 23:01:27 +01:00
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 dmaengine: qcom_hidma: add support for object hierarchy 2016-05-14 11:54:45 +05:30
sysfs-platform-hidma-mgmt dmaengine: add Qualcomm Technologies HIDMA management driver 2016-03-11 07:42:23 +05:30
sysfs-platform-i2c-demux-pinctrl i2c: mux: demux-pinctrl: Update docs to new sysfs-attributes 2016-04-07 21:13:02 +02:00
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 Documentation: ABI: Add doc for usbip-vudc attributes 2016-04-28 12:28:08 -07:00
sysfs-power PM / sleep: Report interrupt that caused system wakeup 2015-09-16 14:20:41 +02:00
sysfs-pps
sysfs-profiling
sysfs-ptp Documentation: fix sysfs-ptp 2015-12-08 14:50:12 +01:00
sysfs-tty
sysfs-wusb_cbaf