Skip to content

Commit c0cdc89

Browse files
Valentin SchneiderMarc Zyngier
authored andcommitted
irqchip/gic-v3-its: Give the percpu rdist struct its own flags field
Later patches will require tracking some per-rdist status. Reuse the bytes "lost" to padding within the __percpu rdist struct as a flags field, and re-encode ->lpi_enabled within said flags. No change in functionality intended. Signed-off-by: Valentin Schneider <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 0fcfb00 commit c0cdc89

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
#define RDIST_FLAGS_PROPBASE_NEEDS_FLUSHING (1 << 0)
4747
#define RDIST_FLAGS_RD_TABLES_PREALLOCATED (1 << 1)
4848

49+
#define RD_LOCAL_LPI_ENABLED BIT(0)
50+
4951
static u32 lpi_id_bits;
5052

5153
/*
@@ -3044,7 +3046,7 @@ static void its_cpu_init_lpis(void)
30443046
phys_addr_t paddr;
30453047
u64 val, tmp;
30463048

3047-
if (gic_data_rdist()->lpi_enabled)
3049+
if (gic_data_rdist()->flags & RD_LOCAL_LPI_ENABLED)
30483050
return;
30493051

30503052
val = readl_relaxed(rbase + GICR_CTLR);
@@ -3158,7 +3160,7 @@ static void its_cpu_init_lpis(void)
31583160
/* Make sure the GIC has seen the above */
31593161
dsb(sy);
31603162
out:
3161-
gic_data_rdist()->lpi_enabled = true;
3163+
gic_data_rdist()->flags |= RD_LOCAL_LPI_ENABLED;
31623164
pr_info("GICv3: CPU%d: using %s LPI pending table @%pa\n",
31633165
smp_processor_id(),
31643166
gic_data_rdist()->pend_page ? "allocated" : "reserved",
@@ -5138,7 +5140,7 @@ static int redist_disable_lpis(void)
51385140
*
51395141
* If running with preallocated tables, there is nothing to do.
51405142
*/
5141-
if (gic_data_rdist()->lpi_enabled ||
5143+
if ((gic_data_rdist()->flags & RD_LOCAL_LPI_ENABLED) ||
51425144
(gic_rdists->flags & RDIST_FLAGS_RD_TABLES_PREALLOCATED))
51435145
return 0;
51445146

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ struct rdists {
615615
void __iomem *rd_base;
616616
struct page *pend_page;
617617
phys_addr_t phys_base;
618-
bool lpi_enabled;
618+
u64 flags;
619619
cpumask_t *vpe_table_mask;
620620
void *vpe_l1_base;
621621
} __percpu *rdist;

0 commit comments

Comments
 (0)