]> git.baikalelectronics.ru Git - kernel.git/commit
genirq: Ensure we locate the passed IRQ in irq_alloc_descs()
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 2 Jun 2011 17:55:13 +0000 (18:55 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 3 Jun 2011 12:53:16 +0000 (14:53 +0200)
commit7a7be809165b9a4ae5efef519b004f1fa4ddb5d2
tree89ac7169ab5009625770124e8b78549e69009ea1
parent5fe6d922f294a44ab7d33bd7f2cf1ce2e878b301
genirq: Ensure we locate the passed IRQ in irq_alloc_descs()

When irq_alloc_descs() is called with no base IRQ specified then it will
search for a range of IRQs starting from a specified base address. In the
case where an IRQ is specified it still does this search in order to ensure
that none of the requested range is already allocated and it still uses the
from parameter to specify the base for the search. This means that in the
case where a base is specified but from is zero (which is reasonable as
any IRQ number is in the range specified by a zero from) the function will
get confused and try to allocate the first suitably sized block of free IRQs
it finds.

Instead use a specified IRQ as the base address for the search, and insist
that any from that is specified can support that IRQ.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Link: http://lkml.kernel.org/r/1307037313-15733-1-git-send-email-broonie@opensource.wolfsonmicro.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/irq/irqdesc.c