• Bean Huo's avatar
    scsi: ufs: core: Add UFS RTC support · 6bf999e0
    Bean Huo authored
    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: default avatarBean Huo <beanhuo@micron.com>
    Signed-off-by: default avatarMike Bi <mikebi@micron.com>
    Signed-off-by: default avatarLuca Porzio <lporzio@micron.com>
    Link: https://lore.kernel.org/r/20231212220825.85255-3-beanhuo@iokpp.deAcked-by: default avatarAvri Altman <avri.altman@wdc.com>
    Reviewed-by: default avatarThomas Weißschuh <linux@weissschuh.net>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    6bf999e0
ufs.h 18.2 KB