summaryrefslogtreecommitdiffstats
path: root/Documentation/ABI/testing/sysfs-driver-qat
diff options
context:
space:
mode:
authorGiovanni Cabiddu <giovanni.cabiddu@intel.com>2022-06-27 09:36:49 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2022-07-08 15:15:59 +0800
commit5ee52118ac1481dd8a8f7e6a9bfe6ee05ac6ec92 (patch)
tree4fe54c5090c0414477cf296154ee7a13c812892f /Documentation/ABI/testing/sysfs-driver-qat
parentfac76f2260893dde5aa05bb693b4c13e8ed0454b (diff)
downloadlinux-stable-5ee52118ac1481dd8a8f7e6a9bfe6ee05ac6ec92.tar.gz
linux-stable-5ee52118ac1481dd8a8f7e6a9bfe6ee05ac6ec92.tar.bz2
linux-stable-5ee52118ac1481dd8a8f7e6a9bfe6ee05ac6ec92.zip
crypto: qat - expose device state through sysfs for 4xxx
Expose the device state through an attribute in sysfs and allow to change it. This is to stop and shutdown a QAT device in order to change its configuration. The state attribute has been added to a newly created `qat` attribute group which will contain all _QAT specific_ attributes. The logic that implements the sysfs entries is part of a new file, adf_sysfs.c. This exposes an entry point to allow the driver to create attributes. The function that creates the sysfs attributes is called from the probe function of the driver and not in the state machine init function to allow the change of states even if the device is in the down state. In order to restore the device configuration between a transition from down to up, the function that configures the devices has been abstracted into the HW data structure. The `state` attribute is only exposed for qat_4xxx devices. Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Co-developed-by: Tomasz Kowallik <tomaszx.kowalik@intel.com> Signed-off-by: Tomasz Kowallik <tomaszx.kowalik@intel.com> Reviewed-by: Adam Guerin <adam.guerin@intel.com> Reviewed-by: Fiona Trahe <fiona.trahe@intel.com> Reviewed-by: Wojciech Ziemba <wojciech.ziemba@intel.com> Reviewed-by: Vladis Dronov <vdronov@redhat.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'Documentation/ABI/testing/sysfs-driver-qat')
-rw-r--r--Documentation/ABI/testing/sysfs-driver-qat21
1 files changed, 21 insertions, 0 deletions
diff --git a/Documentation/ABI/testing/sysfs-driver-qat b/Documentation/ABI/testing/sysfs-driver-qat
new file mode 100644
index 000000000000..769b09cefa89
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-qat
@@ -0,0 +1,21 @@
+What: /sys/bus/pci/devices/<BDF>/qat/state
+Date: June 2022
+KernelVersion: 5.20
+Contact: qat-linux@intel.com
+Description: Reports the current state of the QAT device and allows to
+ change it.
+
+ This attribute is RW.
+
+ Returned values:
+ up: the device is up and running
+ down: the device is down
+
+ Allowed values:
+ up: initialize and start the device
+ down: stop the device and bring it down
+
+ It is possible to transition the device from up to down only
+ if the device is up and vice versa.
+
+ This attribute is only available for qat_4xxx devices.