From patchwork Wed Apr 1 16:17:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 228285 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5588C2D0F2 for ; Wed, 1 Apr 2020 16:56:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B43C20714 for ; Wed, 1 Apr 2020 16:56:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585760184; bh=Exro3RBVTcuX8IyxCG+436aDA/mC5fv5PCGXfpK/dw8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=wJtlgrtYGUcZSP0bwGxFwJz9keNfBu/gAg3Jb43OxrFl8sOWHsOixgwhMITd775SX bD6NlzeqCJwCVRixmryv0JvWFPqci/b5J8/StGZhyFsOcULcYwkJbinZEFUomjiJDx mnVQhxxsHkHbmoKRAqg1ktUv2nUes2VuCK+af4jA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387603AbgDAQ4T (ORCPT ); Wed, 1 Apr 2020 12:56:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:44786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387403AbgDAQVt (ORCPT ); Wed, 1 Apr 2020 12:21:49 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 010AB212CC; Wed, 1 Apr 2020 16:21:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585758109; bh=Exro3RBVTcuX8IyxCG+436aDA/mC5fv5PCGXfpK/dw8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YFWjfTvTVkBax6iogs5KOfuAtkdbLAAMNRo+5Gvxkm8tIvvI/sj3M5ao8U3NqLN0s wuh8sd0wb0tLM+qppMU0YxuI7A6gcg/a/Qh4knT+FiIQE6qudq0+gdW+YwnbNcnWaa nK1GWGRYp/30D9lCepjJErbylF/infmNxGinrZ5o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Leonard Crestez , Stephen Boyd Subject: [PATCH 5.4 15/27] clk: imx: Align imx sc clock msg structs to 4 Date: Wed, 1 Apr 2020 18:17:43 +0200 Message-Id: <20200401161427.336194111@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200401161414.352722470@linuxfoundation.org> References: <20200401161414.352722470@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Leonard Crestez commit a0ae04a25650fd51b7106e742d27333e502173c6 upstream. 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: fe37b4820417 ("clk: imx: add scu clock common part") Signed-off-by: Leonard Crestez Link: https://lkml.kernel.org/r/10e97a04980d933b2cfecb6b124bf9046b6e4f16.1582216144.git.leonard.crestez@nxp.com Signed-off-by: Stephen Boyd Signed-off-by: Greg Kroah-Hartman --- drivers/clk/imx/clk-scu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/clk/imx/clk-scu.c +++ b/drivers/clk/imx/clk-scu.c @@ -43,12 +43,12 @@ struct imx_sc_msg_req_set_clock_rate { __le32 rate; __le16 resource; u8 clk; -} __packed; +} __packed __aligned(4); struct req_get_clock_rate { __le16 resource; u8 clk; -} __packed; +} __packed __aligned(4); struct resp_get_clock_rate { __le32 rate; @@ -121,7 +121,7 @@ struct imx_sc_msg_req_clock_enable { u8 clk; u8 enable; u8 autog; -} __packed; +} __packed __aligned(4); static inline struct clk_scu *to_clk_scu(struct clk_hw *hw) {