mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kevin Hao <kexin.hao@windriver.com>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: Clemens Ladisch <clemens@ladisch.de>,
	venkatesh.pallipadi@intel.com, bob.picco@hp.com,
	mingo@redhat.com, tglx@linutronix.de,
	linux-kernel@vger.kernel.org, Balaji Rao <balajirrao@gmail.com>
Subject: Re: [PATCH] x86: Get irq for hpet timer
Date: Thu, 22 May 2008 15:27:11 +0800	[thread overview]
Message-ID: <1211441231.7323.10.camel@kevin-desktop> (raw)
In-Reply-To: <Pine.LNX.4.55.0805220105560.4894@cliff.in.clinika.pl>

On Thu, 2008-05-22 at 04:47 +0100, Maciej W. Rozycki wrote:
> On Wed, 21 May 2008, Clemens Ladisch wrote:
> 
> > >  Hmm, you probably want to skip all lines that are edge-triggered.
> > > Otherwise you may have problems with sharing.
> > 
> > HPET interrupts can be either edge or level triggered.  Probably we
> > should modify it according to the type of the interrupt line we're
> > trying to grab.
> 
>  Edge-triggered lines are generally associated with legacy devices.  It
> may not be possible to grab one without disturbing the other device.
> 
> > >  This driver is quite platform-specific -- how about instead of blindly
> > > probing for interrupt lines, you actually allocate one somehow in platform
> > > code?
> > 
> > I don't have much of a clue about that "somehow", but this sound like a
> > good idea.  ;-)
> > 
> > I think hpet_reserve_platform_timers() might be the place for this.
> > 
> > It gets called from hpet_late_init(), which is a fs_initcall, so I think
> > we should be careful not to grab some unsharable interrupt that might be
> > needed by some ISA device whose driver is initialized later.
> > (This was a bug in 2.6.25-rc5: <http://bugzilla.kernel.org/show_bug.cgi?id=10382>)
> 
>  I have had a look at the relevant areas of ACPI and HPET specs and it
> looks pretty straightforward, although not all the information is recorded
> in system tables.  Essentially you are free to choose an arbitrary
> interrupt supported by the HPET -- which you can find in the timer's
> routing capability (as the proposed patch is doing).
> 
>  However you are right you really want to select one which does not
> conflict with a legacy device, so it's probably best to avoid the legacy
> range altogether (worth noting as for example the system I have handy has
> the capability of its timer #2 set to 0x00f00800 -- here IRQ11 may not be
> safe to use)

But if we avoid all the legacy range, the hpet timer will have no chance
to work on a host using legacy PIC.

>  and then you have to check how many inputs beyond the legacy
> range are supported by the I/O APICs in the system -- you can have a look
> at mp_find_ioapic() to see how obtain that information and then you can
> call mp_register_gsi() on the interrupt line selected like this to set up
> routing in the I/O APIC as necessary.  Level-triggered mode has to be used
> as the resulting interrupt entry may happen to be shared with a PCI
> interrupt.

Yes, we should setup routing in the I/O APIC and use level-triggered
mode. I think it's better to use acpi_register_gsi than mp_register_gsi.
Is that right?

Best Regards,
Kevin

> 
>  Though I have just noticed there is something wrong with the spec -- it
> says that "The interrupts are all active high." which precludes sharing,
> hmm... -- broken spec?  If hardware designers actually followed it in this
> respect (I wouldn't be surprised as for some of them software is abstract
> enough a concept not to be bothered with, and then it is a spec after
> all), then I am afraid we need to have a way to get an exclusive
> reservation of an I/O APIC line.  It could be tough with a system using
> fixed routing and reusing a legacy IRQ might be the only choice -- if
> supported by the HPET router, that is.
> 
>  Of course if the HPET supports MSI delivery and the kernel configuration
> has it enabled, then you can avoid all the hassle with finding an
> available IRQ line altogether.
> 
>   Maciej

  reply	other threads:[~2008-05-22  7:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-16  6:05 Kevin Hao
2008-05-16  7:53 ` Balaji Rao R
2008-05-16  8:03   ` Kevin Hao
2008-05-16  8:30     ` Balaji Rao
2008-05-16  8:46 ` Clemens Ladisch
2008-05-16  9:14   ` Kevin Hao
2008-05-19 16:10     ` Clemens Ladisch
2008-05-19 21:21       ` Maciej W. Rozycki
2008-05-20  9:03       ` Kevin Hao
2008-05-20 15:46         ` Maciej W. Rozycki
2008-05-21  8:28           ` Clemens Ladisch
2008-05-22  3:47             ` Maciej W. Rozycki
2008-05-22  7:27               ` Kevin Hao [this message]
2008-05-22 15:25                 ` Maciej W. Rozycki
2008-05-28 10:42                   ` Kevin Hao
2008-05-29  3:13                     ` Maciej W. Rozycki
2008-05-29 10:41                       ` Kevin Hao
2008-05-29 14:32                         ` Maciej W. Rozycki
2008-05-30  5:32                           ` Kevin Hao
2008-06-02  9:35                             ` Ingo Molnar

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=1211441231.7323.10.camel@kevin-desktop \
    --to=kexin.hao@windriver.com \
    --cc=balajirrao@gmail.com \
    --cc=bob.picco@hp.com \
    --cc=clemens@ladisch.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@linux-mips.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=venkatesh.pallipadi@intel.com \
    /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

all inboxes | Powered by JetHome®