From patchwork Tue May 3 08:59:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12835387 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 1CFE8C433F5 for ; Tue, 3 May 2022 09:05:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233240AbiECJJH (ORCPT ); Tue, 3 May 2022 05:09:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233302AbiECJJF (ORCPT ); Tue, 3 May 2022 05:09:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1595122BF0 for ; Tue, 3 May 2022 02:05:32 -0700 (PDT) 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 A678E61357 for ; Tue, 3 May 2022 09:05:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B36B7C385B2; Tue, 3 May 2022 09:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651568731; bh=VE/2SA4W7Q33z2InonY83WkwktFvl38di5S6fuYRKBo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EtYk1Bbm5i7wSMis7vpZVResWuDG7SIldRJKrz2zLwFrCZhg0uolct+w2GaswD59P OJRRnmgmIVPkeAdssyvdoGH0F+75wuaHmQ99R9Mcf+JJWBnPMYVuTxHQwvGGQbBXHu E201+bYPL5JOId8Dir5xdPqyByTRo6l7u1UXntzjqhML+SMpOIyfLIfLtdhM1uMhVW SQk5i7rNSJw1f4BX8+oQiN2okeDWgtGX2MzpWuCxKVR6jwkmUNYOMlX4DnCocmiS3z cpio16XxaSYSrf7oaccK7sK+Zq86Be3f25OGlDmktxUmlZIBR8wqlKZfGM/LnPLzTr 82FK7WpyJ5zsg== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Akinobu Mita , Alexandru Lazar , Alexandru Tachici , Antoniu Miclaus , Charles-Antoine Couret , Cosmin Tanislav , Cristian Pop , David Lechner , Ivan Mikhaylov , Jacopo Mondi , Jean-Baptiste Maneyrol , Lars-Peter Clausen , Marcelo Schmitt , =?utf-8?q?M=C3=A5rten_Lindahl?= , Matt Ranostay , Michael Hennerich , Michael Welling , Mugilraj Dhavachelvan , Navin Sankar Velliangiri , =?utf-8?q?Nuno_S=C3=A1?= , Paul Cercueil , Phil Reid , Puranjay Mohan , Ricardo Ribalda , Robert Jones , Rui Miguel Silva , Sean Nyekjaer , Tomas Melin , Tomislav Denis , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron Subject: [PATCH 88/92] iio: resolver: ad2s1200: Fix alignment for DMA safety Date: Tue, 3 May 2022 09:59:31 +0100 Message-Id: <20220503085935.1533814-89-jic23@kernel.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220503085935.1533814-1-jic23@kernel.org> References: <20220503085935.1533814-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron ____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_ALIGN definition. Fixes tag is probably not where the issue was first introduced, but is likely to be as far as anyone considers backporting this fix. Fixes: 0bd3d338f61b ("staging: iio: ad2s1200: Improve readability with be16_to_cpup") Signed-off-by: Jonathan Cameron --- drivers/iio/resolver/ad2s1200.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/resolver/ad2s1200.c b/drivers/iio/resolver/ad2s1200.c index 9746bd935628..c568d2990141 100644 --- a/drivers/iio/resolver/ad2s1200.c +++ b/drivers/iio/resolver/ad2s1200.c @@ -41,7 +41,7 @@ struct ad2s1200_state { struct spi_device *sdev; struct gpio_desc *sample; struct gpio_desc *rdvel; - __be16 rx ____cacheline_aligned; + __be16 rx __aligned(IIO_ALIGN); }; static int ad2s1200_read_raw(struct iio_dev *indio_dev,