s390/sclp: Allow to request adapter reset
authorJan Höppner <hoeppner@linux.ibm.com>
Thu, 6 Sep 2018 11:16:40 +0000 (13:16 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 20 Sep 2018 11:20:27 +0000 (13:20 +0200)
The SCLP event 24 "Adapter Error Notification" supports three different
action qualifier of which 'adapter reset' is currently not enabled in
the sysfs interface. However, userspace tools might want to be able
to use the reset functionality as well. Enable the 'adapter reset'
qualifier.

Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Reviewed-by: Sebastian Ott <sebott@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/sclp.h
drivers/s390/char/sclp_pci.c

index e44a8d7959f513ebbd2982314369a5706bda3528..5d9420bbe1655e54f351c0df2b9715c76a43fe6d 100644 (file)
@@ -95,6 +95,7 @@ extern struct sclp_info sclp;
 struct zpci_report_error_header {
        u8 version;     /* Interface version byte */
        u8 action;      /* Action qualifier byte
+                        * 0: Adapter Reset Request
                         * 1: Deconfigure and repair action requested
                         *      (OpenCrypto Problem Call Home)
                         * 2: Informational Report
index e7c84a4e5eb5833c7a83e9c4dc8721238750f786..995e9196852efd92ee10649dab8d40384ef947f2 100644 (file)
@@ -24,6 +24,7 @@
 
 #define SCLP_ATYPE_PCI                         2
 
+#define SCLP_ERRNOTIFY_AQ_RESET                        0
 #define SCLP_ERRNOTIFY_AQ_REPAIR               1
 #define SCLP_ERRNOTIFY_AQ_INFO_LOG             2
 
@@ -111,9 +112,14 @@ static int sclp_pci_check_report(struct zpci_report_error_header *report)
        if (report->version != 1)
                return -EINVAL;
 
-       if (report->action != SCLP_ERRNOTIFY_AQ_REPAIR &&
-           report->action != SCLP_ERRNOTIFY_AQ_INFO_LOG)
+       switch (report->action) {
+       case SCLP_ERRNOTIFY_AQ_RESET:
+       case SCLP_ERRNOTIFY_AQ_REPAIR:
+       case SCLP_ERRNOTIFY_AQ_INFO_LOG:
+               break;
+       default:
                return -EINVAL;
+       }
 
        if (report->length > (PAGE_SIZE - sizeof(struct err_notify_sccb)))
                return -EINVAL;