On 2019-01-18 12:42, Janosch Frank wrote: > We need to properly implement interrupt handling for SCLP, because on > z/VM and LPAR SCLP calls are not synchronous! > > Also with smp CPUs have to compete for sclp. Let's add some locking, > so they execute sclp calls in an orderly fashion and don't compete for > the data buffer. > > Signed-off-by: Janosch Frank <frankja@xxxxxxxxxxxxx> > --- [...] > static void sclp_read_scp_info(ReadInfo *ri, int length) > { > unsigned int commands[] = { SCLP_CMDW_READ_SCP_INFO_FORCED, > SCLP_CMDW_READ_SCP_INFO }; > - int i; > + int i, cc; > > for (i = 0; i < ARRAY_SIZE(commands); i++) { > + sclp_mark_busy(); > memset(&ri->h, 0, sizeof(ri->h)); > ri->h.length = length; > > - if (sclp_service_call(commands[i], ri)) > + cc = sclp_service_call(commands[i], ri); > + if (cc) > break; Nit: The introduction of the cc variable now does not seem to be necessary anymore. (but there's IMHO no need to respin the series just because of that) Reviewed-by: Thomas Huth <thuth@xxxxxxxxxx>