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: <venkatesh.pallipadi@...>, <bob.picco@...>, <mingo@...>, <tglx@...>, <linux-kernel@...>
Date: Tuesday, May 20, 2008 - 5:03 am

On Mon, 2008-05-19 at 18:10 +0200, Clemens Ladisch wrote:

Ok, added.


We can simply skip these special IRQ. :-)
Does anyone has a better solution?

----
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index 0fdc627..b04a15d 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -390,6 +390,11 @@ static int hpet_timer_get_irq(struct hpet_dev *devp)
 	struct hpets *hpetp;
 	unsigned long cap, irq_flags;
 	int irq;
+	/*
+	 * skip IRQ0, IRQ2, IRQ8 because which is always used by some
+	 * legacy device
+	 */
+	unsigned long skip_irq = (1 << 0) | (1 << 2) | (1 << 8);
 
 	timer = devp->hd_timer;
 	hpet = devp->hd_hpet;
@@ -411,6 +416,9 @@ static int hpet_timer_get_irq(struct hpet_dev *devp)
 
 	cap = (readq(&timer->hpet_config) & Tn_INT_ROUTE_CAP_MASK)
 				 >> Tn_INT_ROUTE_CAP_SHIFT;
+	cap &= ~skip_irq;
+
+	irq_flags |= IRQF_PROBE_SHARED;
 
 	for (irq = find_first_bit(&cap, HPET_MAX_IRQ); irq < HPET_MAX_IRQ;
 		irq = find_next_bit(&cap, HPET_MAX_IRQ, 1 + irq)) {

---
Best Regards,
Kevin

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