From patchwork Wed Jul 4 00:02:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 10505671 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 32E666035E for ; Wed, 4 Jul 2018 00:03:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25AA728AA4 for ; Wed, 4 Jul 2018 00:03:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1907328AB1; Wed, 4 Jul 2018 00:03:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC6F528AA4 for ; Wed, 4 Jul 2018 00:03:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753348AbeGDADj (ORCPT ); Tue, 3 Jul 2018 20:03:39 -0400 Received: from ale.deltatee.com ([207.54.116.67]:37944 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753179AbeGDADE (ORCPT ); Tue, 3 Jul 2018 20:03:04 -0400 Received: from s0106602ad0811846.cg.shawcable.net ([68.147.191.165] helo=[192.168.0.18]) by ale.deltatee.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1faVG3-000440-Hk; Tue, 03 Jul 2018 18:02:56 -0600 From: Logan Gunthorpe To: Andy Shevchenko Cc: Fabio Estevam , Andrew Morton , linux-kernel , Linux-Arch , linux-ntb@googlegroups.com, "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Arnd Bergmann , Greg Kroah-Hartman , =?UTF-8?Q?Horia_Geant=c4=83?= , Dan Douglass , Herbert Xu , "David S. Miller" References: <20180622194752.11221-1-logang@deltatee.com> <20180622194752.11221-7-logang@deltatee.com> <13ea3f97-4a33-3a24-1b7e-b819be73d867@deltatee.com> <6e5224b9-343f-990c-19bd-fe37c6fbdc9b@deltatee.com> <7ddda181-6337-32cc-7a0d-43fc6a7ba78b@deltatee.com> <991b2298-bb3f-dad3-c93b-b43ee5f372de@deltatee.com> Message-ID: <6d8df4be-a2da-5ddb-3b13-ca47d903ac80@deltatee.com> Date: Tue, 3 Jul 2018 18:02:53 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <991b2298-bb3f-dad3-c93b-b43ee5f372de@deltatee.com> Content-Language: en-US X-SA-Exim-Connect-IP: 68.147.191.165 X-SA-Exim-Rcpt-To: davem@davemloft.net, herbert@gondor.apana.org.au, dan.douglass@nxp.com, horia.geanta@nxp.com, gregkh@linuxfoundation.org, arnd@arndb.de, linux-crypto@vger.kernel.org, linux-ntb@googlegroups.com, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, festevam@gmail.com, andy.shevchenko@gmail.com X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [PATCH v18 6/7] crypto: caam: cleanup CONFIG_64BIT ifdefs when using io{read|write}64 X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 03/07/18 05:57 PM, Logan Gunthorpe wrote: > To confirm, can you try the patch below? Actually, scratch that: try this patch as I forgot the read side on the previous one. Logan Tested-by: Fabio Estevam --- static inline u64 cpu_to_caam_dma64(dma_addr_t value) diff --git a/drivers/crypto/caam/regs.h b/drivers/crypto/caam/regs.h index 5826acd9194e..796ff764dcbf 100644 --- a/drivers/crypto/caam/regs.h +++ b/drivers/crypto/caam/regs.h @@ -138,18 +138,26 @@ static inline void clrsetbits_32(void __iomem *reg, u32 clear, u32 set) */ static inline void wr_reg64(void __iomem *reg, u64 data) { - if (!caam_imx && caam_little_end) + if (caam_imx && caam_little_end) { + iowrite32(data >> 32, reg); + iowrite32(data, reg + sizeof(u32)); + } else if (caam_little_end) { iowrite64(data, reg); - else + } else { iowrite64be(data, reg); + } } static inline u64 rd_reg64(void __iomem *reg) { - if (!caam_imx && caam_little_end) + if (caam_imx && caam_little_end) { + return ((u64)ioread32(reg) << 32) | + (u64)ioread32(reg + sizeof(u32)); + } else if (caam_little_end) { return ioread64(reg); - else + } else { return ioread64be(reg); + } }