From: Wayne Boyer <wayneb@linux.vnet.ibm.com>
To: James Bottomley <James.Bottomley@suse.de>
Cc: ben@decadent.org.uk, linux-scsi <linux-scsi@vger.kernel.org>,
Brian King <brking@linux.vnet.ibm.com>
Subject: Re: [PATCH 1/1] ipr: add writeq definition if needed
Date: Wed, 09 Jun 2010 10:45:23 -0700 [thread overview]
Message-ID: <4C0FD333.1080500@linux.vnet.ibm.com> (raw)
In-Reply-To: <1276100428.4343.272.camel@mulgrave.site>
On 06/09/2010 09:20 AM, James Bottomley wrote:
> On Wed, 2010-06-09 at 08:24 -0700, Wayne Boyer wrote:
>> Compiling the driver will fail on 32 bit powerpc and other
>> architectures where writeq is not defined. This patch adds a
>> definition for writeq.
>>
>> Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
>> ---
>>
>> drivers/scsi/ipr.h | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> Index: b/drivers/scsi/ipr.h
>> ===================================================================
>> --- a/drivers/scsi/ipr.h 2010-06-08 10:06:48.000000000 -0700
>> +++ b/drivers/scsi/ipr.h 2010-06-08 15:14:42.000000000 -0700
>> @@ -1860,4 +1860,12 @@ static inline int ipr_sdt_is_fmt2(u32 sd
>> return 0;
>> }
>>
>> +#ifndef writeq
>> +static inline void writeq(u64 val, void __iomem *addr)
>> +{
>> + writel(((u32) (val >> 32)), addr);
>> + writel(((u32) (val)), (addr + 4));
>
> Are you sure this is what you want? The point about writeq is to do an
> atomic write of a 64 bit quantity. Doing two writel's loses the
> atomicity (and can confuse some hardware if not done in the right
> order). If this code above works correctly, why bother with the writeq?
>
We do want to issue 8 byte MMIO writes where we can for the new adapters
for better performance. We want to use writeq on platforms that support
it. I did test the driver using this define with the new hardware and it
does work as expected.
--
Wayne Boyer
IBM - Beaverton, Oregon
LTC S/W Development - eServerIO
(503) 578-5236, T/L 775-5236
next prev parent reply other threads:[~2010-06-09 17:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20100608224308.499532262@linux.vnet.ibm.com>
2010-06-09 15:24 ` [PATCH 1/1] ipr: add writeq definition if needed Wayne Boyer
2010-06-09 16:04 ` Brian King
2010-06-09 16:20 ` James Bottomley
2010-06-09 17:45 ` Wayne Boyer [this message]
2010-06-09 18:43 ` James Bottomley
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=4C0FD333.1080500@linux.vnet.ibm.com \
--to=wayneb@linux.vnet.ibm.com \
--cc=James.Bottomley@suse.de \
--cc=ben@decadent.org.uk \
--cc=brking@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
/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