| From f18298595aefa2c836a128ec6e0f75f39965dd81 Mon Sep 17 00:00:00 2001 |
| From: Jiang Liu <jiang.liu@linux.intel.com> |
| Date: Mon, 27 Oct 2014 13:21:32 +0800 |
| Subject: x86, intel-mid: Create IRQs for APB timers and RTC timers |
| |
| From: Jiang Liu <jiang.liu@linux.intel.com> |
| |
| commit f18298595aefa2c836a128ec6e0f75f39965dd81 upstream. |
| |
| Intel MID platforms has no legacy interrupts, so no IRQ descriptors |
| preallocated. We need to call mp_map_gsi_to_irq() to create IRQ |
| descriptors for APB timers and RTC timers, otherwise it may cause |
| invalid memory access as: |
| [ 0.116839] BUG: unable to handle kernel NULL pointer dereference at |
| 0000003a |
| [ 0.123803] IP: [<c1071c0e>] setup_irq+0xf/0x4d |
| |
| Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
| Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> |
| Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> |
| Cc: Tony Luck <tony.luck@intel.com> |
| Cc: Joerg Roedel <joro@8bytes.org> |
| Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| Cc: H. Peter Anvin <hpa@linux.intel.com> |
| Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> |
| Cc: Rafael J. Wysocki <rjw@rjwysocki.net> |
| Cc: Bjorn Helgaas <bhelgaas@google.com> |
| Cc: Randy Dunlap <rdunlap@infradead.org> |
| Cc: Yinghai Lu <yinghai@kernel.org> |
| Cc: Borislav Petkov <bp@alien8.de> |
| Cc: David Cohen <david.a.cohen@linux.intel.com> |
| Link: http://lkml.kernel.org/r/1414387308-27148-3-git-send-email-jiang.liu@linux.intel.com |
| Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
| Signed-off-by: Ingo Molnar <mingo@kernel.org> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| |
| --- |
| arch/x86/kernel/apb_timer.c | 2 -- |
| arch/x86/platform/intel-mid/sfi.c | 2 ++ |
| 2 files changed, 2 insertions(+), 2 deletions(-) |
| |
| --- a/arch/x86/kernel/apb_timer.c |
| +++ b/arch/x86/kernel/apb_timer.c |
| @@ -185,8 +185,6 @@ static void apbt_setup_irq(struct apbt_d |
| |
| irq_modify_status(adev->irq, 0, IRQ_MOVE_PCNTXT); |
| irq_set_affinity(adev->irq, cpumask_of(adev->cpu)); |
| - /* APB timer irqs are set up as mp_irqs, timer is edge type */ |
| - __irq_set_handler(adev->irq, handle_edge_irq, 0, "edge"); |
| } |
| |
| /* Should be called with per cpu */ |
| --- a/arch/x86/platform/intel-mid/sfi.c |
| +++ b/arch/x86/platform/intel-mid/sfi.c |
| @@ -106,6 +106,7 @@ int __init sfi_parse_mtmr(struct sfi_tab |
| mp_irq.dstapic = MP_APIC_ALL; |
| mp_irq.dstirq = pentry->irq; |
| mp_save_irq(&mp_irq); |
| + mp_map_gsi_to_irq(pentry->irq, IOAPIC_MAP_ALLOC); |
| } |
| |
| return 0; |
| @@ -176,6 +177,7 @@ int __init sfi_parse_mrtc(struct sfi_tab |
| mp_irq.dstapic = MP_APIC_ALL; |
| mp_irq.dstirq = pentry->irq; |
| mp_save_irq(&mp_irq); |
| + mp_map_gsi_to_irq(pentry->irq, IOAPIC_MAP_ALLOC); |
| } |
| return 0; |
| } |