aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/dasd_devmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/block/dasd_devmap.c')
-rw-r--r--drivers/s390/block/dasd_devmap.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index cf28ccc57948..5943266152f5 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -202,6 +202,8 @@ dasd_feature_list(char *str, char **endp)
202 features |= DASD_FEATURE_READONLY; 202 features |= DASD_FEATURE_READONLY;
203 else if (len == 4 && !strncmp(str, "diag", 4)) 203 else if (len == 4 && !strncmp(str, "diag", 4))
204 features |= DASD_FEATURE_USEDIAG; 204 features |= DASD_FEATURE_USEDIAG;
205 else if (len == 6 && !strncmp(str, "erplog", 6))
206 features |= DASD_FEATURE_ERPLOG;
205 else { 207 else {
206 MESSAGE(KERN_WARNING, 208 MESSAGE(KERN_WARNING,
207 "unsupported feature: %*s, " 209 "unsupported feature: %*s, "
@@ -709,6 +711,52 @@ dasd_ro_store(struct device *dev, struct device_attribute *attr,
709} 711}
710 712
711static DEVICE_ATTR(readonly, 0644, dasd_ro_show, dasd_ro_store); 713static DEVICE_ATTR(readonly, 0644, dasd_ro_show, dasd_ro_store);
714/*
715 * erplog controls the logging of ERP related data
716 * (e.g. failing channel programs).
717 */
718static ssize_t
719dasd_erplog_show(struct device *dev, struct device_attribute *attr, char *buf)
720{
721 struct dasd_devmap *devmap;
722 int erplog;
723
724 devmap = dasd_find_busid(dev->bus_id);
725 if (!IS_ERR(devmap))
726 erplog = (devmap->features & DASD_FEATURE_ERPLOG) != 0;
727 else
728 erplog = (DASD_FEATURE_DEFAULT & DASD_FEATURE_ERPLOG) != 0;
729 return snprintf(buf, PAGE_SIZE, erplog ? "1\n" : "0\n");
730}
731
732static ssize_t
733dasd_erplog_store(struct device *dev, struct device_attribute *attr,
734 const char *buf, size_t count)
735{
736 struct dasd_devmap *devmap;
737 int val;
738 char *endp;
739
740 devmap = dasd_devmap_from_cdev(to_ccwdev(dev));
741 if (IS_ERR(devmap))
742 return PTR_ERR(devmap);
743
744 val = simple_strtoul(buf, &endp, 0);
745 if (((endp + 1) < (buf + count)) || (val > 1))
746 return -EINVAL;
747
748 spin_lock(&dasd_devmap_lock);
749 if (val)
750 devmap->features |= DASD_FEATURE_ERPLOG;
751 else
752 devmap->features &= ~DASD_FEATURE_ERPLOG;
753 if (devmap->device)
754 devmap->device->features = devmap->features;
755 spin_unlock(&dasd_devmap_lock);
756 return count;
757}
758
759static DEVICE_ATTR(erplog, 0644, dasd_erplog_show, dasd_erplog_store);
712 760
713/* 761/*
714 * use_diag controls whether the driver should use diag rather than ssch 762 * use_diag controls whether the driver should use diag rather than ssch
@@ -896,6 +944,7 @@ static struct attribute * dasd_attrs[] = {
896 &dev_attr_uid.attr, 944 &dev_attr_uid.attr,
897 &dev_attr_use_diag.attr, 945 &dev_attr_use_diag.attr,
898 &dev_attr_eer_enabled.attr, 946 &dev_attr_eer_enabled.attr,
947 &dev_attr_erplog.attr,
899 NULL, 948 NULL,
900}; 949};
901 950