s390/qdio: add sanity checks to the fast-requeue path
authorJulian Wiedmann <jwi@linux.ibm.com>
Thu, 11 Jul 2019 16:17:36 +0000 (18:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Aug 2019 08:12:46 +0000 (10:12 +0200)
commit77868c0003cc0369d88df858239393545db12769
tree4137456107af824d54f6007cbd15d1e6466ef3be
parent8729fe83b0d56c1dabd33b61abce5c0924114b96
s390/qdio: add sanity checks to the fast-requeue path

[ Upstream commit a6ec414a4dd529eeac5c3ea51c661daba3397108 ]

If the device driver were to send out a full queue's worth of SBALs,
current code would end up discovering the last of those SBALs as PRIMED
and erroneously skip the SIGA-w. This immediately stalls the queue.

Add a check to not attempt fast-requeue in this case. While at it also
make sure that the state of the previous SBAL was successfully extracted
before inspecting it.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Jens Remus <jremus@linux.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/s390/cio/qdio_main.c