From: Jean Delvare <khali@linux-fr.org>
To: "Joakim Tjernlund" <joakim.tjernlund@transmode.se>
Cc: "Kumar Gala" <galak@kernel.crashing.org>,
"LKML" <linux-kernel@vger.kernel.org>,
i2c@lm-sensors.org
Subject: Re: RTC , ds1307 I2C driver and NTP does not work.
Date: Sun, 19 Nov 2006 12:20:59 +0100 [thread overview]
Message-ID: <20061119122059.e75b2ea7.khali@linux-fr.org> (raw)
In-Reply-To: <008801c70b20$fc0fee70$1e67a8c0@Jocke>
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 parent reply other threads:[~2006-11-19 11:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-17 17:38 FW: " Joakim Tjernlund
2006-11-18 4:21 ` Oleg Verych
2006-11-18 14:19 ` Jean Delvare
2006-11-18 14:51 ` Joakim Tjernlund
2006-11-19 11:20 ` Jean Delvare [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061119122059.e75b2ea7.khali@linux-fr.org \
--to=khali@linux-fr.org \
--cc=galak@kernel.crashing.org \
--cc=i2c@lm-sensors.org \
--cc=joakim.tjernlund@transmode.se \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome