Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1817300ybf; Sun, 1 Mar 2020 18:57:58 -0800 (PST) X-Google-Smtp-Source: APXvYqwufxtUEzbn8OgiYdUP8FM031GOqpyKBxcr7RuIeGuz+GaehTuMid372D5vgeGkzk7+1DIR X-Received: by 2002:aca:cf94:: with SMTP id f142mr9938438oig.31.1583117878863; Sun, 01 Mar 2020 18:57:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583117878; cv=none; d=google.com; s=arc-20160816; b=GL2g9BRXavaNmx+KqVLcyXV8gQ9/824gVb/JlR86O6TYFl5TSSkMssDmcCXol5C4SC J0Gv3QechqjgN992duHVKXrF0xWuLYCp9KEQJjOXlGnXNdZrx5r5gpUp6LRZz62oWGVa ef8xTH5ZdKEgAoIIgo6lO6K4MskLOOSVJOTyp8CfnqxecQlIdbkNDk6Mgdl559yojFTa u1mhl2SqyEbBL99OL3iZzxdzIk6NjA5Hxnjc2/M+OZi9ZVPVtrAzxZHZxK4NWfUVD69H BjLiPHUOlc25TKHfH9Thkgdscy+iF8UOpAXX0fICBqrT0O9T8pX6nUQsB7NDzQ5qlXY8 IS6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=NT4OSqt2ml/UoWnaWfSJ1H6w6O9TYZaVEk7fHOl0mdQ=; b=gJWGjbDq5CdqhD9Zl1eYnlboerxA7TuiXiPBoN1gOqc3uruz4Dt+K1CxZKEjqPlQBx DOYrlgagiP6raUvFrcu1MBGOmKQ7RJS1MghAGj40m0IGj+522948yUKl7M247NlRikqk QocZY/9x5+phxBB/FmWtOOdiCebKMEA9pftB9KjWpFNAy067Lp1kUHcnT5Bx9rYbuYSW 7ifGIZXDcg5bjpwd9GqF29HE/1F6FAduR2iIyEtQWLZeAK/mQeU2QuNFO+ZOVqV4Oln4 JVhfrwpi3HzLbKsVzfhe0ZJ9KpNlGTMcRoUff6O7nlDy/SB4OSG71fpAUk7Ta/dOiE7j PM1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 67si5488334ott.243.2020.03.01.18.57.44; Sun, 01 Mar 2020 18:57:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726758AbgCBC5i (ORCPT + 99 others); Sun, 1 Mar 2020 21:57:38 -0500 Received: from inva021.nxp.com ([92.121.34.21]:39574 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726688AbgCBC5i (ORCPT ); Sun, 1 Mar 2020 21:57:38 -0500 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id CB877200E2A; Mon, 2 Mar 2020 03:57:36 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 1A0CF200C80; Mon, 2 Mar 2020 03:57:31 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 762004029E; Mon, 2 Mar 2020 10:57:24 +0800 (SGT) From: Anson Huang To: rui.zhang@intel.com, daniel.lezcano@linaro.org, amit.kucheria@verdurent.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH] thermal: imx_sc_thermal: Align imx sc thermal msg structs to 4 Date: Mon, 2 Mar 2020 10:51:25 +0800 Message-Id: <1583117485-30922-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The i.MX SCU API strongly assumes that messages are composed out of 4-bytes words but some of our message structs have odd sizeofs, use __packed __aligned(4) to avoid potential oopses. Signed-off-by: Anson Huang --- This patch is based on https://patchwork.kernel.org/patch/11397719/ which is accepted. --- drivers/thermal/imx_sc_thermal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/imx_sc_thermal.c b/drivers/thermal/imx_sc_thermal.c index 4955dfd..dbb277a 100644 --- a/drivers/thermal/imx_sc_thermal.c +++ b/drivers/thermal/imx_sc_thermal.c @@ -27,12 +27,12 @@ struct imx_sc_sensor { struct req_get_temp { u16 resource_id; u8 type; -} __packed; +} __packed __aligned(4); struct resp_get_temp { u16 celsius; u8 tenths; -} __packed; +} __packed __aligned(4); struct imx_sc_msg_misc_get_temp { struct imx_sc_rpc_msg hdr; @@ -40,7 +40,7 @@ struct imx_sc_msg_misc_get_temp { struct req_get_temp req; struct resp_get_temp resp; } data; -}; +} __packed __aligned(4); static int imx_sc_thermal_get_temp(void *data, int *temp) { -- 2.7.4