aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/hpet.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/hpet.c')
-rw-r--r--arch/x86/kernel/hpet.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 31e9191b7e19..01005aeda7d9 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -126,6 +126,24 @@ EXPORT_SYMBOL_GPL(is_hpet_enabled);
126 * timer 0 and timer 1 in case of RTC emulation. 126 * timer 0 and timer 1 in case of RTC emulation.
127 */ 127 */
128#ifdef CONFIG_HPET 128#ifdef CONFIG_HPET
129static void hpet_reserve_msi_timers(struct hpet_data *hd)
130{
131 int i;
132
133 if (!hpet_devs)
134 return;
135
136 for (i = 0; i < hpet_num_timers; i++) {
137 struct hpet_dev *hdev = &hpet_devs[i];
138
139 if (!(hdev->flags & HPET_DEV_VALID))
140 continue;
141
142 hd->hd_irq[hdev->num] = hdev->irq;
143 hpet_reserve_timer(hd, hdev->num);
144 }
145}
146
129static void hpet_reserve_platform_timers(unsigned long id) 147static void hpet_reserve_platform_timers(unsigned long id)
130{ 148{
131 struct hpet __iomem *hpet = hpet_virt_address; 149 struct hpet __iomem *hpet = hpet_virt_address;
@@ -158,15 +176,7 @@ static void hpet_reserve_platform_timers(unsigned long id)
158 Tn_INT_ROUTE_CNF_MASK) >> Tn_INT_ROUTE_CNF_SHIFT; 176 Tn_INT_ROUTE_CNF_MASK) >> Tn_INT_ROUTE_CNF_SHIFT;
159 } 177 }
160 178
161 for (i = 0; i < nrtimers; i++) { 179 hpet_reserve_msi_timers(&hd);
162 struct hpet_dev *hdev = &hpet_devs[i];
163
164 if (!(hdev->flags & HPET_DEV_VALID))
165 continue;
166
167 hd.hd_irq[hdev->num] = hdev->irq;
168 hpet_reserve_timer(&hd, hdev->num);
169 }
170 180
171 hpet_alloc(&hd); 181 hpet_alloc(&hd);
172 182