From: Tyrel Datwyler <turtle.in.the.kernel@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
Tyrel Datwyler <tyreld@linux.vnet.ibm.com>,
james.bottomley@hansenpartnership.com
Cc: brking@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com,
linuxppc-dev@lists.ozlabs.org, linux-scsi@vger.kernel.org,
martin.petersen@oracle.com
Subject: Re: [PATCH] ibmvscsi: add write memory barrier to CRQ processing
Date: Thu, 8 Dec 2016 18:52:34 -0800 [thread overview]
Message-ID: <7be3f12a-3d21-9160-983b-d794c77a07ad@gmail.com> (raw)
In-Reply-To: <272a1724-be64-9e5f-c5bb-3b71f389f029@redhat.com>
On 12/08/2016 03:29 PM, Paolo Bonzini wrote:
>
>
> On 08/12/2016 00:31, Tyrel Datwyler wrote:
>> 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: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
>> ---
>> drivers/scsi/ibmvscsi/ibmvscsi.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
>> index d9534ee..2f5b07e 100644
>> --- a/drivers/scsi/ibmvscsi/ibmvscsi.c
>> +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
>> @@ -232,6 +232,7 @@ static void ibmvscsi_task(void *data)
>> while ((crq = crq_queue_next_crq(&hostdata->queue)) != NULL) {
>> ibmvscsi_handle_crq(crq, hostdata);
>> crq->valid = VIOSRP_CRQ_FREE;
>> + wmb();
>> }
>>
>> vio_enable_interrupts(vdev);
>> @@ -240,6 +241,7 @@ static void ibmvscsi_task(void *data)
>> vio_disable_interrupts(vdev);
>> ibmvscsi_handle_crq(crq, hostdata);
>> crq->valid = VIOSRP_CRQ_FREE;
>> + wmb();
>
> Should this driver use virt_wmb instead?
Both virt_wmb and wmb reduce to a lwsync instruction under PowerPC.
-Tyrel
>
> Paolo
>
>> } else {
>> done = 1;
>> }
>>
next prev parent reply other threads:[~2016-12-09 2:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-07 23:31 [PATCH] ibmvscsi: add write memory barrier to CRQ processing Tyrel Datwyler
2016-12-08 9:06 ` Johannes Thumshirn
2016-12-09 2:56 ` Tyrel Datwyler
2016-12-08 14:21 ` Brian King
2016-12-08 23:29 ` Paolo Bonzini
2016-12-09 2:52 ` Tyrel Datwyler [this message]
2016-12-09 21:20 ` Benjamin Herrenschmidt
2016-12-21 17:35 ` Tyrel Datwyler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7be3f12a-3d21-9160-983b-d794c77a07ad@gmail.com \
--to=turtle.in.the.kernel@gmail.com \
--cc=brking@linux.vnet.ibm.com \
--cc=james.bottomley@hansenpartnership.com \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=martin.petersen@oracle.com \
--cc=nfont@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=tyreld@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).