From patchwork Wed May 31 15:48:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 13262459 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 AF679C77B7A for ; Wed, 31 May 2023 15:49:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 48F8E6B0071; Wed, 31 May 2023 11:49:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3F1528E0009; Wed, 31 May 2023 11:49:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B9EE6B0074; Wed, 31 May 2023 11:49:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 1EA826B0071 for ; Wed, 31 May 2023 11:49:10 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E37F01C7216 for ; Wed, 31 May 2023 15:49:09 +0000 (UTC) X-FDA: 80850984018.21.D13AEDD Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf29.hostedemail.com (Postfix) with ESMTP id 2E568120010 for ; Wed, 31 May 2023 15:49:07 +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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685548148; a=rsa-sha256; cv=none; b=tv5dIXFzDGBJPTMWmuzJZxMaYtPEb5uvSZ+OPBpP8qFU+BlOg70cJxtljGm08eRWdQ3BBl HIubzlnMv6Gz/Z+taDF3VygiVRH0Ma92noC6b+uBWRUhxDy5ZLv7//bNzaETCe9n73Eagm R2klhROjwz+XyZicg7egA02Cf0eeigI= 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685548148; 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=S59+slMdeGHVr9gGv1wpxhrhYrhnmUIhONDI6UrLqhg=; b=LRElfdAdYZptdiEJwQhrM1wSWTEn2rl3ckoZChDem4AkaPHTX2azm3TiaVm9dLKIEwHPcx Oy07dqhZqiV65kMDyEQfhgMfTmASyXX3AXugc1BMm5GywQEWjOGrDeXu6PubjgVVhsVUJZ AwZ1Vd8K35rpsr7/5CbNcBjSwxW5R8I= 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 19F0363DA4; Wed, 31 May 2023 15:49:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD567C4339E; Wed, 31 May 2023 15:49:02 +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" , Jonathan Cameron , linux-mm@kvack.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH v6 06/17] drivers/gpu: Use ARCH_DMA_MINALIGN instead of ARCH_KMALLOC_MINALIGN Date: Wed, 31 May 2023 16:48:25 +0100 Message-Id: <20230531154836.1366225-7-catalin.marinas@arm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230531154836.1366225-1-catalin.marinas@arm.com> References: <20230531154836.1366225-1-catalin.marinas@arm.com> MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 2E568120010 X-Stat-Signature: io1kwudi8q5do5h55pumqhn11n9yq7he X-Rspam-User: X-HE-Tag: 1685548147-129092 X-HE-Meta: U2FsdGVkX18QQ1ie+38xFNwmy4SmQIpbVwHPtwizOCddDwQ0Lk9dUgGOktURq4R7F15QsFhP51Acb1N2uZHtHG+9rcOOn65O5k+6MV8WfObL8RkNfZlyXSTKT0dxOw8OTnQNhRV5Az5KyZu/WZ2AeG0RMAZIVSzy9xzjV0Ke/s2Kx9S/ZZwRQpBMIJ2h+quRFe4ciYDfpwJ/rM5sWEv/YZgpZ0RsUmxHLTg0nwqW7ylLX6A96edNZ4Fhb73gwdVL6L8Oo8FOLSTrWAWiwEEJwiqDLgm0/n9TOkYbp6lBL2mqw41QcvlAaKfIIJYw6gCAr7IgGOQ9kteTmhbcXKtxpk7i9tyicZDxUEpGlqCfS6AQXgkOBKexb9V7YayRl/ZS9veC7Wiuvt0dRBPLxq0CwFl7PwZj3YC9DVgkxe/m6F5x0EAe9okQJBN3PIYohTLLprdgzenXSUsgRLOSI6rpShR4SuwIXSYAdQNbtCYtJ8WNPlWhRNgHJJnvDaGIp8TzqGDVLtbntVhEkY21cCbS0kCnUOsXQebwFH8XH0yl96vVn5emXCUF4uUk6Fr/HkSQ/t6aEzNFzWPe8MMm2kU0nHsW1OoHKtPUu2aG6WcQx1wYXf8S8ygyZuXGfbQ3KrrtnYhJBxvneknHIPU0HB2cWraOgQLq1KiSw5EdRB5KfGoL4L+Rq3/4VWdZ+C0Z/rcconTpPMyMw0xWICPut2TThvoUzdJHnSQ+O5rJhV+auzrPWjmKE4M3vVmZrT/uf/d7u04oXKoNJlE85QqdkFLVL9twZpc3ct9nDSRann6ZfyK0IleuhCzVqxYjcH+IAQZ6vRlyviM0o0RgM9j2GiL8exbB/5ACY+bhFJyfft7fFCYYf9r5fSTnRrzz1PgjZzkCXk8HEp9gYJCf1xZXAyBMTH1ofUCb7iEI9CMbfeKLgDX7EHlUsrCrdykcWkjsdufNgdO1OCfaeruZhs7ZuRb 2wzPkFin NDrza1KRcIunQglW+/TNoYyEoSq8zSEnycPPIGjFGWdPJ/G4jAhRKng2dxqjlxfRQuVVnCLQoxU2lcjtq+rzAH4DNcokfUFY9v5ehZzh32SkYh8KFJAuddhFeEAN+zgtLDLciGQ+eEUDN8/4dVikm0giFOZaI9jIc4iMalIm+Ub52MlXybsOlIl5ApZ43jH7aINAVqlE+C6xEZGe7mbDw2FTASF2vJ8b7bMpP0NC/uQoD9WCNyY4DCPcqRDRR5AGhgKlysm644tfPgx3+sPFKZnoPobM4Ey1zU55LgumegvglDOmCvg3MxWr8YYykseibtPeLhCUugjX1PvEdJudvwyIFN4/GA5EwnMBw7NoUslk/1nIyvuWdwZb8eBS5W8TmoBB8DK/K3O0sIa5GYGKKF3piCwWjGUAhY088iDAE0toQ0Omz/2vrAlRCK/f+Vojny5txdoeasQaJAcJ8vSxxZ2k54AkijAOeEUbEL2F00uqDwA/M+nFRNDLXRh4u9oWbmyfw 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: Daniel Vetter --- drivers/gpu/drm/drm_managed.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_managed.c b/drivers/gpu/drm/drm_managed.c index 4cf214de50c4..3a5802f60e65 100644 --- a/drivers/gpu/drm/drm_managed.c +++ b/drivers/gpu/drm/drm_managed.c @@ -49,10 +49,10 @@ struct drmres { * 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 drmres when allocated by kmalloc(). */ - u8 __aligned(ARCH_KMALLOC_MINALIGN) data[]; + u8 __aligned(ARCH_DMA_MINALIGN) data[]; }; static void free_dr(struct drmres *dr)