From patchwork Mon Jul 12 06:11:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 472861 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2648023jao; Sun, 11 Jul 2021 23:30:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwN0Kf9WgRDJlLIuL9gUuDVPTHYRj6hBilsigRIm7JuqJDFtkiW8NLJEZ7/UiyWpk/dKt2V X-Received: by 2002:a05:6402:895:: with SMTP id e21mr10554572edy.9.1626071407122; Sun, 11 Jul 2021 23:30:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626071407; cv=none; d=google.com; s=arc-20160816; b=eQ4MVGbcx1qA9DADy51EY4oepSDaSK4iXvW65n3MUDTE/+iAHG05tvKpjYGkc/iL2H 8CYXDgpiBEgPKiDTr8vg1q/Vsjle9BObHU2gws2uyOXBpBDd5bOFefcS1KkUnA5BPeRG 9hM7dbnTTtUnm4ulgZhj/JY0lto/xE+USepi8hAcQQGV3jdMQ4U+En+hMn8mXf1Hyqdp qdoXmxgt/vOp77u8+Zduoiv7yvPnpiWVsFuYWQDHmBUJk9JTYoLTOCan2VLQ1oIDAIBd F/BNs4UtBWJFtdcydiqidDv3UtebdbeyfsHHvMd9uqIKskKmxhIb7x4HCQnJMAWsYE1m fEmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SxIkf8ajEk4lVO0HfMmXZJIyqEmKWbug6saCJ/kBcbs=; b=MIeTRzJ0vDj6oJzdhm+gOBOH8MsJq1RcMsv/wIPDHEQz+a8fSjcoXbjVn06ALHvpF9 k91cYzwWYMYaERS03yUA/k9Zyui1Dy6sBMEetpY2yy6ak+nU8YIYJwV5gW2R24ewFYEi AzsF5qJJrDr5q0COrMr5OuBpGNQbMFbOb52x6INMBOVXweH9rHirORPTvrRz6GS280j+ Ikk3rylytszw9qFOTAM5Rhx0+jhtRUMxDECQ/wxywR+4oskc66WDIQBmKylWyDTvwACX zyB2WtPZcATfqFsMwAYEc6ZtYWrWkSQ+HQ5ovlWosvBf4VUOcV4K7al3a4SYXpRpZJyG CPzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FviBlwWi; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bz6si16420285ejc.610.2021.07.11.23.30.06; Sun, 11 Jul 2021 23:30:07 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FviBlwWi; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235704AbhGLGco (ORCPT + 12 others); Mon, 12 Jul 2021 02:32:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:46882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235973AbhGLG3k (ORCPT ); Mon, 12 Jul 2021 02:29:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 60FA161221; Mon, 12 Jul 2021 06:26:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626071188; bh=qjYi6dlzdwkeUyJMDizN4xGrxDGiQNChSWKqxAa0i80=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FviBlwWilkgblpuO73Ag8W9nIKNFAUePycWs71CJ/KJR1oZ2CWJ/xQfQVNJ2oTWqC hBzOPen2UMDl/JzGf78Ddno+cVXeE82THGEFSWPlT0bGt8So+dAcfxOHD4JARhRrJk sEBemJAyxdzHb6BRNEmk81jl2+xEmYv7JIGbhulU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Cameron , Song Qiang , =?utf-8?q?Nuno_S=C3=A1?= , Sasha Levin Subject: [PATCH 5.4 313/348] iio: magn: rm3100: Fix alignment of buffer in iio_push_to_buffers_with_timestamp() Date: Mon, 12 Jul 2021 08:11:37 +0200 Message-Id: <20210712060745.445343473@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060659.886176320@linuxfoundation.org> References: <20210712060659.886176320@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jonathan Cameron [ Upstream commit b8f939fd20690623cb24845a563e7bc1e4a21482 ] Add __aligned(8) to ensure the buffer passed to iio_push_to_buffers_with_timestamp() is suitable for the naturally aligned timestamp that will be inserted. Here an explicit structure is not used, because this buffer is used in a non-trivial way for data repacking. Fixes: 121354b2eceb ("iio: magnetometer: Add driver support for PNI RM3100") Signed-off-by: Jonathan Cameron Cc: Song Qiang Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20210613152301.571002-6-jic23@kernel.org Signed-off-by: Sasha Levin --- drivers/iio/magnetometer/rm3100-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.30.2 diff --git a/drivers/iio/magnetometer/rm3100-core.c b/drivers/iio/magnetometer/rm3100-core.c index 7c20918d8108..f31ff225fe61 100644 --- a/drivers/iio/magnetometer/rm3100-core.c +++ b/drivers/iio/magnetometer/rm3100-core.c @@ -76,7 +76,8 @@ struct rm3100_data { bool use_interrupt; int conversion_time; int scale; - u8 buffer[RM3100_SCAN_BYTES]; + /* Ensure naturally aligned timestamp */ + u8 buffer[RM3100_SCAN_BYTES] __aligned(8); struct iio_trigger *drdy_trig; /*