Commit b39205d2 authored by Tyrel Datwyler's avatar Tyrel Datwyler Committed by Martin K. Petersen

scsi: ibmvscsi: add write memory barrier to CRQ processing

The first byte of each CRQ entry is used to indicate whether an entry is
a valid response or free for the VIOS to use. After processing a
response the driver sets the valid byte to zero to indicate the entry is
now free to be reused. Add a memory barrier after this write to ensure
no other stores are reordered when updating the valid byte.
Signed-off-by: default avatarTyrel Datwyler <tyreld@linux.vnet.ibm.com>
Reviewed-by: default avatarBrian King <brking@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 15c92746
...@@ -233,6 +233,7 @@ static void ibmvscsi_task(void *data) ...@@ -233,6 +233,7 @@ static void ibmvscsi_task(void *data)
while ((crq = crq_queue_next_crq(&hostdata->queue)) != NULL) { while ((crq = crq_queue_next_crq(&hostdata->queue)) != NULL) {
ibmvscsi_handle_crq(crq, hostdata); ibmvscsi_handle_crq(crq, hostdata);
crq->valid = VIOSRP_CRQ_FREE; crq->valid = VIOSRP_CRQ_FREE;
wmb();
} }
vio_enable_interrupts(vdev); vio_enable_interrupts(vdev);
...@@ -241,6 +242,7 @@ static void ibmvscsi_task(void *data) ...@@ -241,6 +242,7 @@ static void ibmvscsi_task(void *data)
vio_disable_interrupts(vdev); vio_disable_interrupts(vdev);
ibmvscsi_handle_crq(crq, hostdata); ibmvscsi_handle_crq(crq, hostdata);
crq->valid = VIOSRP_CRQ_FREE; crq->valid = VIOSRP_CRQ_FREE;
wmb();
} else { } else {
done = 1; done = 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment