Patch "firmware: arm_scmi: imx: Correct tx size of scmi_imx_misc_ctrl_set" has been added to the 6.13-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    firmware: arm_scmi: imx: Correct tx size of scmi_imx_misc_ctrl_set

to the 6.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     firmware-arm_scmi-imx-correct-tx-size-of-scmi_imx_mi.patch
and it can be found in the queue-6.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit f061b6c1e2c56206aa363260014f53d2e0c5d13e
Author: Peng Fan <peng.fan@xxxxxxx>
Date:   Thu Jan 23 14:34:41 2025 +0800

    firmware: arm_scmi: imx: Correct tx size of scmi_imx_misc_ctrl_set
    
    [ Upstream commit ab027c488fc4a1fff0a5b712d4bdb2d2d324e8f8 ]
    
    'struct scmi_imx_misc_ctrl_set_in' has a zero length array in the end,
    The sizeof will not count 'value[]', and hence Tx size will be smaller
    than actual size for Tx,and SCMI firmware will flag this as protocol
    error.
    
    Fix this by enlarge the Tx size with 'num * sizeof(__le32)' to count in
    the size of data.
    
    Fixes: 61c9f03e22fc ("firmware: arm_scmi: Add initial support for i.MX MISC protocol")
    Reviewed-by: Jacky Bai <ping.bai@xxxxxxx>
    Tested-by: Shengjiu Wang <shengjiu.wang@xxxxxxx>
    Acked-by: Jason Liu <jason.hui.liu@xxxxxxx>
    Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
    Message-Id: <20250123063441.392555-1-peng.fan@xxxxxxxxxxx>
    (sudeep.holla: Commit rewording and replace hardcoded sizeof(__le32) value)
    Signed-off-by: Sudeep Holla <sudeep.holla@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
index a86ab9b35953f..2641faa329cdd 100644
--- a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
+++ b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
@@ -254,8 +254,8 @@ static int scmi_imx_misc_ctrl_set(const struct scmi_protocol_handle *ph,
 	if (num > max_num)
 		return -EINVAL;
 
-	ret = ph->xops->xfer_get_init(ph, SCMI_IMX_MISC_CTRL_SET, sizeof(*in),
-				      0, &t);
+	ret = ph->xops->xfer_get_init(ph, SCMI_IMX_MISC_CTRL_SET,
+				      sizeof(*in) + num * sizeof(__le32), 0, &t);
 	if (ret)
 		return ret;
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux