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>
Sun, 25 Aug 2019 08:51:25 +0000 (10:51 +0200)
commit657c648a19eb9b92ee74220af0ed07c6a45db380
tree58b514c3758a12c850d0729dbb4e2781db0f4036
parent260718adc61479571869b3baf9bc85d55daa243b
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