]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
crypto: qat - disregard spurious PFVF interrupts
authorGiovanni Cabiddu <giovanni.cabiddu@intel.com>
Tue, 28 Sep 2021 11:44:30 +0000 (12:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Nov 2021 10:36:08 +0000 (11:36 +0100)
[ Upstream commit 18fcba469ba5359c1de7e3fb16f7b9e8cd1b8e02 ]

Upon receiving a PFVF message, check if the interrupt bit is set in the
message. If it is not, that means that the interrupt was probably
triggered by a collision. In this case, disregard the message and
re-enable the interrupts.

Fixes: ed8ccaef52fa ("crypto: qat - Add support for SRIOV")
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-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
drivers/crypto/qat/qat_common/adf_vf_isr.c

index 72fd2bbbe704ef00dcc44a19c48087edc4634433..180016e1577711cc12c01b01bb5d0187abe02f5e 100644 (file)
@@ -250,6 +250,11 @@ void adf_vf2pf_req_hndl(struct adf_accel_vf_info *vf_info)
 
        /* Read message from the VF */
        msg = ADF_CSR_RD(pmisc_addr, hw_data->get_pf2vf_offset(vf_nr));
+       if (!(msg & ADF_VF2PF_INT)) {
+               dev_info(&GET_DEV(accel_dev),
+                        "Spurious VF2PF interrupt, msg %X. Ignored\n", msg);
+               goto out;
+       }
 
        /* To ACK, clear the VF2PFINT bit */
        msg &= ~ADF_VF2PF_INT;
@@ -333,6 +338,7 @@ void adf_vf2pf_req_hndl(struct adf_accel_vf_info *vf_info)
        if (resp && adf_iov_putmsg(accel_dev, resp, vf_nr))
                dev_err(&GET_DEV(accel_dev), "Failed to send response to VF\n");
 
+out:
        /* re-enable interrupt on PF from this VF */
        adf_enable_vf2pf_interrupts(accel_dev, (1 << vf_nr));
        return;
index ef90902c8200d6272aae4bb7d796308571a8ff5a..86274e3c6781d60b0c5a729ce9eed4046c502bb8 100644 (file)
@@ -123,6 +123,11 @@ static void adf_pf2vf_bh_handler(void *data)
 
        /* Read the message from PF */
        msg = ADF_CSR_RD(pmisc_bar_addr, hw_data->get_pf2vf_offset(0));
+       if (!(msg & ADF_PF2VF_INT)) {
+               dev_info(&GET_DEV(accel_dev),
+                        "Spurious PF2VF interrupt, msg %X. Ignored\n", msg);
+               goto out;
+       }
 
        if (!(msg & ADF_PF2VF_MSGORIGIN_SYSTEM))
                /* Ignore legacy non-system (non-kernel) PF2VF messages */
@@ -171,6 +176,7 @@ static void adf_pf2vf_bh_handler(void *data)
        msg &= ~ADF_PF2VF_INT;
        ADF_CSR_WR(pmisc_bar_addr, hw_data->get_pf2vf_offset(0), msg);
 
+out:
        /* Re-enable PF2VF interrupts */
        adf_enable_pf2vf_interrupts(accel_dev);
        return;