From patchwork Mon Dec 5 09:06:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Horia Geanta X-Patchwork-Id: 9460689 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 6FF3B60459 for ; Mon, 5 Dec 2016 09:24:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CAF7223A4 for ; Mon, 5 Dec 2016 09:24:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 514F626246; Mon, 5 Dec 2016 09:24:32 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham 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 B26E824DA2 for ; Mon, 5 Dec 2016 09:24:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752219AbcLEJXu (ORCPT ); Mon, 5 Dec 2016 04:23:50 -0500 Received: from mail-dm3nam03on0045.outbound.protection.outlook.com ([104.47.41.45]:29213 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751704AbcLEJXS (ORCPT ); Mon, 5 Dec 2016 04:23:18 -0500 Received: from BY2PR03CA063.namprd03.prod.outlook.com (10.141.249.36) by BY2PR0301MB0741.namprd03.prod.outlook.com (10.160.63.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.747.13; Mon, 5 Dec 2016 09:07:19 +0000 Received: from BN1AFFO11FD046.protection.gbl (2a01:111:f400:7c10::152) by BY2PR03CA063.outlook.office365.com (2a01:111:e400:2c5d::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9 via Frontend Transport; Mon, 5 Dec 2016 09:07:19 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=fail action=none header.from=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1AFFO11FD046.mail.protection.outlook.com (10.58.53.61) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.734.4 via Frontend Transport; Mon, 5 Dec 2016 09:07:18 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:779; Count:11 Received: from enigma.ea.freescale.net (enigma.ea.freescale.net [10.171.77.120]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uB597F8L023808; Mon, 5 Dec 2016 02:07:16 -0700 From: =?UTF-8?q?Horia=20Geant=C4=83?= To: Herbert Xu CC: "David S. Miller" , , Dan Douglass , Alison Wang Subject: [PATCH] crypto: caam - fix pointer size for AArch64 boot loader, AArch32 kernel Date: Mon, 5 Dec 2016 11:06:58 +0200 Message-ID: <1480928818-8166-1-git-send-email-horia.geanta@nxp.com> X-Mailer: git-send-email 2.4.4 MIME-Version: 1.0 X-IncomingHeaderCount: 11 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131254024388446499; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(336004)(339900001)(199003)(189002)(104016004)(39400400001)(86362001)(39380400001)(39410400001)(38730400001)(189998001)(50986999)(36756003)(81156014)(68736007)(50226002)(8936002)(47776003)(105606002)(8676002)(81166006)(7846002)(8666005)(356003)(626004)(33646002)(305945005)(106466001)(6666003)(6916009)(110136003)(23676002)(97736004)(2870700001)(69596002)(92566002)(2906002)(5820100001)(5660300001)(39450400002)(77096006)(4326007)(50466002)(85426001)(39860400001)(39840400001)(39850400001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0741; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD046; 1:QEHN/ehifoBFamnSKQJKs/CW+3XkAoazhJ3GcP2GBB9uVOwJFyFKYdOpy3GX5gnkUucsnZbKWSUGozPUUhJiHkQ4v0VxAbi1EGw45SBEb71CHWNeoIF3yOBAPl+5HTpBFE3490icGySrnzekgwCS7440HEU6enVDEaJ6vI3EGnyhZOvHBKYcEVrNNpRgu9WnQ+7LLtLOO0yEMMURakgujyALCQ/6HkTmAzkv7mw6d0S7xJmRo7H2MoWGZ+k3bftCk4sLKBwIoP+n6MnXIVz/JcTfBMFB+AVIx6oxs9SllpQopYAoUcYBPqqEfz1+OiuzrOW7STJeuoSh+OLAv9ecxwxGMUYCytSQvy3yKNB/vwDgflqLbu1QF18mcxzJG8Wo0Z0s1GCaFerK9OmCudpKi3Pi1PrIvXedrAG4u3TjZo71FgVQFRA17VwrmrnSQoy1x/gXJHAny5FKECAJHNimKNfqNm3BxD/PkG4ylMlAfGOurrwXlU5kLlGsxmjwe4fQXpwnVftrt58pF9PhJozPlyAzBCyQWaiVvZnX+U8ihK4i6qlpwAfGZxypVKcQSJudo7j4kjFGJCeoJpnQCv7PK/3LotfDTV2zsUXq/05pY6UHWvjp5F/pBWGs7u8sdFMyz1h+jOJTFgim36cgbjH3wft1dHGuAXC4WtHdnww46LYa/mwvwzizVmK+rO4UpDlc2oHlIDV4rVKm8TzoUZw30v3w0bglZC5mNh5iXitYLjI= X-MS-Office365-Filtering-Correlation-Id: cecf0b03-1cab-49f2-8923-08d41cee1d7a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY2PR0301MB0741; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0741; 3:3FQS/Wjwe8Gp0wCdnMuHcTQ7zaKuVRDNZxJBLEsyv4kQVkabCqUXR19XKQaSk5h6S+T/JtSrS5RJxxF/wSh0q+xmkERqvDZSiw0kTEHyMCVExbhTSW7lWtWqD5qK0yAn6C6kA/dwq/meSfVHamrT/NyAUKEUk+mjZw1s6JVIwPX2+zreFpJw5G0rWJsdEwhmEitSMZv/YKo3+qtMfD42RfXJ4ITzLx4YXU1vMMFJThGNHuhdtAtMjmpIqfVOZ9jUuK8GyivorP0FvfJIufNZoBTKlbVYBJu34AU0n7aBV0deINvm4qSpPpZeBCD8SYVmgCslWsyng07XrsuH2JBFgD04JCCrp8QCe88xc0cPIwLzNkSqyjojfm3FCM8NntkS; 25:BsQ0vpqpbg9cy1+dOaZ5ZL8/L0UnKt6zODQ862ttOOoy4ImEOu1sVbCzJ1ZXF6ETNK/FFYT1kiYV5nz0e9OmIJ8ZhBAHi8e08VhkXujIvyaWi989wutmm8QI0rSP0oQTLVb6s5xjck+inPO5XbUNQuNviTxc7wN3wOT6QaUgVj6z6/hMVhggj/hJQRjUNvhdxhR6lPA0Mwnfx2rglAevz/AWxZg5fecWBNEZ6F27CAhrq3jKBa2USXb+xSxh6CQCGiDaKvOeFJpI3hJrgZn16EjAO0Zcrbo1z7ZhvkMb8yDmJ/9zSss2KsjysKEPkCATEfo/lSxFQAXuItDu98zT503kLr4aegVj4Xea9STwSbyADbcCUx9xik8Z3YQNiixW1Sr9wOQkIZ+tI3mkL2QWGTbwHgjxd/7ZkZ6QcVcivVHQ/hI9YZzu7taBpYDZUgBVXmRqOreevJbEMBFvVLOmdg== X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0741; 31:kyQ7UPCltx2PHJtuLX90AIqfdFyy+6CbSivfiPoPnWq5qw85u0n2KKW/Xe2B9CBP+eF87XOjDE75eZcBxuE/WAKEvivfWpbPESGoqDqoC7mIbC7lS1S4pJ393pQZi2HUMELkK0pitOulpbYCR1G6JTJOMO4IrqRWacEDnQLEF6cHbZqhe+XpCUL1zETBHZyPN+vE0PALohvTgN66+9rtuPdZ8PdG3eU7yV3ukskv6y+FJYeE85591qujxNS+MSF5BvScdTTO3O5StS3hIbVp6A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13017025)(13015025)(13023025)(13024025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6096035)(20161123561025)(20161123559025)(20161123556025)(20161123563025)(20161123565025); SRVR:BY2PR0301MB0741; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB0741; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0741; 4:a0t3XNXY2JJjETJtRYbu6R8Q+WDgBPctTNguHHO+BykJvGVnaarjLq7mYS/v9ovk5mMuQPuoAKI2/bQPh6rcpIq3w9XZaFes75kuahNV3Fc7yvz7tYUyz7O05HSqUG0SaaocDEehvUw6bBJWGTKKSHryNpgglMeAzeLUxoYUCTzUWtyRi4C5B16M5RvX/PbGXnLPbqVl6WR6SiB+I37TT1gFs50rbSWvJOs4TQ5KB65oNyZcRRiDA9vxoDUjU3Gejvg35bQDSu0B91udpcYLmT0WVEIturdNP0CohTTiMBvpIaiJuCL27SXi+xW1HBf/wawKpCVnoki28iM3fUQyt28bgJnVwnQ+d88BGZVWqrbB1ikBHudEiQ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hqNS6QveZWcFvg2; 24:LAWncP6z8UsxcuKhGXHlmDjTjAjaHfbB0kFKG1p5nicPnV20x1ZN4hiArAFraYtkChi2wlP3EgktSSfnpuNxyZRmyKlXn7NxVDun0jJAj88= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0741; 7:BEpQPD2WG5gGLOsNadCxAtIjzcvHZn9diWVI2BHofGOgBlv+XKcx9iSC+Q6eVhy5kcZLFyHPPogUdwi93PWUJGdkjVQhXOvvRahp4YL7It2CXAaAEhkG0s5pTFxfwBRHU/ANPi1+3vC7ysj3TLZgfU6CUY4zcqF7uiqhZ4E6VUHRB5LfOynCLB7UUqgXcFEPIXRpwlbcVi5Hkmi5en852kc78aCiM8+Xcd60YaFAR79GC3UNCgYlw4THBShkkt0QUC4YN+McOfV8+7c3YU91cCJvmHxZpsr9gROp4k6FT80iZUEixf0VqSEnC0yUEi2wX7IOaLJLNEXRKyEftzw5pQUolHlol0TiLRfpsfZ/HPh7HBauOkgSX6SwfT2Dk1f7K4B9bTenVlWpAC5oYSLEDbH8XW/FLd2kjldqKyPAOJgvRGvphdJAU1drtthsgIejCC1DfyxVayLt0XtWIyYUmw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2016 09:07:18.6106 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0741 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 Start with a clean slate before dealing with bit 16 (pointer size) of Master Configuration Register. This fixes the case of AArch64 boot loader + AArch32 kernel, when the boot loader might set MCFGR[PS] and kernel would fail to clear it. Cc: Reported-by: Alison Wang Signed-off-by: Horia Geantă Reviewed-By: Alison Wang --- drivers/crypto/caam/ctrl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index be62a7f482ac..0a6ca3919270 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -556,8 +556,9 @@ static int caam_probe(struct platform_device *pdev) * Enable DECO watchdogs and, if this is a PHYS_ADDR_T_64BIT kernel, * long pointers in master configuration register */ - clrsetbits_32(&ctrl->mcr, MCFGR_AWCACHE_MASK, MCFGR_AWCACHE_CACH | - MCFGR_AWCACHE_BUFF | MCFGR_WDENABLE | MCFGR_LARGE_BURST | + clrsetbits_32(&ctrl->mcr, MCFGR_AWCACHE_MASK | MCFGR_LONG_PTR, + MCFGR_AWCACHE_CACH | MCFGR_AWCACHE_BUFF | + MCFGR_WDENABLE | MCFGR_LARGE_BURST | (sizeof(dma_addr_t) == sizeof(u64) ? MCFGR_LONG_PTR : 0)); /*