Skip to content

Commit

Permalink
s390/sclp: Allow to request adapter reset
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Sebastian Ott <[email protected]>
Signed-off-by: Martin Schwidefsky <[email protected]>
  • Loading branch information
hoeppnerj authored and Martin Schwidefsky committed Sep 20, 2018
1 parent 734781a commit 6779df4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions arch/s390/include/asm/sclp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions drivers/s390/char/sclp_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6779df4

Please sign in to comment.