Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52d2cdab authored by Giovanni Cabiddu's avatar Giovanni Cabiddu Committed by Greg Kroah-Hartman
Browse files

crypto: qat - disregard spurious PFVF interrupts



[ 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: ed8ccaef ("crypto: qat - Add support for SRIOV")
Signed-off-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: default avatarMarco Chiappero <marco.chiappero@intel.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 4d788143
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -250,6 +250,11 @@ void adf_vf2pf_req_hndl(struct adf_accel_vf_info *vf_info)


	/* Read message from the VF */
	/* Read message from the VF */
	msg = ADF_CSR_RD(pmisc_addr, hw_data->get_pf2vf_offset(vf_nr));
	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 */
	/* To ACK, clear the VF2PFINT bit */
	msg &= ~ADF_VF2PF_INT;
	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))
	if (resp && adf_iov_putmsg(accel_dev, resp, vf_nr))
		dev_err(&GET_DEV(accel_dev), "Failed to send response to VF\n");
		dev_err(&GET_DEV(accel_dev), "Failed to send response to VF\n");


out:
	/* re-enable interrupt on PF from this VF */
	/* re-enable interrupt on PF from this VF */
	adf_enable_vf2pf_interrupts(accel_dev, (1 << vf_nr));
	adf_enable_vf2pf_interrupts(accel_dev, (1 << vf_nr));
	return;
	return;
+6 −0
Original line number Original line Diff line number Diff line
@@ -123,6 +123,11 @@ static void adf_pf2vf_bh_handler(void *data)


	/* Read the message from PF */
	/* Read the message from PF */
	msg = ADF_CSR_RD(pmisc_bar_addr, hw_data->get_pf2vf_offset(0));
	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))
	if (!(msg & ADF_PF2VF_MSGORIGIN_SYSTEM))
		/* Ignore legacy non-system (non-kernel) PF2VF messages */
		/* Ignore legacy non-system (non-kernel) PF2VF messages */
@@ -171,6 +176,7 @@ static void adf_pf2vf_bh_handler(void *data)
	msg &= ~ADF_PF2VF_INT;
	msg &= ~ADF_PF2VF_INT;
	ADF_CSR_WR(pmisc_bar_addr, hw_data->get_pf2vf_offset(0), msg);
	ADF_CSR_WR(pmisc_bar_addr, hw_data->get_pf2vf_offset(0), msg);


out:
	/* Re-enable PF2VF interrupts */
	/* Re-enable PF2VF interrupts */
	adf_enable_pf2vf_interrupts(accel_dev);
	adf_enable_pf2vf_interrupts(accel_dev);
	return;
	return;