From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 589441DED78; Wed, 19 Mar 2025 14:39:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742395191; cv=none; b=sAmZTAXNrDyu7PtcBJoGPv+A4l/GblcbUbjYK9LwNy3iaha0jmHh16X38eX9ApnIfKbZsV9h3jpfUANXoXe7cgexS3XwD3csLGg7vrueBY0OhOy6qTG8gmDsK2hXIM38n3CZaYFz77Lv5EPE88fAqVgAu6eetuKwT3h8rxHiUhA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742395191; c=relaxed/simple; bh=cIkJ1w26nw36SmV5TeZViUpy1X2ihNpk8RSAlPXBZ2Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mWZwM+8T/0sWgrZuaLLkukV63LTZtPKT4dU4WeuCr52X6Vlu5Khjpjt5WFLfHyiPGZMDRnff+HOclhL8N8OOlLGDqyO6IzmTBb8mhAW5Cq9rLDm+Rl+g/R+aExjumxQPOP3QhABu+m3xkeHS5KYIL4lHGSoiaJrYXOGyvhibihs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wfU5eWjl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wfU5eWjl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E003C4CEE4; Wed, 19 Mar 2025 14:39:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1742395191; bh=cIkJ1w26nw36SmV5TeZViUpy1X2ihNpk8RSAlPXBZ2Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wfU5eWjlbVJjdrvtvc0Ahv3ho8TyFdAOL+FMXns4sW6a1SxqawfBWZqfxzB1xI2m3 g4FP2kOIpn5Q6WxgHFMYuRvLpSwNGWoIRrodT/koqXQym20jY5mbj/nbNPYXr6uPWP +9nKFpkqemkdc44dZEGxvDhw5IVXiPkZw3F5cZ+U= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zhang Lixu , Srinivas Pandruvada , Jiri Kosina , Sasha Levin Subject: [PATCH 6.6 050/166] HID: intel-ish-hid: fix the length of MNG_SYNC_FW_CLOCK in doorbell Date: Wed, 19 Mar 2025 07:30:21 -0700 Message-ID: <20250319143021.347422871@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250319143019.983527953@linuxfoundation.org> References: <20250319143019.983527953@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhang Lixu [ Upstream commit 4b54ae69197b9f416baa0fceadff7e89075f8454 ] 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 Acked-by: Srinivas Pandruvada Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/intel-ish-hid/ipc/ipc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hid/intel-ish-hid/ipc/ipc.c b/drivers/hid/intel-ish-hid/ipc/ipc.c index dd5fc60874ba1..b1a41c90c5741 100644 --- a/drivers/hid/intel-ish-hid/ipc/ipc.c +++ b/drivers/hid/intel-ish-hid/ipc/ipc.c @@ -577,14 +577,14 @@ static void fw_reset_work_fn(struct work_struct *unused) static void _ish_sync_fw_clock(struct ishtp_device *dev) { static unsigned long prev_sync; - uint64_t usec; + struct ipc_time_update_msg time = {}; if (prev_sync && time_before(jiffies, prev_sync + 20 * HZ)) return; prev_sync = jiffies; - usec = ktime_to_us(ktime_get_boottime()); - ipc_send_mng_msg(dev, MNG_SYNC_FW_CLOCK, &usec, sizeof(uint64_t)); + /* The fields of time would be updated while sending message */ + ipc_send_mng_msg(dev, MNG_SYNC_FW_CLOCK, &time, sizeof(time)); } /** -- 2.39.5