RE: [PATCH v3 2/3] scsi: ufs: core: Add UFS RTC support

From: Avri Altman
Date: Wed Dec 06 2023 - 14:38:36 EST


> From: Bean Huo <beanhuo@xxxxxxxxxx>
>
> Add Real Time Clock (RTC) support for UFS device. This enhancement is
> crucial for the internal maintenance operations of the UFS device. The patch
> enables the device to handle both absolute and relative time information.
> Furthermore, it includes periodic task to update the RTC in accordance with
> the UFS Spec, ensuring the accuracy of RTC information for the device's
> internal processes.
>
> RTC and qTimestamp serve distinct purposes. The RTC provides a coarse
> level of granularity with, at best, approximate single-second resolution. This
> makes the RTC well-suited for the device to determine the approximate age
> of programmed blocks after being updated by the host. On the other hand,
> qTimestamp offers nanosecond granularity and is specifically designed for
> synchronizing Device Error Log entries with corresponding host-side logs.
>
> Given that the RTC has been a standard feature since UFS Spec 2.0, and
> qTimestamp was introduced in UFS Spec 4.0, the majority of UFS devices
> currently on the market rely on RTC. Therefore, it is advisable to continue
> supporting RTC in the Linux kernel. This ensures compatibility with the
> prevailing UFS device implementations and facilitates seamless integration
> with existing hardware.
> By maintaining support for RTC, we ensure broad compatibility and avoid
> potential issues arising from deviations in device specifications across
> different UFS versions.
>
> Signed-off-by: Bean Huo <beanhuo@xxxxxxxxxx>
> Signed-off-by: Mike Bi <mikebi@xxxxxxxxxx>
> Signed-off-by: Luca Porzio <lporzio@xxxxxxxxxx>
Acked-by: Avri Altman <avri.altman@xxxxxxx>