Skip to content

Commit 509d97b

Browse files
Sebastian OttMartin Schwidefsky
authored andcommitted
s390/chsc: fix SEI usage
cbc0dd1 "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: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Tested-by: Michael Holzheu <holzheu@linux.vnet.ibm.com> Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent ed4f209 commit 509d97b

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

drivers/s390/cio/chsc.c

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -283,15 +283,16 @@ struct chsc_sei_nt2_area {
283283
u8 ccdf[PAGE_SIZE - 24 - 56]; /* content-code dependent field */
284284
} __packed;
285285

286-
#define CHSC_SEI_NT0 0ULL
286+
#define CHSC_SEI_NT0 (1ULL << 63)
287287
#define CHSC_SEI_NT2 (1ULL << 61)
288288

289289
struct chsc_sei {
290290
struct chsc_header request;
291291
u32 reserved1;
292292
u64 ntsm; /* notification type mask */
293293
struct chsc_header response;
294-
u32 reserved2;
294+
u32 :24;
295+
u8 nt;
295296
union {
296297
struct chsc_sei_nt0_area nt0_area;
297298
struct chsc_sei_nt2_area nt2_area;
@@ -496,17 +497,17 @@ static int __chsc_process_crw(struct chsc_sei *sei, u64 ntsm)
496497
css_schedule_eval_all();
497498
}
498499

499-
switch (sei->ntsm) {
500-
case CHSC_SEI_NT0:
500+
switch (sei->nt) {
501+
case 0:
501502
chsc_process_sei_nt0(&sei->u.nt0_area);
502-
return 1;
503-
case CHSC_SEI_NT2:
503+
break;
504+
case 2:
504505
chsc_process_sei_nt2(&sei->u.nt2_area);
505-
return 1;
506+
break;
506507
default:
507-
CIO_CRW_EVENT(2, "chsc: unhandled nt (nt=%08Lx)\n",
508-
sei->ntsm);
509-
return 0;
508+
CIO_CRW_EVENT(2, "chsc: unhandled nt=%d\n",
509+
sei->nt);
510+
break;
510511
}
511512
} else {
512513
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)
537538
sei = sei_page;
538539

539540
CIO_TRACE_EVENT(2, "prcss");
540-
541-
/*
542-
* The ntsm does not allow to select NT0 and NT2 together. We need to
543-
* first check for NT2, than additionally for NT0...
544-
*/
545-
#ifdef CONFIG_PCI
546-
if (!__chsc_process_crw(sei, CHSC_SEI_NT2))
547-
#endif
548-
__chsc_process_crw(sei, CHSC_SEI_NT0);
541+
__chsc_process_crw(sei, CHSC_SEI_NT0 | CHSC_SEI_NT2);
549542
}
550543

551544
void chsc_chp_online(struct chp_id chpid)

0 commit comments

Comments
 (0)