diff options
author | Michael Ernst <mernst@de.ibm.com> | 2010-08-09 12:12:50 -0400 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-08-09 12:12:53 -0400 |
commit | fd0457a6ae52141718a15652fb80d867e1bf1d10 (patch) | |
tree | 5bbc54259c2ddfbf96a2be728e8d971fdb7f2039 /drivers/s390/cio/device.c | |
parent | 45d7f32c7a43cbb9592886d38190e379e2eb2226 (diff) |
[S390] cio: CHSC SIOSL Support
A Linux interface for the CHSC command
store-I/O-operation-status-and-initiate-logging (SIOSL).
Model-dependent logging within the channel subsystem can be invoked
via a helper function or a writable subchannel device attribute.
Signed-off-by: Michael Ernst <mernst@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/device.c')
-rw-r--r-- | drivers/s390/cio/device.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 6d229f3523a0..75acec3b2d6b 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include "ioasm.h" | 36 | #include "ioasm.h" |
37 | #include "io_sch.h" | 37 | #include "io_sch.h" |
38 | #include "blacklist.h" | 38 | #include "blacklist.h" |
39 | #include "chsc.h" | ||
39 | 40 | ||
40 | static struct timer_list recovery_timer; | 41 | static struct timer_list recovery_timer; |
41 | static DEFINE_SPINLOCK(recovery_lock); | 42 | static DEFINE_SPINLOCK(recovery_lock); |
@@ -598,6 +599,25 @@ available_show (struct device *dev, struct device_attribute *attr, char *buf) | |||
598 | } | 599 | } |
599 | } | 600 | } |
600 | 601 | ||
602 | static ssize_t | ||
603 | initiate_logging(struct device *dev, struct device_attribute *attr, | ||
604 | const char *buf, size_t count) | ||
605 | { | ||
606 | struct subchannel *sch = to_subchannel(dev); | ||
607 | int rc; | ||
608 | |||
609 | rc = chsc_siosl(sch->schid); | ||
610 | if (rc < 0) { | ||
611 | pr_warning("Logging for subchannel 0.%x.%04x failed with " | ||
612 | "errno=%d\n", | ||
613 | sch->schid.ssid, sch->schid.sch_no, rc); | ||
614 | return rc; | ||
615 | } | ||
616 | pr_notice("Logging for subchannel 0.%x.%04x was triggered\n", | ||
617 | sch->schid.ssid, sch->schid.sch_no); | ||
618 | return count; | ||
619 | } | ||
620 | |||
601 | static DEVICE_ATTR(chpids, 0444, chpids_show, NULL); | 621 | static DEVICE_ATTR(chpids, 0444, chpids_show, NULL); |
602 | static DEVICE_ATTR(pimpampom, 0444, pimpampom_show, NULL); | 622 | static DEVICE_ATTR(pimpampom, 0444, pimpampom_show, NULL); |
603 | static DEVICE_ATTR(devtype, 0444, devtype_show, NULL); | 623 | static DEVICE_ATTR(devtype, 0444, devtype_show, NULL); |
@@ -605,10 +625,12 @@ static DEVICE_ATTR(cutype, 0444, cutype_show, NULL); | |||
605 | static DEVICE_ATTR(modalias, 0444, modalias_show, NULL); | 625 | static DEVICE_ATTR(modalias, 0444, modalias_show, NULL); |
606 | static DEVICE_ATTR(online, 0644, online_show, online_store); | 626 | static DEVICE_ATTR(online, 0644, online_show, online_store); |
607 | static DEVICE_ATTR(availability, 0444, available_show, NULL); | 627 | static DEVICE_ATTR(availability, 0444, available_show, NULL); |
628 | static DEVICE_ATTR(logging, 0200, NULL, initiate_logging); | ||
608 | 629 | ||
609 | static struct attribute *io_subchannel_attrs[] = { | 630 | static struct attribute *io_subchannel_attrs[] = { |
610 | &dev_attr_chpids.attr, | 631 | &dev_attr_chpids.attr, |
611 | &dev_attr_pimpampom.attr, | 632 | &dev_attr_pimpampom.attr, |
633 | &dev_attr_logging.attr, | ||
612 | NULL, | 634 | NULL, |
613 | }; | 635 | }; |
614 | 636 | ||
@@ -2036,6 +2058,21 @@ void ccw_device_sched_todo(struct ccw_device *cdev, enum cdev_todo todo) | |||
2036 | } | 2058 | } |
2037 | } | 2059 | } |
2038 | 2060 | ||
2061 | /** | ||
2062 | * ccw_device_siosl() - initiate logging | ||
2063 | * @cdev: ccw device | ||
2064 | * | ||
2065 | * This function is used to invoke model-dependent logging within the channel | ||
2066 | * subsystem. | ||
2067 | */ | ||
2068 | int ccw_device_siosl(struct ccw_device *cdev) | ||
2069 | { | ||
2070 | struct subchannel *sch = to_subchannel(cdev->dev.parent); | ||
2071 | |||
2072 | return chsc_siosl(sch->schid); | ||
2073 | } | ||
2074 | EXPORT_SYMBOL_GPL(ccw_device_siosl); | ||
2075 | |||
2039 | MODULE_LICENSE("GPL"); | 2076 | MODULE_LICENSE("GPL"); |
2040 | EXPORT_SYMBOL(ccw_device_set_online); | 2077 | EXPORT_SYMBOL(ccw_device_set_online); |
2041 | EXPORT_SYMBOL(ccw_device_set_offline); | 2078 | EXPORT_SYMBOL(ccw_device_set_offline); |