Commit 509d97b6 authored by Sebastian Ott's avatar Sebastian Ott Committed by Martin Schwidefsky

s390/chsc: fix SEI usage

cbc0dd1f "s390/pci: CHSC PCI support for error and availability events"
introduced a new SEI notification type as part of pci support.
The way SEI was called with nt2 and nt0 consecutive broke the nt0
stuff used for channel subsystem notifications.

The reason why this was broken with the mentioned patch is that you
cannot selectively disable type 0 notifications (so even when asked
for type 2 only, type 0 could be presented).

The way to do it is to tell SEI which types of notification you can
process and -this is the important part- look at the SEI result which
notification type you actually received.
Reviewed-by: default avatarPeter Oberparleiter <peter.oberparleiter@de.ibm.com>
Tested-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent ed4f2094
...@@ -283,7 +283,7 @@ struct chsc_sei_nt2_area { ...@@ -283,7 +283,7 @@ struct chsc_sei_nt2_area {
u8 ccdf[PAGE_SIZE - 24 - 56]; /* content-code dependent field */ u8 ccdf[PAGE_SIZE - 24 - 56]; /* content-code dependent field */
} __packed; } __packed;
#define CHSC_SEI_NT0 0ULL #define CHSC_SEI_NT0 (1ULL << 63)
#define CHSC_SEI_NT2 (1ULL << 61) #define CHSC_SEI_NT2 (1ULL << 61)
struct chsc_sei { struct chsc_sei {
...@@ -291,7 +291,8 @@ struct chsc_sei { ...@@ -291,7 +291,8 @@ struct chsc_sei {
u32 reserved1; u32 reserved1;
u64 ntsm; /* notification type mask */ u64 ntsm; /* notification type mask */
struct chsc_header response; struct chsc_header response;
u32 reserved2; u32 :24;
u8 nt;
union { union {
struct chsc_sei_nt0_area nt0_area; struct chsc_sei_nt0_area nt0_area;
struct chsc_sei_nt2_area nt2_area; struct chsc_sei_nt2_area nt2_area;
...@@ -496,17 +497,17 @@ static int __chsc_process_crw(struct chsc_sei *sei, u64 ntsm) ...@@ -496,17 +497,17 @@ static int __chsc_process_crw(struct chsc_sei *sei, u64 ntsm)
css_schedule_eval_all(); css_schedule_eval_all();
} }
switch (sei->ntsm) { switch (sei->nt) {
case CHSC_SEI_NT0: case 0:
chsc_process_sei_nt0(&sei->u.nt0_area); chsc_process_sei_nt0(&sei->u.nt0_area);
return 1; break;
case CHSC_SEI_NT2: case 2:
chsc_process_sei_nt2(&sei->u.nt2_area); chsc_process_sei_nt2(&sei->u.nt2_area);
return 1; break;
default: default:
CIO_CRW_EVENT(2, "chsc: unhandled nt (nt=%08Lx)\n", CIO_CRW_EVENT(2, "chsc: unhandled nt=%d\n",
sei->ntsm); sei->nt);
return 0; break;
} }
} else { } else {
CIO_CRW_EVENT(2, "chsc: sei failed (rc=%04x)\n", CIO_CRW_EVENT(2, "chsc: sei failed (rc=%04x)\n",
...@@ -537,15 +538,7 @@ static void chsc_process_crw(struct crw *crw0, struct crw *crw1, int overflow) ...@@ -537,15 +538,7 @@ static void chsc_process_crw(struct crw *crw0, struct crw *crw1, int overflow)
sei = sei_page; sei = sei_page;
CIO_TRACE_EVENT(2, "prcss"); CIO_TRACE_EVENT(2, "prcss");
__chsc_process_crw(sei, CHSC_SEI_NT0 | CHSC_SEI_NT2);
/*
* The ntsm does not allow to select NT0 and NT2 together. We need to
* first check for NT2, than additionally for NT0...
*/
#ifdef CONFIG_PCI
if (!__chsc_process_crw(sei, CHSC_SEI_NT2))
#endif
__chsc_process_crw(sei, CHSC_SEI_NT0);
} }
void chsc_chp_online(struct chp_id chpid) void chsc_chp_online(struct chp_id chpid)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment