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

Configure Feed

Select the types of activity you want to include in your feed.

mei: bus-fixup: set timeout for MKHI send operations

Set a timeout for MKHI client send operations in the bus fixup routines
to prevent potential lock-ups on the cl_bus_lock mutex.
In rare conditions, such as when the i915 or Xe driver is stopping and
not routing interrupts or when GSC FW is in unexpectedly reset the fixup
routines can get stuck.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20240615063159.1460290-1-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Alexander Usyskin and committed by
Greg Kroah-Hartman
783100f6 c4681b2b

+5 -3
+5 -3
drivers/misc/mei/bus-fixup.c
··· 80 80 cldev->do_match = 1; 81 81 } 82 82 83 + #define MKHI_SEND_MAX_TIMEOUT_MSEC 4000 84 + 83 85 #define OSTYPE_LINUX 2 84 86 struct mei_os_ver { 85 87 __le16 build; ··· 130 128 os_ver = (struct mei_os_ver *)fwcaps->data; 131 129 os_ver->os_type = OSTYPE_LINUX; 132 130 133 - return __mei_cl_send(cldev->cl, buf, size, 0, mode); 131 + return __mei_cl_send_timeout(cldev->cl, buf, size, 0, mode, MKHI_SEND_MAX_TIMEOUT_MSEC); 134 132 } 135 133 136 134 #define MKHI_FWVER_BUF_LEN (sizeof(struct mkhi_msg_hdr) + \ ··· 150 148 req.hdr.group_id = MKHI_GEN_GROUP_ID; 151 149 req.hdr.command = MKHI_GEN_GET_FW_VERSION_CMD; 152 150 153 - ret = __mei_cl_send(cldev->cl, (u8 *)&req, sizeof(req), 0, 154 - MEI_CL_IO_TX_BLOCKING); 151 + ret = __mei_cl_send_timeout(cldev->cl, (u8 *)&req, sizeof(req), 0, 152 + MEI_CL_IO_TX_BLOCKING, MKHI_SEND_MAX_TIMEOUT_MSEC); 155 153 if (ret < 0) { 156 154 dev_info(&cldev->dev, "Could not send ReqFWVersion cmd ret = %d\n", ret); 157 155 return ret;