[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20111208130835.GC10113@linux-mips.org>
Date: Thu, 8 Dec 2011 13:08:35 +0000
From: Ralf Baechle <ralf@...ux-mips.org>
To: zhzhl555@...il.com
Cc: a.zummo@...ertech.it, rtc-linux@...glegroups.com,
linux-mips@...ux-mips.org, linux-kernel@...r.kernel.org,
keguang.zhang@...il.com, wuzhangjin@...il.com, r0bertz@...too.org
Subject: Re: [PATCH] MIPS: Add RTC support for loongson1B
On Thu, Dec 01, 2011 at 04:44:38PM +0800, zhzhl555@...il.com wrote:
> + writel(t, SYS_TOYWRITE1);
> + __asm__ volatile ("sync");
> + c = 0x10000;
> + while ((readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_TS) && --c)
> + usleep_range(1000, 3000);
Why the SYNC instruction? This is an uncached write and on all MIPS CPUs
the SYNC instruction will only make sure the write has left the CPU's
write buffers. There is no guarantee that by the time the SYNC has completed
the write has actually reached its destination. If that is what you want,
read something from device. Reads will only complete after all preceeding
writes have completed.
In this driver all instances of SYNC instructions are followed by polling
loops reading from the RTC which means all SYNCs should be unnecessary.
Or?
Ralf
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists