LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Brian King <brking@linux.ibm.com>
To: Sinan Kaya <okaya@codeaurora.org>,
	linux-scsi@vger.kernel.org, timur@codeaurora.org,
	sulrich@codeaurora.org
Cc: linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Brian King <brking@us.ibm.com>,
	"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 5/7] scsi: ipr: Eliminate duplicate barriers on weakly-ordered archs
Date: Tue, 29 May 2018 15:45:52 -0500	[thread overview]
Message-ID: <a10fa941-1729-2890-50cb-59c4a5b5e596@linux.ibm.com> (raw)
In-Reply-To: <1521514207-10695-6-git-send-email-okaya@codeaurora.org>

On 03/19/2018 09:50 PM, Sinan Kaya wrote:
> Code includes barrier() followed by writel(). writel() already has a
> barrier
> on some architectures like arm64.
> 
> This ends up CPU observing two barriers back to back before executing the
> register write.
> 
> Since code already has an explicit barrier call, changing writeX() to
> writeX_relaxed().
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
>  drivers/scsi/ipr.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
> index e07dd99..209adac 100644
> --- a/drivers/scsi/ipr.c
> +++ b/drivers/scsi/ipr.c
> @@ -762,9 +762,9 @@ static void ipr_mask_and_clear_interrupts(struct ipr_ioa_cfg *ioa_cfg,
> 
>  	/* Set interrupt mask to stop all new interrupts */
>  	if (ioa_cfg->sis64)
> -		writeq(~0, ioa_cfg->regs.set_interrupt_mask_reg);
> +		writeq_relaxed(~0, ioa_cfg->regs.set_interrupt_mask_reg);
>  	else
> -		writel(~0, ioa_cfg->regs.set_interrupt_mask_reg);
> +		writel_relaxed(~0, ioa_cfg->regs.set_interrupt_mask_reg);
> 
>  	/* Clear any pending interrupts */
>  	if (ioa_cfg->sis64)
> @@ -8435,7 +8435,8 @@ static int ipr_reset_enable_ioa(struct ipr_cmnd *ipr_cmd)
>  	wmb();
>  	if (ioa_cfg->sis64) {
>  		/* Set the adapter to the correct endian mode. */
> -		writel(IPR_ENDIAN_SWAP_KEY, ioa_cfg->regs.endian_swap_reg);
> +		writel_relaxed(IPR_ENDIAN_SWAP_KEY,
> +			       ioa_cfg->regs.endian_swap_reg);
>  		int_reg = readl(ioa_cfg->regs.endian_swap_reg);
>  	}
> 

Looks fine to me. Thanks.

Acked-by: Brian King <brking@linux.vnet.ibm.com>

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

  reply	other threads:[~2018-05-29 20:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1521514207-10695-1-git-send-email-okaya@codeaurora.org>
2018-03-20  2:50 ` [PATCH v4 1/7] scsi: hpsa: " Sinan Kaya
2018-03-20 16:51   ` Laurence Oberman
2018-03-20  2:50 ` [PATCH v4 2/7] scsi: megaraid: eliminate " Sinan Kaya
2018-03-20  2:50 ` [PATCH v4 3/7] scsi: dpt_i2o: " Sinan Kaya
2018-03-20 10:23   ` Christoph Hellwig
2018-03-20 12:13     ` okaya
2018-03-20  2:50 ` [PATCH v4 4/7] scsi: lpfc: Eliminate " Sinan Kaya
2018-03-20  2:50 ` [PATCH v4 5/7] scsi: ipr: " Sinan Kaya
2018-05-29 20:45   ` Brian King [this message]
2018-03-20  2:50 ` [PATCH v4 6/7] scsi: bnx2i: " Sinan Kaya
2018-03-20  2:50 ` [PATCH v4 7/7] scsi: csiostor: " Sinan Kaya

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=a10fa941-1729-2890-50cb-59c4a5b5e596@linux.ibm.com \
    --to=brking@linux.ibm.com \
    --cc=brking@us.ibm.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=okaya@codeaurora.org \
    --cc=sulrich@codeaurora.org \
    --cc=timur@codeaurora.org \
    --subject='Re: [PATCH v4 5/7] scsi: ipr: Eliminate duplicate barriers on weakly-ordered archs' \
    /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

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).