From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3CCFC43217 for ; Sun, 27 Nov 2022 16:47:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229586AbiK0Qrd (ORCPT ); Sun, 27 Nov 2022 11:47:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229589AbiK0Qrb (ORCPT ); Sun, 27 Nov 2022 11:47:31 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E649221 for ; Sun, 27 Nov 2022 08:47:28 -0800 (PST) Received: from Valinor ([82.203.167.38]) by mail.gmx.net (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1N6KUd-1owolQ1cQT-016gli; Sun, 27 Nov 2022 17:47:09 +0100 Date: Sun, 27 Nov 2022 18:48:44 +0200 From: Lauri Kasanen To: Jonathan Cameron Cc: linux-input@vger.kernel.org, Dmitry Torokhov , Jonathan Cameron Subject: Re: [PATCH 7/9] Input: n64joy - Fix DMA buffer alignment. Message-Id: <20221127184844.f967054e30c47a3caa5090eb@gmx.com> In-Reply-To: <20221127144116.1418083-8-jic23@kernel.org> References: <20221127144116.1418083-1-jic23@kernel.org> <20221127144116.1418083-8-jic23@kernel.org> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.18.6; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:kfTENLsOQp3w5fVBTZPrWMPqAkoYMQixG2xeQZGkDZ58WeS7Mce TeOo38LKL7rf4eEhrH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U2PSNMvghCUyVN7Tbpyyhv7uTK IsxqGuI3HCDEWpKxcSpWzyFVJz+nue0TqdTVAbngYlDoN10p33z8sPUkRykkUw8IPUzuzDw1W xL56RWDgbSbX3MpWJa9onMSHXKI= Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org On Sun, 27 Nov 2022 14:41:14 +0000 Jonathan Cameron wrote: > From: Jonathan Cameron > > The use of ____cacheline_aligned to ensure a buffer is DMA safe only > enforces the start of the buffer alignment. In this case, sufficient > alignment is already ensured by the use of kzalloc(). > ____cacheline_aligned does not ensure that no other members of the > structure are placed in the same cacheline after the end of the > buffer marked. Thus to ensure a DMA safe buffer it must be at the end > of the structure. This move is unnecessary, because the cacheline is 16 bytes and the buffer is 64 bytes. > Whilst here switch from ____cacheline_aligned to > __aligned(ARCH_KMALLOC_MINALIGN) as on some architectures, with variable > sized cacheline lines across their cache hierarchy, require this > greater alignment guarantee for DMA safety. Make this change throughout > the driver as it reduces need for a reader to know about the particular > architecture. This change looks ok. - Lauri