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

Commit 9d54b998 authored by Lijun Pan's avatar Lijun Pan Committed by Greg Kroah-Hartman
Browse files

ibmvnic: Ensure that CRQ entry read are correctly ordered



commit e41aec79e62fa50f940cf222d1e9577f14e149dc upstream.

Ensure that received Command-Response Queue (CRQ) entries are
properly read in order by the driver. dma_rmb barrier has
been added before accessing the CRQ descriptor to ensure
the entire descriptor is read before processing.

Fixes: 032c5e82 ("Driver for IBM System i/p VNIC protocol")
Signed-off-by: default avatarLijun Pan <ljp@linux.ibm.com>
Link: https://lore.kernel.org/r/20210128013442.88319-1-ljp@linux.ibm.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 78dcc1b1
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3496,6 +3496,12 @@ static irqreturn_t ibmvnic_interrupt(int irq, void *instance)
	while (!done) {
		/* Pull all the valid messages off the CRQ */
		while ((crq = ibmvnic_next_crq(adapter)) != NULL) {
			/* This barrier makes sure ibmvnic_next_crq()'s
			 * crq->generic.first & IBMVNIC_CRQ_CMD_RSP is loaded
			 * before ibmvnic_handle_crq()'s
			 * switch(gen_crq->first) and switch(gen_crq->cmd).
			 */
			dma_rmb();
			ibmvnic_handle_crq(crq, adapter);
			crq->generic.first = 0;
		}