ibmvnic: Ensure that CRQ entry read are correctly ordered
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: 032c5e8284
("Driver for IBM System i/p VNIC protocol")
Signed-off-by: Lijun Pan <ljp@linux.ibm.com>
Link: https://lore.kernel.org/r/20210128013442.88319-1-ljp@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
0f764eec3e
commit
e41aec79e6
@ -5084,6 +5084,12 @@ static void ibmvnic_tasklet(struct tasklet_struct *t)
|
|||||||
while (!done) {
|
while (!done) {
|
||||||
/* Pull all the valid messages off the CRQ */
|
/* Pull all the valid messages off the CRQ */
|
||||||
while ((crq = ibmvnic_next_crq(adapter)) != NULL) {
|
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);
|
ibmvnic_handle_crq(crq, adapter);
|
||||||
crq->generic.first = 0;
|
crq->generic.first = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user