Skip to content

Commit a4f9edb

Browse files
author
Marc Zyngier
committed
irqchip/gic-v3: Expose GICD_TYPER in the rdist structure
Instead of exposing the GIC distributor IntID field in the rdist structure that is passed to the ITS, let's replace it with a copy of the whole GICD_TYPER register. We are going to need some of this information at a later time. No functionnal change. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
1 parent 38dd7c4 commit a4f9edb

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1616,7 +1616,7 @@ static int __init its_alloc_lpi_tables(void)
16161616
{
16171617
phys_addr_t paddr;
16181618

1619-
lpi_id_bits = gic_rdists->id_bits;
1619+
lpi_id_bits = GICD_TYPER_ID_BITS(gic_rdists->gicd_typer);
16201620
gic_rdists->prop_page = its_allocate_prop_table(GFP_NOWAIT);
16211621
if (!gic_rdists->prop_page) {
16221622
pr_err("Failed to allocate PROPBASE\n");

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ static struct irq_chip gic_eoimode1_chip = {
877877
.flags = IRQCHIP_SET_TYPE_MASKED,
878878
};
879879

880-
#define GIC_ID_NR (1U << gic_data.rdists.id_bits)
880+
#define GIC_ID_NR (1U << GICD_TYPER_ID_BITS(gic_data.rdists.gicd_typer))
881881

882882
static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
883883
irq_hw_number_t hw)
@@ -1091,7 +1091,7 @@ static int __init gic_init_bases(void __iomem *dist_base,
10911091
* The GIC only supports up to 1020 interrupt sources (SGI+PPI+SPI)
10921092
*/
10931093
typer = readl_relaxed(gic_data.dist_base + GICD_TYPER);
1094-
gic_data.rdists.id_bits = GICD_TYPER_ID_BITS(typer);
1094+
gic_data.rdists.gicd_typer = typer;
10951095
gic_irqs = GICD_TYPER_IRQS(typer);
10961096
if (gic_irqs > 1020)
10971097
gic_irqs = 1020;

‎include/linux/irqchip/arm-gic-v3.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,8 @@ struct rdists {
576576
phys_addr_t phys_base;
577577
} __percpu *rdist;
578578
struct page *prop_page;
579-
int id_bits;
580579
u64 flags;
580+
u32 gicd_typer;
581581
bool has_vlpis;
582582
bool has_direct_lpi;
583583
};

0 commit comments

Comments
 (0)