From patchwork Thu May 18 17:33:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 13247171 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 81755C7EE23 for ; Thu, 18 May 2023 17:34:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 237B290000B; Thu, 18 May 2023 13:34:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E8B5900003; Thu, 18 May 2023 13:34:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0B0F490000B; Thu, 18 May 2023 13:34:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id F08E2900003 for ; Thu, 18 May 2023 13:34:32 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id A86A0140880 for ; Thu, 18 May 2023 17:34:32 +0000 (UTC) X-FDA: 80804075184.13.6810FD8 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf20.hostedemail.com (Postfix) with ESMTP id 01FB81C0012 for ; Thu, 18 May 2023 17:34:30 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of cmarinas@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cmarinas@kernel.org; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684431271; 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=Dm+d7Y6ryj2dE1YxB8WadOx3Ilyh2lsHCQVm10XuuU4=; b=sZl1/ZejVvzzaVrkIbsap4bH1lPoQtjNeL/pBhQy7hnce0++ViRmtc4vyBiG0cGRibstTX okXHPpRzIL1ChCbfds9TW147XU2OPQ8Y+2hX9jbzASdpXcyJ2PfR2NS3vyGb7MijyGyc5n HmARAxb1nx4/kP9VL12WzuQpco6IWcE= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of cmarinas@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cmarinas@kernel.org; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684431271; a=rsa-sha256; cv=none; b=Kr0hojksy8ApogI9qTiNWRaZYXy5BdhWXZY3FpxSG+Nwxr3+WJFDEQNBesKxViKKxCqYY5 hMnjJbr9iMLhcf0rjIrEmZKlSRmYrlfEB8yOgTtV6tDoBmT4y/oTO7303m8FKncBj3/BW2 upQwIf2M+4AzvklAVJeMyG+aL5om3I4= 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 17FFC601D7; Thu, 18 May 2023 17:34:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7C5EC4339E; Thu, 18 May 2023 17:34:25 +0000 (UTC) From: Catalin Marinas To: Linus Torvalds , Arnd Bergmann , Christoph Hellwig , Greg Kroah-Hartman Cc: 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" , Robin Murphy , linux-mm@kvack.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 05/15] drivers/base: Use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN Date: Thu, 18 May 2023 18:33:53 +0100 Message-Id: <20230518173403.1150549-6-catalin.marinas@arm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230518173403.1150549-1-catalin.marinas@arm.com> References: <20230518173403.1150549-1-catalin.marinas@arm.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 01FB81C0012 X-Rspam-User: X-Stat-Signature: wtnytgw4jsueno3ywucjc3fntzgu7sgh X-Rspamd-Server: rspam01 X-HE-Tag: 1684431270-920346 X-HE-Meta: U2FsdGVkX1/61YnNirnvGAuL09ypGEIH4w6Jewr49FQxr/WxBv2VZZ8uo1ZdkdYt3W2ZyeuJvbnSI0S4iwx+YyeRnbzC54MAldWaYST7uAsRM8WSHdX6NtieUZhNx6uCeRScwowAAph1/VaShjW55zMnA3liLyJ6O7T+OOzcjQGOqfPypyh6YcL2rK5ns3ICCYflhDSgW1T+EIU5bi/lf9KjlEkmR5mbSXDF2cJkYtxPPX3a5TvPPrdCODw3eBZxv1E+s4tF88zg8uO2ioRKr/++vqeWqZLGp/JP8WZLipBi7/s984dHoXIsRGUwDnF2ndMnqHhSebUHU8m+VPLJpgZvjW71KJKzqTtduFwBXt+VJZ18FnOONzeAZmHDOq3te6ctZxZfFxxw8alKWa/dbqrYIYcqKwbo2bBbpJJ6YuWiYMVsvvBQaitdSs7rlSxrh1xqmExtMWAtdMgwcmx8RfeZ5ZVEanmKpi5KEsgTdmtL23DU1cx9VCWrRt1PAVakNj63WcUa/pkScUJPJqzHNt6zJWj4tpZouG9GtBuo3ZwwJW7jpTCpcjDBVQQP7BuVwKisW9vRizWs2+HyQFvSBjxg3ZB3IljZVypjRLxqIuR6geNwpOXk1vA8ntdFjNTUFOthoE4NB8F/lTRIJ5RFawxmeFaVSogX01Gus9omCki+ue02LMJnt6nIDfYez6Fd86vuOOVkVtDmNKeb1obpeoAWPi4vcAHNjuI3T7Vqlw1mwRIy5lS+5BqXlAdJyCeMnxrVNgK59ViaTXC2eNQnL0A8N5rsVRuaM2tLj3hNgM7oTBiMkxKyss5BNX63SX3/FBN/5hmxRGLMRULCEA8Q/v9ETa7VmWVmcY+FlnGwAD1OShtp4T621bEszrvuSlJ7FVSjktZ5bgB9ncZmsxqflmtOiI2MhlCxWOEs+Rk/VkqMrjYJ9+5aH81fyCFHz0Ppw9Tk8uZm4x1BFPrutb0 9LAs+hAn LEgQl3saU9O3oTA2Df+0TshIsq7qQ2RxNObQ4PZA0iytedXCy2KHOdhTGMsEwTl7q1lGCE2eANq5gIGem87dHPyZ6MT0LdNEmvKDcli2/VkfIUQmkLK3Fyak4p63KltrPZtVJdf+o1MCj8hCJlTSdmD+zQd/heKgnSoo78bUWm9QkBoYD0tx43cUwpA/OsbBq24J7KdJcVRrQAOqwYBaJbYUXRvaMSNYr//SO27aF39ZIeRZegdlurBLkaIPdsgKplAnyl6DKenghsGUoWaT1nVd7lEl7rppodih3+TaVaPXRH6An7vCpFEmOXE6lC/rptIq7DWcnxobGsGc7ddBlizZp5CU6chHljg6c/49hz+/ShcBzRBi0h+24cayF3/IdE4txbMotpJk2Xw2i2JMjc8aF28Rs82Kg4g9cNNv/lovm3bEsp8hy9gVouFd8gttA8mqW7FlN1pOvrEAYOs9uc/dFeRPNTAyCcJyG0oolQJJexMcuf79pnwFrQQWWx4uq2C2IL0s9zhNNWF7FFiez8JsvMqAIYgwPzapO/Re2ptvkW+J6ng+25ICXF3tNw3wlqKK/aP92+Tf9coe255d73mtNNacdKuRZiJdIhv05KmBJwFB/k2Sy53y50A== X-Bogosity: Ham, 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 Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Acked-by: Greg Kroah-Hartman --- 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 {