diff options
author | Thomas Gleixner <[email protected]> | 2014-04-24 09:50:53 +0200 |
---|---|---|
committer | Thomas Gleixner <[email protected]> | 2014-04-28 12:20:00 +0200 |
commit | 62a08ae2a5763aabeee98264605236b001503e0c (patch) | |
tree | 9de35dba4bfaaece70e0963b0ef0d8845ae1b134 /lib/memory-notifier-error-inject.c | |
parent | def5f1273c5f18abf8fcaee03a115d3e907ad407 (diff) |
genirq: x86: Ensure that dynamic irq allocation does not conflict
On x86 the allocation of irq descriptors may allocate interrupts which
are in the range of the GSI interrupts. That's wrong as those
interrupts are hardwired and we don't have the irq domain translation
like PPC. So one of these interrupts can be hooked up later to one of
the devices which are hard wired to it and the io_apic init code for
that particular interrupt line happily reuses that descriptor with a
completely different configuration so hell breaks lose.
Inside x86 we allocate dynamic interrupts from above nr_gsi_irqs,
except for a few usage sites which have not yet blown up in our face
for whatever reason. But for drivers which need an irq range, like the
GPIO drivers, we have no limit in place and we don't want to expose
such a detail to a driver.
To cure this introduce a function which an architecture can implement
to impose a lower bound on the dynamic interrupt allocations.
Implement it for x86 and set the lower bound to nr_gsi_irqs, which is
the end of the hardwired interrupt space, so all dynamic allocations
happen above.
That not only allows the GPIO driver to work sanely, it also protects
the bogus callsites of create_irq_nr() in hpet, uv, irq_remapping and
htirq code. They need to be cleaned up as well, but that's a separate
issue.
Reported-by: Jin Yao <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Tested-by: Mika Westerberg <[email protected]>
Cc: Mathias Nyman <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Grant Likely <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Cc: Krogerus Heikki <[email protected]>
Cc: Linus Walleij <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions