public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@suse.de>
To: Wayne Boyer <wayneb@linux.vnet.ibm.com>
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 12:20:28 -0400	[thread overview]
Message-ID: <1276100428.4343.272.camel@mulgrave.site> (raw)
In-Reply-To: <4C0FB247.7000007@linux.vnet.ibm.com>

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?

James



  parent reply	other threads:[~2010-06-09 16:20 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 [this message]
2010-06-09 17:45     ` Wayne Boyer
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=1276100428.4343.272.camel@mulgrave.site \
    --to=james.bottomley@suse.de \
    --cc=ben@decadent.org.uk \
    --cc=brking@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=wayneb@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