Skip to content

Commit 225ad3c

Browse files
committed
Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irqchip fix from Thomas Gleixner: "A single fix to prevent allocating excessive memory in the GIC/ITS driver. While the subject of the patch might suggest otherwise this is a real fix as some SoCs exceed the memory allocation limits and fail to boot" * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/gic-v3-its: Cap lpi_id_bits to reduce memory footprint
2 parents e0a0d05 + 4cb205c commit 225ad3c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1439,6 +1439,7 @@ static struct irq_chip its_irq_chip = {
14391439
* The consequence of the above is that allocation is cost is low, but
14401440
* freeing is expensive. We assumes that freeing rarely occurs.
14411441
*/
1442+
#define ITS_MAX_LPI_NRBITS 16 /* 64K LPIs */
14421443

14431444
static DEFINE_MUTEX(lpi_range_lock);
14441445
static LIST_HEAD(lpi_range_list);
@@ -1625,7 +1626,8 @@ static int __init its_alloc_lpi_tables(void)
16251626
{
16261627
phys_addr_t paddr;
16271628

1628-
lpi_id_bits = GICD_TYPER_ID_BITS(gic_rdists->gicd_typer);
1629+
lpi_id_bits = min_t(u32, GICD_TYPER_ID_BITS(gic_rdists->gicd_typer),
1630+
ITS_MAX_LPI_NRBITS);
16291631
gic_rdists->prop_page = its_allocate_prop_table(GFP_NOWAIT);
16301632
if (!gic_rdists->prop_page) {
16311633
pr_err("Failed to allocate PROPBASE\n");

0 commit comments

Comments
 (0)