From patchwork Mon Jul 12 06:11:40 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: 472978 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2683793jao; Mon, 12 Jul 2021 00:24:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeFidKGcba3yBLhY/kQzgJ3jLjhS/QNA3x1zp3JHm+4wqWdziDlH7Q6KUovObY3otkzFI3 X-Received: by 2002:a05:6402:268f:: with SMTP id w15mr47435890edd.206.1626074677909; Mon, 12 Jul 2021 00:24:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626074677; cv=none; d=google.com; s=arc-20160816; b=cHySq9dpS7LKH0ueVYYINMXLdu9NprgM9O+7D1c1A4RJf/t0EEo57r/+abZFoyRs8o EmW5BxjOeYwv6bX6ZqCpu4A/SQustDEGNxTmuIuf07Gz1+IieK2meJIAhKcUjaxjdvzj yPoF5tpxVgdh6W8jfCGJEtmz5MmhhPtjJ9OsMoB5fdcVrQvNge1q1/S13RK5qsIRZdJO QpM9RWmwfbq3TtJltoPLxZNt8Hzu6FsI2DnQ/v0GaWOnD8VWAoV6Q2WV8WWGVaJlFNJn u7Qyer52OHdQcO2wQeuNBDu8l4P6a4CKGryZ4WLQu1YUFtaNm32E3sYbJs90PFEEKIj8 4FJw== 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=JTA00UbyM/gCa4q0F+x2EiSZr7UNGjq9Es2GalOmVTg=; b=kEjMaXM9aGcpZZRyysGNfSplYYsT8tmir75SM3ejr9tpyPyKIOFgPNLx+DQDky2B9r pnlzetj+uJ0IH+fN265roRCTfERNLeLxfy1czBRZE+0fvHkNv9lCMnc/7CORmEEnd6NK MB47/oRkNvq4AtlCq5QTKtYQHA8iNNDPI7gjhpyKTtfPW9Ep/32Qg4HqLY6e58kyzCFn E+ane857Al/pVIlw8ulZi1gxHeHDqexb+cBBJ0sovB9AjtwlUX3e1HBfCzAMW7Vi7GhK WHWpE+Ze4CzIcWCJyyvcg9eMOID2E2fKp2+lzaACJw0X9A6FwGnQcjrb1tEBM0ljrWcz cuxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tEZNmnHG; 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 d9si16909677edq.169.2021.07.12.00.24.37; Mon, 12 Jul 2021 00:24:37 -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=tEZNmnHG; 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 S245580AbhGLH1P (ORCPT + 12 others); Mon, 12 Jul 2021 03:27:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:36830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345383AbhGLHZZ (ORCPT ); Mon, 12 Jul 2021 03:25:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7E9296052B; Mon, 12 Jul 2021 07:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626074556; bh=jRKv6eYizbrlcsTnp5IQn5e22UGVdEp1u8WKoEe1Yw0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tEZNmnHGUNcYroavZnm8ej0uM7SCwelCKAXE6WjoEBzM/jsA3O20e3NT5Unyc76oY t5dXZyxretvztHlplzyt6dIYWVQjiFvdQH4q+V3OXZF9hgHRaUP2ZmJTu+uJskMdc2 HAKsYG5l94Uwsjt/Pwm2MnQbgza3016SMsif1HwU= 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.12 617/700] iio: magn: rm3100: Fix alignment of buffer in iio_push_to_buffers_with_timestamp() Date: Mon, 12 Jul 2021 08:11:40 +0200 Message-Id: <20210712061041.513525795@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060924.797321836@linuxfoundation.org> References: <20210712060924.797321836@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 7242897a05e9..720234a91db1 100644 --- a/drivers/iio/magnetometer/rm3100-core.c +++ b/drivers/iio/magnetometer/rm3100-core.c @@ -78,7 +78,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; /*