mailbox: Pack SCPI structures used for messages.
authorLiviu Dudau <Liviu.Dudau@arm.com>
Tue, 22 Jul 2014 17:34:54 +0000 (18:34 +0100)
committerLiviu Dudau <Liviu.Dudau@arm.com>
Tue, 22 Jul 2014 17:50:17 +0000 (18:50 +0100)
The System Control Processor expects data sent in the messages
to be contiguos. When using unpacked structures to describe
the data being transmitted we increase the general size of the
message which leads to SCP rejecting our request.

Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
drivers/mailbox/scpi_protocol.c

index 7a1ff2d..0a208bf 100644 (file)
@@ -228,7 +228,7 @@ unsigned long scpi_clk_get_val(u16 clk_id)
 {
        struct scpi_data_buf sdata;
        struct mhu_data_buf mdata;
-       struct {
+       struct __packed {
                u32 status;
                u32 clk_rate;
        } buf;
@@ -247,7 +247,7 @@ int scpi_clk_set_val(u16 clk_id, unsigned long rate)
        struct scpi_data_buf sdata;
        struct mhu_data_buf mdata;
        int stat;
-       struct {
+       struct __packed {
                u32 clk_rate;
                u16 clk_id;
        } buf;
@@ -265,7 +265,7 @@ struct scpi_opp *scpi_dvfs_get_opps(u8 domain)
 {
        struct scpi_data_buf sdata;
        struct mhu_data_buf mdata;
-       struct {
+       struct __packed {
                u32 status;
                u32 header;
                u32 freqs[MAX_DVFS_OPPS];
@@ -312,7 +312,7 @@ int scpi_dvfs_get_idx(u8 domain)
 {
        struct scpi_data_buf sdata;
        struct mhu_data_buf mdata;
-       struct {
+       struct __packed {
                u32 status;
                u8 dvfs_idx;
        } buf;
@@ -335,7 +335,7 @@ int scpi_dvfs_set_idx(u8 domain, u8 idx)
 {
        struct scpi_data_buf sdata;
        struct mhu_data_buf mdata;
-       struct {
+       struct __packed {
                u8 dvfs_domain;
                u8 dvfs_idx;
        } buf;