Skip to content

Commit a0ae04a

Browse files
cdleonardbebarino
authored andcommitted
clk: imx: Align imx sc clock msg structs to 4
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: fe37b48 ("clk: imx: add scu clock common part") Signed-off-by: Leonard Crestez <[email protected]> Link: https://lkml.kernel.org/r/10e97a04980d933b2cfecb6b124bf9046b6e4f16.1582216144.git.leonard.crestez@nxp.com Signed-off-by: Stephen Boyd <[email protected]>
1 parent 4e93430 commit a0ae04a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/clk/imx/clk-scu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ struct imx_sc_msg_req_set_clock_rate {
4343
__le32 rate;
4444
__le16 resource;
4545
u8 clk;
46-
} __packed;
46+
} __packed __aligned(4);
4747

4848
struct req_get_clock_rate {
4949
__le16 resource;
5050
u8 clk;
51-
} __packed;
51+
} __packed __aligned(4);
5252

5353
struct resp_get_clock_rate {
5454
__le32 rate;
@@ -121,7 +121,7 @@ struct imx_sc_msg_req_clock_enable {
121121
u8 clk;
122122
u8 enable;
123123
u8 autog;
124-
} __packed;
124+
} __packed __aligned(4);
125125

126126
static inline struct clk_scu *to_clk_scu(struct clk_hw *hw)
127127
{

0 commit comments

Comments
 (0)