On Mon, Oct 16, 2023 at 11:01:13AM -0600, Jeffrey Hugo wrote:
> From: Ajit Pal Singh <[email protected]>
>
> Device and Host have a time synchronization mechanism that happens once
> during boot when device is in SBL mode. After that, in mission-mode there
> is no timesync. In an experiment after continuous operation, device time
> drifted w.r.t. host by approximately 3 seconds per day. This drift leads
> to mismatch in timestamp of device and Host logs. To correct this
> implement periodic timesync in driver. This timesync is carried out via
> QAIC_TIMESYNC_PERIODIC MHI channel.
>
> Signed-off-by: Ajit Pal Singh <[email protected]>
> Signed-off-by: Pranjal Ramajor Asha Kanojiya <[email protected]>
> Reviewed-by: Jeffrey Hugo <[email protected]>
> Reviewed-by: Carl Vanderlip <[email protected]>
> Reviewed-by: Pranjal Ramajor Asha Kanojiya <[email protected]>
> Signed-off-by: Jeffrey Hugo <[email protected]>
Reviewed-by: Stanislaw Gruszka <[email protected]>
> @@ -586,8 +587,16 @@ static int __init qaic_init(void)
> goto free_pci;
> }
>
> + ret = qaic_timesync_init();
> + if (ret) {
> + pr_debug("qaic: qaic_timesync_init failed %d\n", ret);
> + goto free_mhi;
I would print at error level here. Or if timesync is optional do not error
exit.
> +#ifdef readq
> +static u64 read_qtimer(const volatile void __iomem *addr)
> +{
> + return readq(addr);
> +}
> +#else
> +static u64 read_qtimer(const volatile void __iomem *addr)
> +{
> + u64 low, high;
> +
> + low = readl(addr);
> + high = readl(addr + sizeof(u32));
> + return low | (high << 32);
> +}
If that's only for compile on 32-bit PowerPC, I think would be better
to limit supported architectures on Kconfig.
Regards
Stanislaw