crypto: qat - fix undetected PFVF timeout in ACK loop
authorGiovanni Cabiddu <giovanni.cabiddu@intel.com>
Wed, 17 Nov 2021 14:30:35 +0000 (14:30 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:03:17 +0000 (11:03 +0100)
commit72b905fb39f0fca334ffbe8587ad10f180a1dd3f
tree89b0b034021054cf6179f63ff74b53ff050ca2fe
parent348210fd7765d70b4bf2107e3e40d51727aab27b
crypto: qat - fix undetected PFVF timeout in ACK loop

[ Upstream commit 5002200b4fedd7e90e4fbc2e5c42a4b3351df814 ]

If the remote function did not ACK the reception of a message, the
function __adf_iov_putmsg() could detect it as a collision.

This was due to the fact that the collision and the timeout checks after
the ACK loop were in the wrong order. The timeout must be checked at the
end of the loop, so fix by swapping the order of the two checks.

Fixes: 9b768e8a3909 ("crypto: qat - detect PFVF collision after ACK")
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Co-developed-by: Marco Chiappero <marco.chiappero@intel.com>
Signed-off-by: Marco Chiappero <marco.chiappero@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/qat/qat_common/adf_pf2vf_msg.c