Blob Blame History Raw
From: Jan Höppner <hoeppner@linux.ibm.com>
Subject: s390/sclp: Allow to request adapter reset
Git-commit: 6779df406b27ce44d989e965169db39fb58a7efa
Patch-mainline: v4.20-rc1
References: FATE#326826, LTC#172407, bsc#1113508

Summary:     s390/sclp: Allow to request adapter reset
Description: 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>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
 arch/s390/include/asm/sclp.h |    1 +
 drivers/s390/char/sclp_pci.c |   10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

--- a/arch/s390/include/asm/sclp.h
+++ b/arch/s390/include/asm/sclp.h
@@ -93,6 +93,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
--- a/drivers/s390/char/sclp_pci.c
+++ b/drivers/s390/char/sclp_pci.c
@@ -23,6 +23,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
 
@@ -110,9 +111,14 @@ static int sclp_pci_check_report(struct
 	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;