From: Arnd Bergmann <arnd@arndb.de>
To: Brian King <brking@us.ibm.com>,
"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Kees Cook <keescook@chromium.org>,
Hannes Reinecke <hare@suse.com>,
Souptick Joarder <jrdr.linux@gmail.com>,
Wen Xiong <wenxiong@linux.vnet.ibm.com>,
Sinan Kaya <okaya@codeaurora.org>,
Bart Van Assche <bart.vanassche@wdc.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] scsi: ipr: fix build on 32-bit architectures
Date: Fri, 8 Jun 2018 16:46:00 +0200 [thread overview]
Message-ID: <20180608144617.2900894-1-arnd@arndb.de> (raw)
Replacing writeq() with writeq_relaxed() doesn't work on many architectures,
as that variant is not available in general:
net/Makefile:24: CC cannot link executables. Skipping bpfilter.
drivers/scsi/ipr.c: In function 'ipr_mask_and_clear_interrupts':
drivers/scsi/ipr.c:767:3: error: implicit declaration of function 'writeq_relaxed'; did you mean 'writew_relaxed'? [-Werror=implicit-function-declaration]
writeq_relaxed(~0, ioa_cfg->regs.set_interrupt_mask_reg);
^~~~~~~~~~~~~~
writew_relaxed
The other issue here is that the patch eliminated the wrong barrier.
As per a long discussion that followed Sinan's original patch submission,
the conclusion was that drivers should generally assume that the barrier
implied by writel() is sufficient for ordering DMA, so this reverts his
change and instead removes the extraneous wmb() before it, which is no
longer needed on any architecture now.
Fixes: 0109a4f2e02d ("scsi: ipr: Eliminate duplicate barriers on weakly-ordered archs")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/scsi/ipr.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 865c07dc11ea..d2f67a41fcdd 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -760,13 +760,12 @@ static void ipr_mask_and_clear_interrupts(struct ipr_ioa_cfg *ioa_cfg,
ioa_cfg->hrrq[i].allow_interrupts = 0;
spin_unlock(&ioa_cfg->hrrq[i]._lock);
}
- wmb();
/* Set interrupt mask to stop all new interrupts */
if (ioa_cfg->sis64)
- writeq_relaxed(~0, ioa_cfg->regs.set_interrupt_mask_reg);
+ writeq(~0, ioa_cfg->regs.set_interrupt_mask_reg);
else
- writel_relaxed(~0, ioa_cfg->regs.set_interrupt_mask_reg);
+ writel(~0, ioa_cfg->regs.set_interrupt_mask_reg);
/* Clear any pending interrupts */
if (ioa_cfg->sis64)
@@ -8401,10 +8400,9 @@ static int ipr_reset_enable_ioa(struct ipr_cmnd *ipr_cmd)
ioa_cfg->hrrq[i].allow_interrupts = 1;
spin_unlock(&ioa_cfg->hrrq[i]._lock);
}
- wmb();
if (ioa_cfg->sis64) {
/* Set the adapter to the correct endian mode. */
- writel_relaxed(IPR_ENDIAN_SWAP_KEY,
+ writel(IPR_ENDIAN_SWAP_KEY,
ioa_cfg->regs.endian_swap_reg);
int_reg = readl(ioa_cfg->regs.endian_swap_reg);
}
--
2.9.0
next reply other threads:[~2018-06-08 14:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-08 14:46 Arnd Bergmann [this message]
2018-06-08 15:27 ` Sinan Kaya
2018-06-08 15:47 ` Arnd Bergmann
2018-06-08 16:10 ` Sinan Kaya
2018-06-08 19:20 ` Brian King
2018-06-08 19:39 ` Sinan Kaya
2018-06-13 17:14 ` Martin K. Petersen
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=20180608144617.2900894-1-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=bart.vanassche@wdc.com \
--cc=brking@us.ibm.com \
--cc=hare@suse.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=jrdr.linux@gmail.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=okaya@codeaurora.org \
--cc=wenxiong@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
all inboxes | Powered by JetHome®