summaryrefslogtreecommitdiffstats
path: root/drivers/irqchip/irq-gic-v3-its.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/irqchip/irq-gic-v3-its.c')
-rw-r--r--drivers/irqchip/irq-gic-v3-its.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 1d3056f53747..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
1418static unsigned long *lpi_bitmap; 1418static 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);
@@ -2495,7 +2494,7 @@ static int its_vpe_set_affinity(struct irq_data *d,
2495 2494
2496static void its_vpe_schedule(struct its_vpe *vpe) 2495static void its_vpe_schedule(struct its_vpe *vpe)
2497{ 2496{
2498 void * __iomem vlpi_base = gic_data_rdist_vlpi_base(); 2497 void __iomem *vlpi_base = gic_data_rdist_vlpi_base();
2499 u64 val; 2498 u64 val;
2500 2499
2501 /* Schedule the VPE */ 2500 /* Schedule the VPE */
@@ -2527,7 +2526,7 @@ static void its_vpe_schedule(struct its_vpe *vpe)
2527 2526
2528static void its_vpe_deschedule(struct its_vpe *vpe) 2527static void its_vpe_deschedule(struct its_vpe *vpe)
2529{ 2528{
2530 void * __iomem vlpi_base = gic_data_rdist_vlpi_base(); 2529 void __iomem *vlpi_base = gic_data_rdist_vlpi_base();
2531 u32 count = 1000000; /* 1s! */ 2530 u32 count = 1000000; /* 1s! */
2532 bool clean; 2531 bool clean;
2533 u64 val; 2532 u64 val;