diff options
-rw-r--r-- | drivers/irqchip/irq-gic-v3-its.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 94b7d74d519f..2cbb19cddbf8 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c | |||
@@ -1412,7 +1412,7 @@ static struct irq_chip its_irq_chip = { | |||
1412 | * This gives us (((1UL << id_bits) - 8192) >> 5) possible allocations. | 1412 | * This gives us (((1UL << id_bits) - 8192) >> 5) possible allocations. |
1413 | */ | 1413 | */ |
1414 | #define IRQS_PER_CHUNK_SHIFT 5 | 1414 | #define IRQS_PER_CHUNK_SHIFT 5 |
1415 | #define IRQS_PER_CHUNK (1 << IRQS_PER_CHUNK_SHIFT) | 1415 | #define IRQS_PER_CHUNK (1UL << IRQS_PER_CHUNK_SHIFT) |
1416 | #define ITS_MAX_LPI_NRBITS 16 /* 64K LPIs */ | 1416 | #define ITS_MAX_LPI_NRBITS 16 /* 64K LPIs */ |
1417 | 1417 | ||
1418 | static unsigned long *lpi_bitmap; | 1418 | static unsigned long *lpi_bitmap; |
@@ -2119,11 +2119,10 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id, | |||
2119 | 2119 | ||
2120 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | 2120 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); |
2121 | /* | 2121 | /* |
2122 | * At least one bit of EventID is being used, hence a minimum | 2122 | * We allocate at least one chunk worth of LPIs bet device, |
2123 | * of two entries. No, the architecture doesn't let you | 2123 | * and thus that many ITEs. The device may require less though. |
2124 | * express an ITT with a single entry. | ||
2125 | */ | 2124 | */ |
2126 | nr_ites = max(2UL, roundup_pow_of_two(nvecs)); | 2125 | nr_ites = max(IRQS_PER_CHUNK, roundup_pow_of_two(nvecs)); |
2127 | sz = nr_ites * its->ite_size; | 2126 | sz = nr_ites * its->ite_size; |
2128 | sz = max(sz, ITS_ITT_ALIGN) + ITS_ITT_ALIGN - 1; | 2127 | sz = max(sz, ITS_ITT_ALIGN) + ITS_ITT_ALIGN - 1; |
2129 | itt = kzalloc(sz, GFP_KERNEL); | 2128 | itt = kzalloc(sz, GFP_KERNEL); |