Skip to content

Commit 4b54ae6

Browse files
lixuzhaJiri Kosina
authored andcommitted
HID: intel-ish-hid: fix the length of MNG_SYNC_FW_CLOCK in doorbell
The timestamps in the Firmware log and HID sensor samples are incorrect. They show 1970-01-01 because the current IPC driver only uses the first 8 bytes of bootup time when synchronizing time with the firmware. The firmware converts the bootup time to UTC time, which results in the display of 1970-01-01. In write_ipc_from_queue(), when sending the MNG_SYNC_FW_CLOCK message, the clock is updated according to the definition of ipc_time_update_msg. However, in _ish_sync_fw_clock(), the message length is specified as the size of uint64_t when building the doorbell. As a result, the firmware only receives the first 8 bytes of struct ipc_time_update_msg. This patch corrects the length in the doorbell to ensure the entire ipc_time_update_msg is sent, fixing the timestamp issue. Signed-off-by: Zhang Lixu <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent c098363 commit 4b54ae6

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -578,14 +578,14 @@ static void fw_reset_work_fn(struct work_struct *work)
578578
static void _ish_sync_fw_clock(struct ishtp_device *dev)
579579
{
580580
static unsigned long prev_sync;
581-
uint64_t usec;
581+
struct ipc_time_update_msg time = {};
582582

583583
if (prev_sync && time_before(jiffies, prev_sync + 20 * HZ))
584584
return;
585585

586586
prev_sync = jiffies;
587-
usec = ktime_to_us(ktime_get_boottime());
588-
ipc_send_mng_msg(dev, MNG_SYNC_FW_CLOCK, &usec, sizeof(uint64_t));
587+
/* The fields of time would be updated while sending message */
588+
ipc_send_mng_msg(dev, MNG_SYNC_FW_CLOCK, &time, sizeof(time));
589589
}
590590

591591
/**

0 commit comments

Comments
 (0)