Skip to content

Commit 25247cf

Browse files
lixuzhaJiri Kosina
authored andcommitted
HID: intel-ish-hid: handler multiple MNG_RESET_NOTIFY messages
This patch enhances the firmware reset handler in the Intel Integrated Sensor Hub (ISH) driver. Previously, the ISH firmware would send a MNG_RESET_NOTIFY message in response to an empty IPC message from the ish_wakeup function. With the introduction of the feature to load ISH firmware from the host on the LunarLake platform, the ISH bootloader now involves the IPC function. This results in an additional MNG_RESET_NOTIFY message being sent by ISH bootloader after power on. Consequently, the driver receives two MNG_RESET_NOTIFY messages during system boot up. This can disrupt the dev->dev_state during the first reset flow due to the subsequent reset notify message. To address this, the patch modifies the fw_reset_work_fn function to skip the execution of ishtp_reset_compl_handler during the first reset flow if a reset is pending. The ishtp_reset_compl_handler will then be executed during the second reset flow, ensuring the dev->dev_state is not disrupted. Signed-off-by: Zhang Lixu <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 579a267 commit 25247cf

File tree

1 file changed

+4
-3
lines changed
  • drivers/hid/intel-ish-hid/ipc

1 file changed

+4
-3
lines changed

drivers/hid/intel-ish-hid/ipc/ipc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,11 @@ static int ish_fw_reset_handler(struct ishtp_device *dev)
546546

547547
/**
548548
* fw_reset_work_fn() - FW reset worker function
549-
* @unused: not used
549+
* @work: Work item
550550
*
551551
* Call ish_fw_reset_handler to complete FW reset
552552
*/
553-
static void fw_reset_work_fn(struct work_struct *unused)
553+
static void fw_reset_work_fn(struct work_struct *work)
554554
{
555555
int rv;
556556

@@ -562,7 +562,8 @@ static void fw_reset_work_fn(struct work_struct *unused)
562562
wake_up_interruptible(&ishtp_dev->wait_hw_ready);
563563

564564
/* ISHTP notification in IPC_RESET sequence completion */
565-
ishtp_reset_compl_handler(ishtp_dev);
565+
if (!work_pending(work))
566+
ishtp_reset_compl_handler(ishtp_dev);
566567
} else
567568
dev_err(ishtp_dev->devc, "[ishtp-ish]: FW reset failed (%d)\n",
568569
rv);

0 commit comments

Comments
 (0)