HID: intel-ish-hid: handler multiple MNG_RESET_NOTIFY messages
authorZhang Lixu <lixu.zhang@intel.com>
Mon, 6 May 2024 01:30:40 +0000 (09:30 +0800)
committerJiri Kosina <jkosina@suse.com>
Mon, 6 May 2024 21:33:54 +0000 (23:33 +0200)
commit25247cf689db28a9a7bc7efd4efc7441f763a74a
treeb016ac47ea7183b2e24a6835799a9cac79664538
parent579a267e4617d705f6c795e5e755b01f1f87eff3
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 <lixu.zhang@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/intel-ish-hid/ipc/ipc.c