From patchwork Sun Nov 27 14:41:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 629756 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 7E2B9C46467 for ; Sun, 27 Nov 2022 14:28:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229671AbiK0O26 (ORCPT ); Sun, 27 Nov 2022 09:28:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229555AbiK0O25 (ORCPT ); Sun, 27 Nov 2022 09:28:57 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24DB6DFFA for ; Sun, 27 Nov 2022 06:28:56 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id CD49BB80ADD for ; Sun, 27 Nov 2022 14:28:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92C13C433D7; Sun, 27 Nov 2022 14:28:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669559333; bh=1SwKjxr+K6YyjREEqd1X60aPy6gpeA8Bj9Fhi8pp6vw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bYEEZ3neR0rAObvN09WJNwxdKX6QIQZ71jJwAVgv1OG2VaYywgGeS7JgQG9oJCYXj 7J/wxxzdgkv68ziurBQK7DYx9DyFVtGbSG17EgdCRlNTdGNVXdSf9noa4qRhTG64da QIDiTv9MiGq0lv8eRatmkXQDfWb0RecF48HWV9cIUf9nOBhx/9zMWlL7YR5i1zG22f Zle4w7ZPaECfwG7YwUAm/0d7t1qla3lPPR6vLErII+DiGWyMlWtueljw9fCeVs26H/ xcH+PoHVYaBbNHu1bJPwaPAYwIQh6bgCz03U2WH74yRU2EmTn7DxeH2pOAkhmcemKG dGTMaJ2tYk2IA== From: Jonathan Cameron To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: Jonathan Cameron , Tomohiro Yoshidomi Subject: [PATCH 1/9] Input: psxpad - Fix padding for DMA safe buffers. Date: Sun, 27 Nov 2022 14:41:08 +0000 Message-Id: <20221127144116.1418083-2-jic23@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221127144116.1418083-1-jic23@kernel.org> References: <20221127144116.1418083-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Jonathan Cameron On some architectures (e.g. arm64), ____cachline_aligned only aligns to the cacheline size of the L1 cache size. L1_CACHE_BYTES in arch64/include/asm/cache.h Unfortunately DMA safety on these architectures requires the buffer no share a last level cache cacheline given by ARCH_DMA_MINALIGN which has a greater granularity. ARCH_DMA_MINALIGN is not defined for all architectures, but when it is defined it is used to set the size of ARCH_KMALLOC_MINALIGN to allow DMA safe buffer allocations. As such the correct alignment requirement is __aligned(ARCH_KMALLOC_MINALIGN). This has recently been fixed in other subsystems such as IIO. Fixes: 8be193c7b1f4 ("Input: add support for PlayStation 1/2 joypads connected via SPI") Signed-off-by: Jonathan Cameron Cc: Tomohiro Yoshidomi --- drivers/input/joystick/psxpad-spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/joystick/psxpad-spi.c b/drivers/input/joystick/psxpad-spi.c index a32656064f39..8098d205b58d 100644 --- a/drivers/input/joystick/psxpad-spi.c +++ b/drivers/input/joystick/psxpad-spi.c @@ -65,8 +65,8 @@ struct psxpad { bool motor2enable; u8 motor1level; u8 motor2level; - u8 sendbuf[0x20] ____cacheline_aligned; - u8 response[sizeof(PSX_CMD_POLL)] ____cacheline_aligned; + u8 sendbuf[0x20] __aligned(ARCH_KMALLOC_MINALIGN); + u8 response[sizeof(PSX_CMD_POLL)] __aligned(ARCH_KMALLOC_MINALIGN); }; static int psxpad_command(struct psxpad *pad, const u8 sendcmdlen) From patchwork Sun Nov 27 14:41:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 629755 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 ABCDCC352A1 for ; Sun, 27 Nov 2022 14:29:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229541AbiK0O27 (ORCPT ); Sun, 27 Nov 2022 09:28:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbiK0O26 (ORCPT ); Sun, 27 Nov 2022 09:28:58 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CD85DFE7 for ; Sun, 27 Nov 2022 06:28:57 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 24BFCB80AF9 for ; Sun, 27 Nov 2022 14:28:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EAE39C433D6; Sun, 27 Nov 2022 14:28:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669559334; bh=cwzky6ouGybQ8mPYMRkwMibBYbZn51YfowH4xCJf9kw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W3XyN7Punt3ugCdBAzt8rVGIQNKONOQ1PK0nx+w/aq3ZW831Y72ejYMajS8ZYROxC 2JPkNDds/vtm0+JpsTHv4ezAx1RID0V0O6x+UJYkYWX21jyHpsRTtbrP9BICCiIUZw EqvejmaSdOkfrkAKY3gTb/S+EYMLdTMnUByAKWqGZlxJuXJpDAxMLW35Zby3Lj42Nb J3HkvgnuJ30HcTJm/H+QXAUAL/bb/nw/PZdx9+LfLHzUYVJQ0Bmerv5GnW7uUFjXIp tca30w4NtkU9W8aOWX53CXxThiM6rhZSM9f4q4IYE2T2Cgu3y+DdF92Msk61TOXxeb F5xm8nTYCoLjg== From: Jonathan Cameron To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: Jonathan Cameron , Michael Hennerich Subject: [PATCH 2/9] Input: ad714x - Fix padding for DMA safe buffers. Date: Sun, 27 Nov 2022 14:41:09 +0000 Message-Id: <20221127144116.1418083-3-jic23@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221127144116.1418083-1-jic23@kernel.org> References: <20221127144116.1418083-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Jonathan Cameron On some architectures (e.g. arm64), ____cachline_aligned only aligns to the cacheline size of the L1 cache size. L1_CACHE_BYTES in arch64/include/asm/cache.h Unfortunately DMA safety on these architectures requires the buffer no share a last level cache cacheline given by ARCH_DMA_MINALIGN which has a greater granularity. ARCH_DMA_MINALIGN is not defined for all architectures, but when it is defined it is used to set the size of ARCH_KMALLOC_MINALIGN to allow DMA safe buffer allocations. As such the correct alignment requirement is __aligned(ARCH_KMALLOC_MINALIGN). This has recently been fixed in other subsystems such as IIO. Fixes tag is inprecise because there may not have been any architectures where the two values were different at the time of the earlier fix. Fixes: c0409feb8689 ("Input: ad714x - use DMA-safe buffers for spi_write()") Signed-off-by: Jonathan Cameron Cc: Michael Hennerich --- drivers/input/misc/ad714x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/misc/ad714x.h b/drivers/input/misc/ad714x.h index af847b5f0d0e..2b8b901183be 100644 --- a/drivers/input/misc/ad714x.h +++ b/drivers/input/misc/ad714x.h @@ -41,7 +41,7 @@ struct ad714x_chip { unsigned product; unsigned version; - __be16 xfer_buf[16] ____cacheline_aligned; + __be16 xfer_buf[16] __aligned(ARCH_KMALLOC_MINALIGN); }; From patchwork Sun Nov 27 14:41:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 628908 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 9525BC4332F for ; Sun, 27 Nov 2022 14:29:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229555AbiK0O27 (ORCPT ); Sun, 27 Nov 2022 09:28:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbiK0O25 (ORCPT ); Sun, 27 Nov 2022 09:28:57 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C560DFD4 for ; Sun, 27 Nov 2022 06:28:57 -0800 (PST) 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 D422860DC6 for ; Sun, 27 Nov 2022 14:28:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DBD5C433C1; Sun, 27 Nov 2022 14:28:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669559336; bh=tg1LAaOqaFFo1uwN5kSo6d9uaNIeLPUSYynENN0A/rs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gHUCNFNrMjKsxG5+Kv5ZOpR4IFVUZ9JdXm5qsWapQnfxWt4HLyWlAuE/LotufocCZ pN6c+22qidX6dzz32xA8+1sdmgkQfslRjJyTUSGnXca8VgY2QfUeDzTptGXrfW48jK 3J5KqbeEEBjL27SNYNWKX9B9yVb2n6oPdQ9vfB7edt2XCdS7Nlt2fEOAedajD3EOpN O92xI8b0aGLk2deuXYfXA6tWGEado1tMCNlo55vVtzUMekO+YR7WY1oS06qGWvNpJJ H+LyUCN4lUlYV/vE1IY5nfqJn0+lZr1rfsd9H6hc3dyyVmpESom6GyHdAO5y9uOHvC JB8R2y+vIWedQ== From: Jonathan Cameron To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: Jonathan Cameron , Michael Hennerich Subject: [PATCH 3/9] Input: ad7887 - Fix padding for DMA safe buffers. Date: Sun, 27 Nov 2022 14:41:10 +0000 Message-Id: <20221127144116.1418083-4-jic23@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221127144116.1418083-1-jic23@kernel.org> References: <20221127144116.1418083-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Jonathan Cameron On some architectures (e.g. arm64), ____cachline_aligned only aligns to the cacheline size of the L1 cache size. L1_CACHE_BYTES in arch64/include/asm/cache.h Unfortunately DMA safety on these architectures requires the buffer no share a last level cache cacheline given by ARCH_DMA_MINALIGN which has a greater granularity. ARCH_DMA_MINALIGN is not defined for all architectures, but when it is defined it is used to set the size of ARCH_KMALLOC_MINALIGN to allow DMA safe buffer allocations. As such the correct alignment requirement is __aligned(ARCH_KMALLOC_MINALIGN). This has recently been fixed in other subsystems such as IIO. Fixes tag is imprecise as there may have been no architectures where the two alignments differed at the time of that patch. Fixes: 3843384a0554 ("Input: ad7877 - keep dma rx buffers in seperate cache lines") Signed-off-by: Jonathan Cameron Cc: Michael Hennerich Acked-by: Michael Hennerich --- drivers/input/touchscreen/ad7877.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c index 08f5372f0bfd..eaf11dffb28e 100644 --- a/drivers/input/touchscreen/ad7877.c +++ b/drivers/input/touchscreen/ad7877.c @@ -150,7 +150,7 @@ struct ser_req { * DMA (thus cache coherency maintenance) requires the * transfer buffers to live in their own cache lines. */ - u16 sample ____cacheline_aligned; + u16 sample __aligned(ARCH_KMALLOC_MINALIGN); }; struct ad7877 { @@ -189,7 +189,7 @@ struct ad7877 { * DMA (thus cache coherency maintenance) requires the * transfer buffers to live in their own cache lines. */ - u16 conversion_data[AD7877_NR_SENSE] ____cacheline_aligned; + u16 conversion_data[AD7877_NR_SENSE] __aligned(ARCH_KMALLOC_MINALIGN); }; static bool gpio3; From patchwork Sun Nov 27 14:41:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 629754 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 96866C352A1 for ; Sun, 27 Nov 2022 14:29:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229677AbiK0O3C (ORCPT ); Sun, 27 Nov 2022 09:29:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229669AbiK0O3A (ORCPT ); Sun, 27 Nov 2022 09:29:00 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 284FD637F for ; Sun, 27 Nov 2022 06:29:00 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id D0EF7B80B03 for ; Sun, 27 Nov 2022 14:28:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A55F3C433D6; Sun, 27 Nov 2022 14:28:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669559337; bh=1JZTrOB0xZLUQUF2V3fwOu6c2MPhxf/sGD9p7hkd+1o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HcagDOh40ISzD5X3Zs+AP7MPFi+3kCPV+yIUkZhhem2yf4vaZIqi7O9nA62ZHv6st naPo4dx7u411MgC71FD9LNdYCZkkiwCSjBO7dTGF1CdoQiMSYAftitjVO420YyVktw rudDD00yaDnaOFawZyVPggGBLo28q0MHV2fDjEcUjHCfikaqpLs6vSUsFG+GUSX3DC qVNYPMqZWeukmfjZNoaYoXCKxkIhbYem1BV5wzkN11oRy8GNef5XTMg8Eaz7fek5uk mj4z4q7OwyEUTZFZSi48P/XZK7sI34HK0Br6phfLsCxKmkYyG/jt6AZHgyoNBv1rV7 YAFKeE6uBUC6w== From: Jonathan Cameron To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: Jonathan Cameron , Daniel Mack Subject: [PATCH 4/9] Input: ads7846 - Fix padding for DMA safe buffers. Date: Sun, 27 Nov 2022 14:41:11 +0000 Message-Id: <20221127144116.1418083-5-jic23@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221127144116.1418083-1-jic23@kernel.org> References: <20221127144116.1418083-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Jonathan Cameron On some architectures (e.g. arm64), ____cachline_aligned only aligns to the cacheline size of the L1 cache size. L1_CACHE_BYTES in arch64/include/asm/cache.h Unfortunately DMA safety on these architectures requires the buffer no share a last level cache cacheline given by ARCH_DMA_MINALIGN which has a greater granularity. ARCH_DMA_MINALIGN is not defined for all architectures, but when it is defined it is used to set the size of ARCH_KMALLOC_MINALIGN to allow DMA safe buffer allocations. As such the correct alignment requirement is __aligned(ARCH_KMALLOC_MINALIGN). This has recently been fixed in other subsystems such as IIO. Fixes tag for this is complex as at the time of original introduction, it is likely that there were no cases where the two alignments were different. Fixes: 1dbe7dada2d0 ("Input: ads7846 - make transfer buffers DMA safe") Signed-off-by: Jonathan Cameron Cc: Daniel Mack --- drivers/input/touchscreen/ads7846.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index bed68a68f330..074ca9f59788 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -337,7 +337,7 @@ struct ser_req { * DMA (thus cache coherency maintenance) requires the * transfer buffers to live in their own cache lines. */ - __be16 sample ____cacheline_aligned; + __be16 sample __aligned(ARCH_KMALLOC_MINALIGN); }; struct ads7845_ser_req { @@ -348,7 +348,7 @@ struct ads7845_ser_req { * DMA (thus cache coherency maintenance) requires the * transfer buffers to live in their own cache lines. */ - u8 sample[3] ____cacheline_aligned; + u8 sample[3] __aligned(ARCH_KMALLOC_MINALIGN); }; static int ads7846_read12_ser(struct device *dev, unsigned command) From patchwork Sun Nov 27 14:41:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 628907 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 BB917C4332F for ; Sun, 27 Nov 2022 14:29:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229616AbiK0O3B (ORCPT ); Sun, 27 Nov 2022 09:29:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbiK0O3A (ORCPT ); Sun, 27 Nov 2022 09:29:00 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 290D6DFE7 for ; Sun, 27 Nov 2022 06:29:00 -0800 (PST) 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 BA1EC60DC8 for ; Sun, 27 Nov 2022 14:28:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0997CC433B5; Sun, 27 Nov 2022 14:28:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669559339; bh=L18Nv4SsEp06ll09Dam+tSqGsS4Z0+vqMn31KwkBqE8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D8SPPc5uYsTQCIDSyMdEZTvqVY5TXgJYt1ThaECoiRGoISnvvZSAuujzheUh6kggW Z1Wco4nPrWS3iHKze4uGoNNtNiTNFpmham0jXukO+qqXunTxDfqTCDm07RsnRN62hn nPaf3opDS+8+u2DMBTXB11Ary+gBkFuEDcfTDroDrxN+i48zw3Y6ROwlf4XIF12TC9 CxBCUXiXU8hftZDNdJIaF2/rEOIz14uXqK37xgOEA60qHF0PjkTftQhel06Q90HN88 XJhIcfp9SJvQIO4k1X+Fd2MkF5XxxTJKDVJ7LDJhEsek71mvpirOxK2r807bPzcIrl OP3McQtHBoDcw== From: Jonathan Cameron To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: Jonathan Cameron , Javier Martinez Canillas , Linus Walleij Subject: [PATCH 5/9] Input: cyttsp - Fix padding for DMA safe buffers. Date: Sun, 27 Nov 2022 14:41:12 +0000 Message-Id: <20221127144116.1418083-6-jic23@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221127144116.1418083-1-jic23@kernel.org> References: <20221127144116.1418083-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Jonathan Cameron On some architectures (e.g. arm64), ____cachline_aligned only aligns to the cacheline size of the L1 cache size. L1_CACHE_BYTES in arch64/include/asm/cache.h Unfortunately DMA safety on these architectures requires the buffer no share a last level cache cacheline given by ARCH_DMA_MINALIGN which has a greater granularity. ARCH_DMA_MINALIGN is not defined for all architectures, but when it is defined it is used to set the size of ARCH_KMALLOC_MINALIGN to allow DMA safe buffer allocations. As such the correct alignment requirement is __aligned(ARCH_KMALLOC_MINALIGN). This has recently been fixed in other subsystems such as IIO. Fixes tag for this is complex as at the time of original introduction, it is likely that there were no cases where the two alignments were different. Fixes: 4065d1e7b216 ("Input: add Cypress TTSP capacitive multi-touch screen support") Signed-off-by: Jonathan Cameron Cc: Javier Martinez Canillas Cc: Linus Walleij --- drivers/input/touchscreen/cyttsp_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/cyttsp_core.h b/drivers/input/touchscreen/cyttsp_core.h index 075509e695a2..e87cb323623c 100644 --- a/drivers/input/touchscreen/cyttsp_core.h +++ b/drivers/input/touchscreen/cyttsp_core.h @@ -131,7 +131,7 @@ struct cyttsp { u8 lp_intrvl; u8 *bl_keys; - u8 xfer_buf[] ____cacheline_aligned; + u8 xfer_buf[] __aligned(ARCH_KMALLOC_MINALIGN); }; struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops, From patchwork Sun Nov 27 14:41:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 629753 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 B00CAC4332F for ; Sun, 27 Nov 2022 14:29:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229496AbiK0O3E (ORCPT ); Sun, 27 Nov 2022 09:29:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229669AbiK0O3D (ORCPT ); Sun, 27 Nov 2022 09:29:03 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 026B7DFFA for ; Sun, 27 Nov 2022 06:29:03 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id AE5E4B80937 for ; Sun, 27 Nov 2022 14:29:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8878EC433C1; Sun, 27 Nov 2022 14:28:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669559340; bh=o3o/moa7MtGu7jJjgZyXVibG/j/nNr3lQLloisbwnVI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T9CFsokYXD5KaBW91nOgbgFClRhqaEKaRYOnM/QQO670/sG4NN7qBlhyeIfhQrcjT fjwFvd+nTrvNhxoDpW9QKpV2otx8BoFY05e88FK57kFNw7GV5tdCseFiNiwG+p7bOp wFpXzoP0l2kMJMUKZFKkN8y87vNuXdnXGVUIFDngFHzA3wiC/Kq7OXIsosP9HioBNR ZeKKixllMwO0Q4XJ4lkJMg2M2aH9MMChPbSERfexvx4tKoJ4yYDbSdjY0PATASo9kO MVgD85UFRdZLLUR4tbr0ppDYrKSfdnBpeNqMof4HyqJlqpXK0ALw6TdR664zjsYBF/ seDX6NHpRnAOw== From: Jonathan Cameron To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: Jonathan Cameron , Benjamin Tissoires Subject: [PATCH 6/9] Input: surface3 - Fix padding for DMA safe buffers. Date: Sun, 27 Nov 2022 14:41:13 +0000 Message-Id: <20221127144116.1418083-7-jic23@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221127144116.1418083-1-jic23@kernel.org> References: <20221127144116.1418083-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Jonathan Cameron On some architectures (e.g. arm64), ____cachline_aligned only aligns to the cacheline size of the L1 cache size. L1_CACHE_BYTES in arch64/include/asm/cache.h Unfortunately DMA safety on these architectures requires the buffer no share a last level cache cacheline given by ARCH_DMA_MINALIGN which has a greater granularity. ARCH_DMA_MINALIGN is not defined for all architectures, but when it is defined it is used to set the size of ARCH_KMALLOC_MINALIGN to allow DMA safe buffer allocations. As such the correct alignment requirement is __aligned(ARCH_KMALLOC_MINALIGN). This has recently been fixed in other subsystems such as IIO. Presumably this part is little used on boards where this could actually matter so this is mostly about removing code that might be coppied elsewhere. Fixes: 4feacbc24eea ("Input: add new driver for the Surface 3") Signed-off-by: Jonathan Cameron Cc: Benjamin Tissoires --- drivers/input/touchscreen/surface3_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/surface3_spi.c b/drivers/input/touchscreen/surface3_spi.c index 1da23e5585a0..6c884fc2b332 100644 --- a/drivers/input/touchscreen/surface3_spi.c +++ b/drivers/input/touchscreen/surface3_spi.c @@ -32,7 +32,7 @@ struct surface3_ts_data { struct input_dev *pen_input_dev; int pen_tool; - u8 rd_buf[SURFACE3_PACKET_SIZE] ____cacheline_aligned; + u8 rd_buf[SURFACE3_PACKET_SIZE] __aligned(ARCH_KMALLOC_MINALIGN; }; struct surface3_ts_data_finger { From patchwork Sun Nov 27 14:41:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 628906 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 E03F7C46467 for ; Sun, 27 Nov 2022 14:29:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229678AbiK0O3D (ORCPT ); Sun, 27 Nov 2022 09:29:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229676AbiK0O3D (ORCPT ); Sun, 27 Nov 2022 09:29:03 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C172BDFF2 for ; Sun, 27 Nov 2022 06:29:02 -0800 (PST) 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 6A9B760DCF for ; Sun, 27 Nov 2022 14:29:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE280C433D6; Sun, 27 Nov 2022 14:29:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669559341; bh=Jy1T8pXOHg81o+LWMLTgjpQBDvQ3U108dXBJQotRG/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SLAB6/7eN0U7YcGEq/xq+ttawNvdy8g3hjVy0fIxoweFWC71Bb/602/L+61xZ6fbJ HmyKruilikxtXQgKxZns+XuAeq1ZPJ59EH3hrtAV6wtzpLELfWzDSj63RTp7XQm4JW 3HPrk9XD3RK82FgjQqcoorY2ceN5RKkpT/oge5I+VhC1IlUQy8PTk+pLzKu+mdUFUB fC5lukkjDfm7WAbiaAxqZ94lgtAmSBLmh8MS2V/AZZp/tj7K29WjuLiD4G6T5Pa3bB zlSqHfsor8tagRGkuAriaE4BzQU0UkM7f4Pwp2LaK6K2P9e8KbSrSkBHkrOw31inNI xzkNKZZrSKDHg== From: Jonathan Cameron To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: Jonathan Cameron , Lauri Kasanen Subject: [PATCH 7/9] Input: n64joy - Fix DMA buffer alignment. Date: Sun, 27 Nov 2022 14:41:14 +0000 Message-Id: <20221127144116.1418083-8-jic23@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221127144116.1418083-1-jic23@kernel.org> References: <20221127144116.1418083-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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. 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. Signed-off-by: Jonathan Cameron Cc: Lauri Kasanen --- Only partly compile tested as I don't have a mips toolchain set up. Would be great to add the stubs to be able to build these drivers with COMPILE_TEST. --- drivers/input/joystick/n64joy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/input/joystick/n64joy.c b/drivers/input/joystick/n64joy.c index 9dbca366613e..d8c50103c108 100644 --- a/drivers/input/joystick/n64joy.c +++ b/drivers/input/joystick/n64joy.c @@ -44,12 +44,12 @@ static const char *n64joy_phys[MAX_CONTROLLERS] = { }; struct n64joy_priv { - u64 si_buf[8] ____cacheline_aligned; struct timer_list timer; struct mutex n64joy_mutex; struct input_dev *n64joy_dev[MAX_CONTROLLERS]; u32 __iomem *reg_base; u8 n64joy_opened; + u64 si_buf[8] __aligned(ARCH_KMALLOC_MINALIGN); }; struct joydata { @@ -129,7 +129,7 @@ static void n64joy_exec_pif(struct n64joy_priv *priv, const u64 in[8]) local_irq_restore(flags); } -static const u64 polldata[] ____cacheline_aligned = { +static const u64 polldata[] __aligned(ARCH_KMALLOC_MINALIGN) = { 0xff010401ffffffff, 0xff010401ffffffff, 0xff010401ffffffff, @@ -222,7 +222,7 @@ static void n64joy_close(struct input_dev *dev) mutex_unlock(&priv->n64joy_mutex); } -static const u64 __initconst scandata[] ____cacheline_aligned = { +static const u64 __initconst scandata[] __aligned(ARCH_KMALLOC_MINALIGN) = { 0xff010300ffffffff, 0xff010300ffffffff, 0xff010300ffffffff, From patchwork Sun Nov 27 14:41:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 628905 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 196A1C352A1 for ; Sun, 27 Nov 2022 14:29:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229681AbiK0O3G (ORCPT ); Sun, 27 Nov 2022 09:29:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229690AbiK0O3E (ORCPT ); Sun, 27 Nov 2022 09:29:04 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33CC4DFF3 for ; Sun, 27 Nov 2022 06:29:04 -0800 (PST) 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 C10AA60DC8 for ; Sun, 27 Nov 2022 14:29:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40566C433C1; Sun, 27 Nov 2022 14:29:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669559343; bh=QsL8vDZaeyn70YUIfKe1Z7n3hslJX8WYpKdZzZmdcTc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NtPni+349EamRADKKGpJZ9fqq/ONta2ohnash1+mydVAizXpAda/2jpd3nSs7STz8 P3VMG65P0vB6eVbYhV0Piywdz3mGdY5F006BHZfTlDqclZPsKlE/8Z+3b0/YYWWFE6 yvxZniY8hNRHJC2wm6+N/e2KzxZa9Jy56tFrmtR/ngysyrPDlfFj0HV8U9BmlDnKY9 beGSTef+sEyI/xXq2lT8X/YQbfkZHPau0uZwhfWnfTa0rTol3TG9nui6CaFhc6FIVz sye0QcgCLDaBE5wXq4qGm8EEGBdDxHqjJZSQBnPS7esVXS+CLqaCUNaOyQshD3bFo7 XnRu1klQtWTCQ== From: Jonathan Cameron To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: Jonathan Cameron , Daniel Hung-yu Wu Subject: [PATCH 8/9] Input: atmel_captouch - Avoid suspect DMA buffer alignment. Date: Sun, 27 Nov 2022 14:41:15 +0000 Message-Id: <20221127144116.1418083-9-jic23@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221127144116.1418083-1-jic23@kernel.org> References: <20221127144116.1418083-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Jonathan Cameron On some architectures (e.g. arm64), ____cachline_aligned only aligns to the cacheline size of the L1 cache size. L1_CACHE_BYTES in arch64/include/asm/cache.h Unfortunately DMA safety on these architectures requires the buffer no share a last level cache cacheline given by ARCH_DMA_MINALIGN which has a greater granularity. ARCH_DMA_MINALIGN is not defined for all architectures, but when it is defined it is used to set the size of ARCH_KMALLOC_MINALIGN to allow DMA safe buffer allocations. As such the correct alignment requirement is __aligned(ARCH_KMALLOC_MINALIGN). This has recently been fixed in other subsystems such as IIO. This is probably not a fix as such, because likely this particular device is only used on devices where the given alignment is sufficient. Signed-off-by: Jonathan Cameron Cc: Daniel Hung-yu Wu --- drivers/input/misc/atmel_captouch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/misc/atmel_captouch.c b/drivers/input/misc/atmel_captouch.c index 051aded6815a..9681c763356c 100644 --- a/drivers/input/misc/atmel_captouch.c +++ b/drivers/input/misc/atmel_captouch.c @@ -71,7 +71,7 @@ struct atmel_captouch_device { u32 num_btn; u32 keycodes[MAX_NUM_OF_BUTTONS]; u8 prev_btn; - u8 xfer_buf[8] ____cacheline_aligned; + u8 xfer_buf[8] __aligned(ARCH_KMALLOC_MINALIGN); }; /* From patchwork Sun Nov 27 14:41:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 629752 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 89DE6C47088 for ; Sun, 27 Nov 2022 14:29:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229676AbiK0O3G (ORCPT ); Sun, 27 Nov 2022 09:29:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229679AbiK0O3G (ORCPT ); Sun, 27 Nov 2022 09:29:06 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CA2EDFDA for ; Sun, 27 Nov 2022 06:29:05 -0800 (PST) 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 2989660DE1 for ; Sun, 27 Nov 2022 14:29:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 979BDC433D7; Sun, 27 Nov 2022 14:29:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669559344; bh=AzGsp3e9BQEjPDsjEpI77hRwJ51e8bdKfmP/HYluH0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BHxMq6epvis6ZM9SJZdSgazX6v7Rkc5AB/aXPArG8SdR1+gS6oW/pj8idhtlns2hG 1NF9HnXlP/NlonCPb6iNG2dDUxtzydGSo4GeQ8riQYCW4GElmIOv259j9yzN4YNh5/ sS65JSX2DDzi9YJ1XnGlwO+OP99ZeQtVvrL2tyNQ0RMv0IAhL0oaIMug+yUnqSPHuW YBQr4tRSl5s1yLw56/A/egYGRHjmwroo4K1ffOYH3k4QU0FUVPMiEwbrtqKDjsjNm+ s3gOphw9tCog4p9XiTJ6HMmRBT+ri07GL3fe6+HVMKwYVnzHKtqf5+12qwLB2eKpRu gPnGwY2i2cBCA== From: Jonathan Cameron To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: Jonathan Cameron , Daniel Hung-yu Wu Subject: [PATCH 9/9] Input: elants - Fix suspect DMA buffer alignment Date: Sun, 27 Nov 2022 14:41:16 +0000 Message-Id: <20221127144116.1418083-10-jic23@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221127144116.1418083-1-jic23@kernel.org> References: <20221127144116.1418083-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Jonathan Cameron On some architectures (e.g. arm64), ____cachline_aligned only aligns to the cacheline size of the L1 cache size. L1_CACHE_BYTES in arch64/include/asm/cache.h Unfortunately DMA safety on these architectures requires the buffer no share a last level cache cacheline given by ARCH_DMA_MINALIGN which has a greater granularity. ARCH_DMA_MINALIGN is not defined for all architectures, but when it is defined it is used to set the size of ARCH_KMALLOC_MINALIGN to allow DMA safe buffer allocations. As such the correct alignment requirement is __aligned(ARCH_KMALLOC_MINALIGN). This has recently been fixed in other subsystems such as IIO. Fixes: 00f73f97527f ("Input: elants_i2c - use DMA safe i2c when possible") Signed-off-by: Jonathan Cameron Cc: Daniel Hung-yu Wu --- drivers/input/touchscreen/elants_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c index 879a4d984c90..7ad58518c651 100644 --- a/drivers/input/touchscreen/elants_i2c.c +++ b/drivers/input/touchscreen/elants_i2c.c @@ -184,7 +184,7 @@ struct elants_data { bool keep_power_in_suspend; /* Must be last to be used for DMA operations */ - u8 buf[MAX_PACKET_SIZE] ____cacheline_aligned; + u8 buf[MAX_PACKET_SIZE] __aligned(ARCH_KMALLOC_MINALIGN); }; static int elants_i2c_send(struct i2c_client *client,