From patchwork Thu Feb 20 16:29:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 11394583 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7717C159A for ; Thu, 20 Feb 2020 16:32:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 556F7206F4 for ; Thu, 20 Feb 2020 16:32:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gl+PPvo4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 556F7206F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=yYKYkhjd6e5Oz/bJ1JxWjGD0QoyZVX6yI0WI50zm2AM=; b=gl+PPvo4bG0jIgAtQV0eVlqAUk Xx+oXXHXrL8hFy+pRW2LFBIoYtge4pYhme2Bw29ua0Npy7NtmEAxJY2CL34czYEHQ/R3V8TMYNdLN RD+qRpG9Qe4pzKSWkisbdQSHgv8oUVOObC1o0cMO5yHNVvXnC5fFSWNxm+PbfwyESf2qyiasn8GBP y+R28PNWiwND7r9KNpuuzne8KlfxF3dz8tVJuDD1ARc/cIPiuPZgTUIE27ngwz0jE0SnjdTh+S3fJ G1hq2PpC0fT2wv55z9uV97dx+Zv+StXNReF2zaXk273SoVFKA2iHd5uqOBbk4FmnAZtfNfjIopzUe qBXnrqUw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j4okS-00019I-5R; Thu, 20 Feb 2020 16:32:24 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j4oi1-0005yR-Bm for linux-arm-kernel@lists.infradead.org; Thu, 20 Feb 2020 16:29:55 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 05B50201078; Thu, 20 Feb 2020 17:29:52 +0100 (CET) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id EAFE1200BC7; Thu, 20 Feb 2020 17:29:51 +0100 (CET) Received: from fsr-ub1864-112.ea.freescale.net (fsr-ub1864-112.ea.freescale.net [10.171.82.98]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id CBACC20328; Thu, 20 Feb 2020 17:29:50 +0100 (CET) From: Leonard Crestez To: Shawn Guo , Dong Aisheng Subject: [PATCH v2 7/8] rtc: imx-sc: Align imx sc msg structs to 4 Date: Thu, 20 Feb 2020 18:29:38 +0200 Message-Id: <13404bac8360852d86c61fad5ae5f0c91ffc4cb6.1582216144.git.leonard.crestez@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200220_082953_568869_5B2F59EB X-CRM114-Status: GOOD ( 10.47 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [92.121.34.21 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rtc@vger.kernel.org, Alessandro Zummo , Alexandre Belloni , Abel Vesa , Anson Huang , Stephen Boyd , Michael Turquette , Stefan Agner , linux-clk@vger.kernel.org, Franck LENORMAND , linux-gpio@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, Fabio Estevam , Linus Walleij , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The imx SC api strongly assumes that messages are composed out of 4-bytes words but some of our message structs have odd sizeofs. This produces many oopses with CONFIG_KASAN=y. Fix by marking with __aligned(4). Fixes: a3094fc1a15e ("rtc: imx-sc: add rtc alarm support") Signed-off-by: Leonard Crestez Acked-by: Alexandre Belloni --- drivers/rtc/rtc-imx-sc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-imx-sc.c b/drivers/rtc/rtc-imx-sc.c index cf2c12107f2b..a5f59e6f862e 100644 --- a/drivers/rtc/rtc-imx-sc.c +++ b/drivers/rtc/rtc-imx-sc.c @@ -35,11 +35,11 @@ struct imx_sc_msg_timer_rtc_set_alarm { u8 mon; u8 day; u8 hour; u8 min; u8 sec; -} __packed; +} __packed __aligned(4); static int imx_sc_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct imx_sc_msg_timer_get_rtc_time msg; struct imx_sc_rpc_msg *hdr = &msg.hdr;