Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/sclp: reduce dependency on event type masks

The event type masks can change asynchronously. These changes are reported
by SCLP to the OS by state-change events which are retrieved with the read
event data command. The SCLP driver has a request queue, there is a window
where the read event data request has not completed yet but the SCLP console
drivers are trying to queue output requests. As the masks are not updated
yet the requests are discarded.

The simplest fix is to queue the console requests independent of the
event type masks and rely on SCLP to return with an error code if a
specific event type is not available.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

+5 -14
+1 -1
drivers/s390/char/sclp_early.c
··· 281 281 282 282 static unsigned int __init sclp_con_check_linemode(struct init_sccb *sccb) 283 283 { 284 - if (!(sccb->sclp_send_mask & (EVTYP_OPCMD_MASK | EVTYP_PMSGCMD_MASK))) 284 + if (!(sccb->sclp_send_mask & EVTYP_OPCMD_MASK)) 285 285 return 0; 286 286 if (!(sccb->sclp_receive_mask & (EVTYP_MSG_MASK | EVTYP_PMSGCMD_MASK))) 287 287 return 0;
+4 -9
drivers/s390/char/sclp_rw.c
··· 33 33 34 34 /* Event type structure for write message and write priority message */ 35 35 static struct sclp_register sclp_rw_event = { 36 - .send_mask = EVTYP_MSG_MASK | EVTYP_PMSGCMD_MASK, 36 + .send_mask = EVTYP_MSG_MASK, 37 37 .pm_event_fn = sclp_rw_pm_event, 38 38 }; 39 39 ··· 456 456 return -EIO; 457 457 458 458 sccb = buffer->sccb; 459 - if (sclp_rw_event.sclp_receive_mask & EVTYP_MSG_MASK) 460 - /* Use normal write message */ 461 - sccb->msg_buf.header.type = EVTYP_MSG; 462 - else if (sclp_rw_event.sclp_receive_mask & EVTYP_PMSGCMD_MASK) 463 - /* Use write priority message */ 464 - sccb->msg_buf.header.type = EVTYP_PMSGCMD; 465 - else 466 - return -EOPNOTSUPP; 459 + /* Use normal write message */ 460 + sccb->msg_buf.header.type = EVTYP_MSG; 461 + 467 462 buffer->request.command = SCLP_CMDW_WRITE_EVENT_DATA; 468 463 buffer->request.status = SCLP_REQ_FILLED; 469 464 buffer->request.callback = sclp_writedata_callback;
-4
drivers/s390/char/sclp_vt220.c
··· 206 206 static int 207 207 __sclp_vt220_emit(struct sclp_vt220_request *request) 208 208 { 209 - if (!(sclp_vt220_register.sclp_receive_mask & EVTYP_VT220MSG_MASK)) { 210 - request->sclp_req.status = SCLP_REQ_FAILED; 211 - return -EIO; 212 - } 213 209 request->sclp_req.command = SCLP_CMDW_WRITE_EVENT_DATA; 214 210 request->sclp_req.status = SCLP_REQ_FILLED; 215 211 request->sclp_req.callback = sclp_vt220_callback;