[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-i2c
Subject:    [i2c] RTC , ds1307 I2C driver and NTP does not work.
From:       khali () linux-fr ! org (Jean Delvare)
Date:       2006-11-19 11:20:59
Message-ID: 20061119122059.e75b2ea7.khali () linux-fr ! org
[Download RAW message or body]

Hi Joakim,

On Sat, 18 Nov 2006 15:51:09 +0100, Joakim Tjernlund wrote:
> > It's OK to schedule or sleep in mpc_xfer. It's not OK to call mpc_xfer
> > from an interrupt context, which is what appears to be happening here.
> > So the ds1307 driver would need to be changed not to directly call
> > i2c_transfer from the interrupt. Using a workqueue should work.
> > 
> > That being said, I wonder why one would want to set the time from an
> > interrupt context in the first place. Maybe that's what needs fixing.
> 
> That's the way kernel NTP code always has done it. Probably to minimize
> latency, ideally you want to set the time when a new second occur since
> that's what most RTC HW expects.
> 
> Will a workqueue run directly after the one return from IRQ context?

There is no guarantee as to when the workqueue will process the request
as far as I know. The actual delay probably depends on the value of HZ.

There is no way around the delay in the case of I2C RTC chips anyway
(at least not with the current implementation), as the underlying I2C
bus driver may sleep as part of the bus transaction, and the RTC chip
driver can virtually be attached to every bus.

Note that the transaction itself will take some time anyway, I2C can be
quite slow.

-- 
Jean Delvare


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic