[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOMZO5CGT7TbpWEAWEA7qTxuGO1mog_QDhG-e0MuDDckUS2W3A@mail.gmail.com>
Date: Tue, 3 Jul 2018 20:52:37 -0300
From: Fabio Estevam <festevam@...il.com>
To: Logan Gunthorpe <logang@...tatee.com>
Cc: Andy Shevchenko <andy.shevchenko@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Linux-Arch <linux-arch@...r.kernel.org>,
linux-ntb@...glegroups.com,
"open list:HARDWARE RANDOM NUMBER GENERATOR CORE"
<linux-crypto@...r.kernel.org>, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Horia Geantă <horia.geanta@....com>,
Dan Douglass <dan.douglass@....com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH v18 6/7] crypto: caam: cleanup CONFIG_64BIT ifdefs when
using io{read|write}64
On Tue, Jul 3, 2018 at 8:20 PM, Logan Gunthorpe <logang@...tatee.com> wrote:
> Oh. So some IO in some other place must have changed to trigger the BUG...
Yes, there are two 64-bit write operations inside caam_jr_init().
If I use the old 64-bit write function then things works fine:
--- a/drivers/crypto/caam/jr.c
+++ b/drivers/crypto/caam/jr.c
@@ -384,6 +384,17 @@ int caam_jr_enqueue(struct device *dev, u32 *desc,
}
EXPORT_SYMBOL(caam_jr_enqueue);
+static inline void wr_reg64old(void __iomem *reg, u64 data)
+{
+ if (!caam_imx && caam_little_end) {
+ wr_reg32((u32 __iomem *)(reg) + 1, data >> 32);
+ wr_reg32((u32 __iomem *)(reg), data);
+ } else {
+ wr_reg32((u32 __iomem *)(reg), data >> 32);
+ wr_reg32((u32 __iomem *)(reg) + 1, data);
+ }
+}
+
/*
* Init JobR independent of platform property detection
*/
@@ -434,8 +445,8 @@ static int caam_jr_init(struct device *dev)
jrp->head = 0;
jrp->tail = 0;
- wr_reg64(&jrp->rregs->inpring_base, inpbusaddr);
- wr_reg64(&jrp->rregs->outring_base, outbusaddr);
+ wr_reg64old(&jrp->rregs->inpring_base, inpbusaddr);
+ wr_reg64old(&jrp->rregs->outring_base, outbusaddr);
wr_reg32(&jrp->rregs->inpring_size, JOBR_DEPTH);
wr_reg32(&jrp->rregs->outring_size, JOBR_DEPTH);
Powered by blists - more mailing lists