Patch "firmware: arm_scmi: Reset Rx buffer to max size during async commands" has been added to the 5.10-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: Reset Rx buffer to max size during async commands

to the 5.10-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-reset-rx-buffer-to-max-size-during.patch
and it can be found in the queue-5.10 subdirectory.

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



commit ac70eb379a30e35641b81d826f0eecba3b3e637f
Author: Cristian Marussi <cristian.marussi@xxxxxxx>
Date:   Tue Jun 1 11:24:17 2021 +0100

    firmware: arm_scmi: Reset Rx buffer to max size during async commands
    
    [ Upstream commit 0cb7af474e0dbb2f500c67aa62b6db9fafa74de2 ]
    
    During an async commands execution the Rx buffer length is at first set
    to max_msg_sz when the synchronous part of the command is first sent.
    However once the synchronous part completes the transport layer waits
    for the delayed response which will be processed using the same xfer
    descriptor initially allocated. Since synchronous response received at
    the end of the xfer will shrink the Rx buffer length to the effective
    payload response length, it needs to be reset again.
    
    Raise the Rx buffer length again to max_msg_sz before fetching the
    delayed response to ensure full response is read correctly from the
    shared memory.
    
    Link: https://lore.kernel.org/r/20210601102421.26581-2-cristian.marussi@xxxxxxx
    Fixes: 58ecdf03dbb9 ("firmware: arm_scmi: Add support for asynchronous commands and delayed response")
    Signed-off-by: Cristian Marussi <cristian.marussi@xxxxxxx>
    [sudeep.holla: moved reset to scmi_handle_response as it could race with
                   do_xfer_with_response]
    Signed-off-by: Sudeep Holla <sudeep.holla@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index 6b2ce3f28f7b..f9901fadb3a4 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -268,6 +268,10 @@ static void scmi_handle_response(struct scmi_chan_info *cinfo,
 		return;
 	}
 
+	/* rx.len could be shrunk in the sync do_xfer, so reset to maxsz */
+	if (msg_type == MSG_TYPE_DELAYED_RESP)
+		xfer->rx.len = info->desc->max_msg_size;
+
 	scmi_dump_header_dbg(dev, &xfer->hdr);
 
 	info->desc->ops->fetch_response(cinfo, xfer);



[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