aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/dasd_devmap.c
diff options
context:
space:
mode:
authorStefan Haberland <sth@linux.ibm.com>2023-04-05 16:20:14 +0200
committerJens Axboe <axboe@kernel.dk>2023-04-11 19:53:08 -0600
commitbdac94e29564bab9f24c2700f16ff11f31af7c11 (patch)
tree241be86af94c770ce65687c4901169610adb2c92 /drivers/s390/block/dasd_devmap.c
parent9558a8e9d4a681e67b3abe9cabf3e3d8825af57e (diff)
downloadlinux-bdac94e29564bab9f24c2700f16ff11f31af7c11.tar.gz
s390/dasd: add aq_requeue sysfs attribute
Add a sysfs attribute to control if all IO requests will be requeued to the blocklayer in case of an autoquiesce event or not. A value of 1 means that in case of an autoquiesce event all IO requests will be requeued to the blocklayer. A value of 0 means that the device will only be stopped. Signed-off-by: Stefan Haberland <sth@linux.ibm.com> Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com> Reviewed-by: Halil Pasic <pasic@linux.ibm.com> Link: https://lore.kernel.org/r/20230405142017.2446986-5-sth@linux.ibm.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/s390/block/dasd_devmap.c')
-rw-r--r--drivers/s390/block/dasd_devmap.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index c7c948c5576114..95c7959c7949b5 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -1518,6 +1518,41 @@ static ssize_t dasd_aq_mask_store(struct device *dev, struct device_attribute *a
static DEVICE_ATTR(aq_mask, 0644, dasd_aq_mask_show, dasd_aq_mask_store);
/*
+ * aq_requeue controls if requests are returned to the blocklayer on quiesce
+ * or if requests are only not started
+ */
+static ssize_t dasd_aqr_show(struct device *dev, struct device_attribute *attr,
+ char *buf)
+{
+ struct dasd_devmap *devmap;
+ int flag;
+
+ devmap = dasd_find_busid(dev_name(dev));
+ if (!IS_ERR(devmap))
+ flag = (devmap->features & DASD_FEATURE_REQUEUEQUIESCE) != 0;
+ else
+ flag = (DASD_FEATURE_DEFAULT &
+ DASD_FEATURE_REQUEUEQUIESCE) != 0;
+ return sysfs_emit(buf, "%d\n", flag);
+}
+
+static ssize_t dasd_aqr_store(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ bool val;
+ int rc;
+
+ if (kstrtobool(buf, &val))
+ return -EINVAL;
+
+ rc = dasd_set_feature(to_ccwdev(dev), DASD_FEATURE_REQUEUEQUIESCE, val);
+
+ return rc ? : count;
+}
+
+static DEVICE_ATTR(aq_requeue, 0644, dasd_aqr_show, dasd_aqr_store);
+
+/*
* expiration time for default requests
*/
static ssize_t
@@ -2367,6 +2402,7 @@ static struct attribute * dasd_attrs[] = {
&dev_attr_copy_role.attr,
&dev_attr_ping.attr,
&dev_attr_aq_mask.attr,
+ &dev_attr_aq_requeue.attr,
NULL,
};