Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

firmware: arm_scmi: Fix premature SCMI_XFER_FLAG_IS_RAW clearing in raw mode

The SCMI_XFER_FLAG_IS_RAW flag was being cleared prematurely in
scmi_xfer_raw_put() before the transfer completion was properly
acknowledged by the raw message handlers.

Move the clearing of SCMI_XFER_FLAG_IS_RAW and SCMI_XFER_FLAG_CHAN_SET
from scmi_xfer_raw_put() to __scmi_xfer_put() to ensure the flags remain
set throughout the entire raw message processing pipeline until the
transfer is returned to the free pool.

Fixes: 3095a3e25d8f ("firmware: arm_scmi: Add xfer helpers to provide raw access")
Suggested-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Artem Shimko <a.shimko.dev@gmail.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Message-Id: <20251008091057.1969260-1-a.shimko.dev@gmail.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>

authored by

Artem Shimko and committed by
Sudeep Holla
20b93a00 092b9e2c

+1 -2
+1 -2
drivers/firmware/arm_scmi/driver.c
··· 805 805 806 806 scmi_dec_count(info->dbg, XFERS_INFLIGHT); 807 807 } 808 + xfer->flags = 0; 808 809 hlist_add_head(&xfer->node, &minfo->free_xfers); 809 810 } 810 811 spin_unlock_irqrestore(&minfo->xfer_lock, flags); ··· 824 823 { 825 824 struct scmi_info *info = handle_to_scmi_info(handle); 826 825 827 - xfer->flags &= ~SCMI_XFER_FLAG_IS_RAW; 828 - xfer->flags &= ~SCMI_XFER_FLAG_CHAN_SET; 829 826 return __scmi_xfer_put(&info->tx_minfo, xfer); 830 827 } 831 828