public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Petr Vandrovec <vandrove@vc.cvut.cz>,
	torvalds@osdl.org, linux-kernel@vger.kernel.org,
	Shaohua Li <shaohua.li@intel.com>,
	Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Subject: Re: [PATCH 2.6.13-rc5-gitNOW] msleep() cannot be used from interrupt
Date: Fri, 5 Aug 2005 12:23:02 -0700	[thread overview]
Message-ID: <20050805122301.A30003@unix-os.sc.intel.com> (raw)
In-Reply-To: <20050805115329.45889ef8.akpm@osdl.org>; from akpm@osdl.org on Fri, Aug 05, 2005 at 11:53:29AM -0700

On Fri, Aug 05, 2005 at 11:53:29AM -0700, Andrew Morton wrote:
> 
> That's all pretty sad stuff.  I guess for now we can go back to the busy
> loop.  Longer-term it would be nice if we could tune up the HPET driver in
> some manner so we can avoid this busy-wait-in-interrupt.
> 
> I'm not sure who the HPET maintainer/expert is nowadays.  Robert Picco did
> the original work but I haven't seen Robert around for a long time?

Actually there are two parts in HPET. 
1) Using HPET for kernel timer and RTC emulation
2) HPET driver to export timers to user(/dev/hpet) and kernel drivers

We did the part (1) for i386 and I think Andi/Vojtech did (1) for x86_64. And 
Robert Picco did (2).

So, using rtc_get_rtc_time() in an interrupt handler will be my code. In this
part we try to emulate RTC interrupt using HPET and we have to read the current
RTC time in the interrupt handler. I can't think of any way of not doing
rtc_get_rtc_time here.

I think we should have two versions of rtc_get_rtc_time. One which does msleep,
that can be called from process context (in drivers/char/rtc.c) and one that
can be called from interrupt context (i386 and x86_64 hpet time routines). Or 
same routine behaving differently depending on where it is called from.

And for the hpet rtc emulation routines it should be OK even if the time is 
slightly off and not exact. So, probably we should be able to force read
rtc even when update is in progress. That way we can avoid the busy loop.
Unless RTC returns grossly wrong time values while UIP flag is set. I need to
look at RTC specs to verify that.

Thanks,
Venki

  reply	other threads:[~2005-08-05 19:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-05 13:50 [PATCH 2.6.13-rc5-gitNOW] msleep() cannot be used from interrupt Petr Vandrovec
2005-08-05 14:03 ` linux-os (Dick Johnson)
2005-08-05 14:39   ` Petr Vandrovec
2005-08-05 15:08     ` linux-os (Dick Johnson)
2005-08-05 18:53 ` Andrew Morton
2005-08-05 19:23   ` Venkatesh Pallipadi [this message]
2005-08-05 19:37     ` linux-os (Dick Johnson)
2005-08-05 20:38     ` Andrew Morton

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=20050805122301.A30003@unix-os.sc.intel.com \
    --to=venkatesh.pallipadi@intel.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shaohua.li@intel.com \
    --cc=torvalds@osdl.org \
    --cc=vandrove@vc.cvut.cz \
    /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