From patchwork Wed May 24 17:18:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 13254344 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8BA4C77B7C for ; Wed, 24 May 2023 17:19:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2DDFA900008; Wed, 24 May 2023 13:19:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2BDC0900002; Wed, 24 May 2023 13:19:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1A2F6900008; Wed, 24 May 2023 13:19:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 0D7F1900002 for ; Wed, 24 May 2023 13:19:35 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id B421E40341 for ; Wed, 24 May 2023 17:19:34 +0000 (UTC) X-FDA: 80825810268.21.323B50A Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf07.hostedemail.com (Postfix) with ESMTP id 163634001E for ; Wed, 24 May 2023 17:19:31 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf07.hostedemail.com: domain of cmarinas@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cmarinas@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684948772; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X9GvMJYtQNhC/CV+bvo1nqxSzdMjEtDAvkUK7+TAINo=; b=3G9qhmsXTuUE8ceOxgzd2yF2OT5/3GAzkBK6FizxnnFeijHLCcHRCA5Rw3DseCpOeZajs/ 8u2e10EUOkNe9cg6Nj3/EQTUt9m3DdCIKur4MWDCV5LPesrVx+5pdkUPue3/Zvgm7M0eBw X+eKXYJKqoQ7HQTJ7ZEMVG/RdSrxock= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf07.hostedemail.com: domain of cmarinas@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cmarinas@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684948772; a=rsa-sha256; cv=none; b=aGvZhUzqWLohOTcDCMrr6bxIK2wEPOnfePaqHJqawQIVcDti+9zAk4vYhQOexUbE5YM+B2 Mopa1jyGzx61NIXS7/FZPBQ4N8T17bkOYdZzGMfwMPfRPVKky+tVhnQb4Dpw0eO2fBR1P8 j0ESmUZxB5p7Tp6mSGRvDT05+1g1c08= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 21A0463E8C; Wed, 24 May 2023 17:19:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D422AC4339B; Wed, 24 May 2023 17:19:26 +0000 (UTC) From: Catalin Marinas To: Linus Torvalds , Christoph Hellwig , Robin Murphy Cc: Arnd Bergmann , Greg Kroah-Hartman , Will Deacon , Marc Zyngier , Andrew Morton , Herbert Xu , Ard Biesheuvel , Isaac Manjarres , Saravana Kannan , Alasdair Kergon , Daniel Vetter , Joerg Roedel , Mark Brown , Mike Snitzer , "Rafael J. Wysocki" , linux-mm@kvack.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 05/15] drivers/base: Use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN Date: Wed, 24 May 2023 18:18:54 +0100 Message-Id: <20230524171904.3967031-6-catalin.marinas@arm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230524171904.3967031-1-catalin.marinas@arm.com> References: <20230524171904.3967031-1-catalin.marinas@arm.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 163634001E X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: a7p8st9k4gt745a91xxqf4b496ykjq85 X-HE-Tag: 1684948771-414398 X-HE-Meta: U2FsdGVkX1/YVvPOZB0Wg9ENM84Ob03FoWYncaMDs3ARkpqauHqm7jcD40xqVHNaZqqg4BhSL1gjDTvZqkMWvbwuo/UI7RKzFHxvcJwl/g5XjRCnj1PyzYfT0sVysjBjzj5coZ+zKOT+yctFf/5AKhvB0D5M2Xmg3nQ9T49QrFqRwD7AIfEQEX+0xYlZ7iYCc0OpUa9tsY6R6OCabZddte0Frt/C8ABMDDb3hsPVJH2iMkpu0W3l5LQkJYM5qcOnEC3GLF09n+DYtZdPOK2Vl3+z9z3U6XDRDEHFwgcPmT9CzegMgWUl+f3F0elfL3PJ7vIJJJ/Yl7h2YdU2POJ3Q6ydyNkPicD4F/7qFvYBBTP5+yMP3ux/x1Wif/Vy3vHdpm853Bh5ZJ9NlDRqdPTkhUKc+y5Op7mRGtxkrFgfDMTja/nscO+UNrw3xA14jaB7ShP5WnL9y4LBWu6nG+pckD8SycFKK9B84cHFGM5Y2LdESnHmQ0aS9IiVqTpBpQ8p7jZsaBlwAmd0hRUF+XmHNQ3n6r/czTWJy+DNpMGNWDEoVDehXju6TOxFJXQmAy6JFkxRs8nBxd5BmWTf7F+6Qp0XzhrxNNAu/4DAqBqX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vack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: ARCH_DMA_MINALIGN represents the minimum (static) alignment for safe DMA operations while ARCH_KMALLOC_MINALIGN is the minimum kmalloc() objects alignment. Signed-off-by: Catalin Marinas Acked-by: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" --- drivers/base/devres.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/base/devres.c b/drivers/base/devres.c index 5c998cfac335..3df0025d12aa 100644 --- a/drivers/base/devres.c +++ b/drivers/base/devres.c @@ -29,10 +29,10 @@ struct devres { * Some archs want to perform DMA into kmalloc caches * and need a guaranteed alignment larger than * the alignment of a 64-bit integer. - * Thus we use ARCH_KMALLOC_MINALIGN here and get exactly the same - * buffer alignment as if it was allocated by plain kmalloc(). + * Thus we use ARCH_DMA_MINALIGN for data[] which will force the same + * alignment for struct devres when allocated by kmalloc(). */ - u8 __aligned(ARCH_KMALLOC_MINALIGN) data[]; + u8 __aligned(ARCH_DMA_MINALIGN) data[]; }; struct devres_group {