Re: [PATCH] x86: Get irq for hpet timer

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Clemens Ladisch <clemens@...>
Cc: Kevin Hao <kexin.hao@...>, <venkatesh.pallipadi@...>, <bob.picco@...>, <mingo@...>, <tglx@...>, <linux-kernel@...>, Balaji Rao <balajirrao@...>
Date: Wednesday, May 21, 2008 - 11:47 pm

On Wed, 21 May 2008, Clemens Ladisch wrote:


 Edge-triggered lines are generally associated with legacy devices.  It
may not be possible to grab one without disturbing the other device.


 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) 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.

 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
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] x86: Get irq for hpet timer, Kevin Hao, (Fri May 16, 2:05 am)
Re: [PATCH] x86: Get irq for hpet timer, Clemens Ladisch, (Fri May 16, 4:46 am)
Re: [PATCH] x86: Get irq for hpet timer, Kevin Hao, (Fri May 16, 5:14 am)
Re: [PATCH] x86: Get irq for hpet timer, Clemens Ladisch, (Mon May 19, 12:10 pm)
Re: [PATCH] x86: Get irq for hpet timer, Kevin Hao, (Tue May 20, 5:03 am)
Re: [PATCH] x86: Get irq for hpet timer, Maciej W. Rozycki, (Tue May 20, 11:46 am)
Re: [PATCH] x86: Get irq for hpet timer, Clemens Ladisch, (Wed May 21, 4:28 am)
Re: [PATCH] x86: Get irq for hpet timer, Maciej W. Rozycki, (Wed May 21, 11:47 pm)
Re: [PATCH] x86: Get irq for hpet timer, Kevin Hao, (Thu May 22, 3:27 am)
Re: [PATCH] x86: Get irq for hpet timer, Maciej W. Rozycki, (Thu May 22, 11:25 am)
Re: [PATCH] x86: Get irq for hpet timer, Kevin Hao, (Wed May 28, 6:42 am)
Re: [PATCH] x86: Get irq for hpet timer, Maciej W. Rozycki, (Wed May 28, 11:13 pm)
Re: [PATCH] x86: Get irq for hpet timer, Kevin Hao, (Thu May 29, 6:41 am)
Re: [PATCH] x86: Get irq for hpet timer, Maciej W. Rozycki, (Thu May 29, 10:32 am)
Re: [PATCH] x86: Get irq for hpet timer, Kevin Hao, (Fri May 30, 1:32 am)
Re: [PATCH] x86: Get irq for hpet timer, Ingo Molnar, (Mon Jun 2, 5:35 am)
Re: [PATCH] x86: Get irq for hpet timer, Maciej W. Rozycki, (Mon May 19, 5:21 pm)
Re: [PATCH] x86: Get irq for hpet timer, Balaji Rao R, (Fri May 16, 3:53 am)
Re: [PATCH] x86: Get irq for hpet timer, Kevin Hao, (Fri May 16, 4:03 am)
Re: [PATCH] x86: Get irq for hpet timer, Balaji Rao, (Fri May 16, 4:30 am)