From patchwork Mon Jun 12 15:31:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 13276861 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 9DE28C88CB6 for ; Mon, 12 Jun 2023 15:32:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1653B8E0009; Mon, 12 Jun 2023 11:32:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 116C68E0002; Mon, 12 Jun 2023 11:32:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F1F8C8E0009; Mon, 12 Jun 2023 11:32:33 -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 D656E8E0002 for ; Mon, 12 Jun 2023 11:32:33 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 649081A0260 for ; Mon, 12 Jun 2023 15:32:33 +0000 (UTC) X-FDA: 80894487786.28.E384438 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf29.hostedemail.com (Postfix) with ESMTP id 68D1E12001F for ; Mon, 12 Jun 2023 15:32:31 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf29.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=1686583951; 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=pIB3SvnuE4oH3PVP9l8vEoEBsTlH+YYK7Kp4bwnkxMs=; b=TA25ya45tYZp0grWwxQh3Jjk0uupE+x4cOnTNhIqgXjW0PQcR21jJ6QE/Z2SDaBCRuU1du 40BYhyb2JNdXqh4r7xl1zzhrn/2rfgMSiNtRgE8nTo6L/W1GD3UgjS2tpSBLHWbU1D+Uqk hPSZhe6WxcxkI67MsLravqAjxIH+3W8= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf29.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=1686583951; a=rsa-sha256; cv=none; b=zi6QvKZzuQa4FmZh6mLKWEbhhKhgxozx1+Qau6Z9ZpB1m0XilpwXE3RM3zPmDtiJtIV38t JJsB2/RML5OZLZq1UlJidn1iuKeQeEcS1Q1HnSk3jkLSvyU82KqT3hg6iteqFcb15xcD/g c2dnUzbOvaBJ54I9pQYM1q3Y7F1Yci8= 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 7551B61FB6; Mon, 12 Jun 2023 15:32:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAAB8C433D2; Mon, 12 Jun 2023 15:32:25 +0000 (UTC) From: Catalin Marinas To: Andrew Morton , Linus Torvalds Cc: Christoph Hellwig , Robin Murphy , Arnd Bergmann , Greg Kroah-Hartman , Will Deacon , Marc Zyngier , Herbert Xu , Ard Biesheuvel , Isaac Manjarres , Saravana Kannan , Alasdair Kergon , Daniel Vetter , Joerg Roedel , Mark Brown , Mike Snitzer , "Rafael J. Wysocki" , Jonathan Cameron , Vlastimil Babka , linux-mm@kvack.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH v7 05/17] drivers/base: Use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN Date: Mon, 12 Jun 2023 16:31:49 +0100 Message-Id: <20230612153201.554742-6-catalin.marinas@arm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230612153201.554742-1-catalin.marinas@arm.com> References: <20230612153201.554742-1-catalin.marinas@arm.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 68D1E12001F X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: gsfoe4xtowh5snakz5883b393mfwdieh X-HE-Tag: 1686583951-734198 X-HE-Meta: U2FsdGVkX1/uv4sVh+Pskjd/VJ4k4L20EFuQ88feKS9QRaXqjL+ej1NoHS6aZtW0BX6fM/l65pn+TWh7T/wLEwEwsQAqxfIlYz/aCbfAPJU04FOEt0UJOgdkLMdfatBrhThfv1k/dJ14Z/5SUEGeVwYJDxmZ/qQ6rQ54TIr3BoMJdr4mNkhxV9FSyEZfXPhK+ScDqlMLy2TXXcta1LI2tvyF0drcSuvEFX6LAbI5rrFaEkovH3KtZwm6XzXDSLXjS0p8VJA31OQLdJ5PXD8PWxhjPyDS23u82ZLTqV6dFiqkGIblGNn2pZ7xwu/6iuOa0BjhtfLw49MM/z8YeY8Z6ApmVMWl1grH5mNxkVkMhM6nGfrJ+9GFydcwBL4UZPau9+kk3QJG6XcTQEkv5hUKcJzI9UabFZ/Ncl6AOBxla3Df/Vc461d3GWn//h8zKO98cll+RXO3p4FxfjGz6CLYa4fWdtpSPiDz4q9fQHI7/kEf7UDLmpfDZuJ2TFBfEknxva5TgBjFYP/QuoCxoJnIwpyLIiQaaQHw0QdLV+T+8xbCyTisw/WC4FGtr5Yai7namt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tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.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" Tested-by: Isaac J. Manjarres --- 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 {