crypto: qat - prevent spurious MSI interrupt in VF
authorGiovanni Cabiddu <giovanni.cabiddu@intel.com>
Thu, 12 Aug 2021 20:21:15 +0000 (21:21 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 21 Aug 2021 07:44:55 +0000 (15:44 +0800)
commit7eadcfd633d8ef0082b194693c5057c9652fe243
treee9cff2fdd337d835de5a4699028c0a16638bff23
parent0a73c762e1eee33a5e5dc0e3488f1b7cd17249b3
crypto: qat - prevent spurious MSI interrupt in VF

QAT GEN2 devices suffer from a defect where the MSI interrupt can be
sent multiple times.

If the second (spurious) interrupt is handled before the bottom half
handler runs, then the extra interrupt is effectively ignored because
the bottom half is only scheduled once.
However, if the top half runs again after the bottom half runs, this
will appear as a spurious PF to VF interrupt.

This can be avoided by checking the interrupt mask register in addition
to the interrupt source register in the interrupt handler.

This patch is based on earlier work done by Conor McLoughlin.

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>
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/qat/qat_common/adf_vf_isr.c