public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian King <brking@linux.vnet.ibm.com>
To: "Philip J. Kelleher" <pjk1939@linux.vnet.ibm.com>
Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org, josh.h.morris@us.ibm.com
Subject: Re: [PATCH 1/1] block: IBM RamSan 70/80 driver fixes.
Date: Tue, 19 Feb 2013 08:18:51 -0600	[thread overview]
Message-ID: <512389CB.1000906@linux.vnet.ibm.com> (raw)
In-Reply-To: <20130218200028.GA7350@oc6784271780.ibm.com>

On 02/18/2013 02:00 PM, Philip J. Kelleher wrote:
> diff -uprN -X linux-block-vanilla/Documentation/dontdiff linux-block-vanilla/drivers/block/rsxx/config.c linux-block/drivers/block/rsxx/config.c
> --- linux-block-vanilla/drivers/block/rsxx/config.c	2013-02-12 11:25:37.756352070 -0600
> +++ linux-block/drivers/block/rsxx/config.c	2013-02-15 09:01:43.221166194 -0600
> @@ -31,7 +31,7 @@
> 
>  static void initialize_config(void *config)
>  {
> -	struct rsxx_card_cfg *cfg = (struct rsxx_card_cfg *) config;
> +	struct rsxx_card_cfg *cfg = config;

Why not pass a struct rsxx_card_cfg * here instead of a void*?



> @@ -126,7 +126,11 @@ static void creg_issue_cmd(struct rsxx_c
>  					  cmd->buf, cmd->stream);
>  	}
> 
> -	/* Data copy must complete before initiating the command. */
> +	/*
> +	 * Data copy must complete before initiating the command. This is
> +	 * needed for weakly ordered processors (i.e. PowerPC), so that all
> +	 * neccessary registers are written before we kick the hardware.
> +	 */
>  	wmb();

When you say data copy are you referring to the writes to the host DMA
buffer that occurred previously? If so, the iowrite / writel macros
already ensure this, as they have a sync instruction built in to them
to cover this case, so a wmb would be redundant.

If its to ensure that all the iowrite's make it to the device as one
transaction and don't get interleaved with some other iowrite's, as
long as you have a spinlock protecting these writes, the PowerPC
spin_unlock will guarantee an mmiowb, so this shouldn't be an issue
either.


> diff -uprN -X linux-block-vanilla/Documentation/dontdiff linux-block-vanilla/drivers/block/rsxx/rsxx.h linux-block/drivers/block/rsxx/rsxx.h
> --- linux-block-vanilla/drivers/block/rsxx/rsxx.h	2013-02-12 11:25:37.780170779 -0600
> +++ linux-block/drivers/block/rsxx/rsxx.h	2013-02-18 08:54:59.692973434 -0600
> @@ -35,6 +35,8 @@ struct rsxx_reg_access {
>  	__u32 data[8];
>  };
> 
> +#define RSXX_MAX_REG_CNT	(8 * (sizeof(__u32)))

Is this 8 related to the 8 in the array above? If so, why not have a literal
to define the 8 and use it in both places to make this clear?

-Brian

-- 
Brian King
Power Linux I/O
IBM Linux Technology Center



  reply	other threads:[~2013-02-19 14:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-18 20:00 [PATCH 1/1] block: IBM RamSan 70/80 driver fixes Philip J. Kelleher
2013-02-19 14:18 ` Brian King [this message]
2013-02-19 15:40   ` Philip J. Kelleher

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=512389CB.1000906@linux.vnet.ibm.com \
    --to=brking@linux.vnet.ibm.com \
    --cc=axboe@kernel.dk \
    --cc=josh.h.morris@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pjk1939@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