[rtc-linux] [PATCH v3] rtc: snvs: add Freescale rtc-snvs driver

Shawn Guo shawn.guo at linaro.org
Sat Aug 18 03:03:54 EDT 2012


On Sat, Aug 18, 2012 at 08:43:04AM +0200, Lothar Waßmann wrote:
> Hi,
> 
> Shawn Guo writes:
> > On Thu, Aug 16, 2012 at 10:08:04AM +0200, Lothar Waßmann wrote:
> > > Why not read the register once more in case of a timeout, which
> > > would guarantee to have a current view of the register contents no
> > > matter how long the process may have been descheduled before:
> > > 
> > > [...]
> > > static int snvs_rtc_enable_done(int enable, void __iomem *addr)
> > > {
> > > 	u32 lpcr = readl(addr + SNVS_LPCR);
> > > 
> > > 	return !!enable ^ !(lpcr & SNVS_LPCR_SRTC_ENV);
> > > }
> > > [...]
> > > 	while (1) {
> > > 		if (svns_rtc_enable_done(enable, data->ioaddr))
> > > 			break;
> > > 
> > > 		if (time_after(jiffies, timeout)) {
> > > 			if (!svns_rtc_enable_done(enable, data->ioaddr))
> > > 				return -ETIMEDOUT;
> > > 		}
> > > 	}
> > > 
> > I'm fine with this solution.  Can you send a formal patch for this?
> > Then we will have two incremental patches (I already sent the fixed
> > times loop one) for Andrew to choose one.
> > 
> What should I base this patch on?
> 
v3.6-rc1 with "[PATCH v3] rtc: snvs: add Freescale rtc-snvs driver"
applied.

-- 
Regards,
Shawn



More information about the linux-arm-kernel mailing list