diff options
author | Vladimir Murzin <vladimir.murzin@arm.com> | 2016-11-02 07:54:05 -0400 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2016-11-29 04:14:48 -0500 |
commit | 328191c05ed72762c382bdb835607dd5bd56b0bc (patch) | |
tree | 7e14b0e9d5386a835cd46d0c9751765acec82399 | |
parent | d524eaa2a8c08efcdf905acf07cfa770e481ca6b (diff) |
irqchip/gic-v3-its: Specialise flush_dcache operation
It'd be better to switch to CMA... but before that done redirect
flush_dcache operation, so 32-bit implementation could be wired
latter.
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r-- | arch/arm64/include/asm/arch_gicv3.h | 3 | ||||
-rw-r--r-- | drivers/irqchip/irq-gic-v3-its.c | 17 |
2 files changed, 11 insertions, 9 deletions
diff --git a/arch/arm64/include/asm/arch_gicv3.h b/arch/arm64/include/asm/arch_gicv3.h index 0313670a3e3f..546f92b32b62 100644 --- a/arch/arm64/include/asm/arch_gicv3.h +++ b/arch/arm64/include/asm/arch_gicv3.h | |||
@@ -79,6 +79,7 @@ | |||
79 | 79 | ||
80 | #include <linux/stringify.h> | 80 | #include <linux/stringify.h> |
81 | #include <asm/barrier.h> | 81 | #include <asm/barrier.h> |
82 | #include <asm/cacheflush.h> | ||
82 | 83 | ||
83 | #define read_gicreg read_sysreg_s | 84 | #define read_gicreg read_sysreg_s |
84 | #define write_gicreg write_sysreg_s | 85 | #define write_gicreg write_sysreg_s |
@@ -171,5 +172,7 @@ static inline void gic_write_bpr1(u32 val) | |||
171 | #define gic_read_typer(c) readq_relaxed(c) | 172 | #define gic_read_typer(c) readq_relaxed(c) |
172 | #define gic_write_irouter(v, c) writeq_relaxed(v, c) | 173 | #define gic_write_irouter(v, c) writeq_relaxed(v, c) |
173 | 174 | ||
175 | #define gic_flush_dcache_to_poc(a,l) __flush_dcache_area((a), (l)) | ||
176 | |||
174 | #endif /* __ASSEMBLY__ */ | 177 | #endif /* __ASSEMBLY__ */ |
175 | #endif /* __ASM_ARCH_GICV3_H */ | 178 | #endif /* __ASM_ARCH_GICV3_H */ |
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 312dd55dfaae..b2a6e7b0bf9a 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <linux/irqchip.h> | 37 | #include <linux/irqchip.h> |
38 | #include <linux/irqchip/arm-gic-v3.h> | 38 | #include <linux/irqchip/arm-gic-v3.h> |
39 | 39 | ||
40 | #include <asm/cacheflush.h> | ||
41 | #include <asm/cputype.h> | 40 | #include <asm/cputype.h> |
42 | #include <asm/exception.h> | 41 | #include <asm/exception.h> |
43 | 42 | ||
@@ -433,7 +432,7 @@ static void its_flush_cmd(struct its_node *its, struct its_cmd_block *cmd) | |||
433 | * the ITS. | 432 | * the ITS. |
434 | */ | 433 | */ |
435 | if (its->flags & ITS_FLAGS_CMDQ_NEEDS_FLUSHING) | 434 | if (its->flags & ITS_FLAGS_CMDQ_NEEDS_FLUSHING) |
436 | __flush_dcache_area(cmd, sizeof(*cmd)); | 435 | gic_flush_dcache_to_poc(cmd, sizeof(*cmd)); |
437 | else | 436 | else |
438 | dsb(ishst); | 437 | dsb(ishst); |
439 | } | 438 | } |
@@ -602,7 +601,7 @@ static void lpi_set_config(struct irq_data *d, bool enable) | |||
602 | * Humpf... | 601 | * Humpf... |
603 | */ | 602 | */ |
604 | if (gic_rdists->flags & RDIST_FLAGS_PROPBASE_NEEDS_FLUSHING) | 603 | if (gic_rdists->flags & RDIST_FLAGS_PROPBASE_NEEDS_FLUSHING) |
605 | __flush_dcache_area(cfg, sizeof(*cfg)); | 604 | gic_flush_dcache_to_poc(cfg, sizeof(*cfg)); |
606 | else | 605 | else |
607 | dsb(ishst); | 606 | dsb(ishst); |
608 | its_send_inv(its_dev, id); | 607 | its_send_inv(its_dev, id); |
@@ -817,7 +816,7 @@ static int __init its_alloc_lpi_tables(void) | |||
817 | LPI_PROPBASE_SZ); | 816 | LPI_PROPBASE_SZ); |
818 | 817 | ||
819 | /* Make sure the GIC will observe the written configuration */ | 818 | /* Make sure the GIC will observe the written configuration */ |
820 | __flush_dcache_area(page_address(gic_rdists->prop_page), LPI_PROPBASE_SZ); | 819 | gic_flush_dcache_to_poc(page_address(gic_rdists->prop_page), LPI_PROPBASE_SZ); |
821 | 820 | ||
822 | return 0; | 821 | return 0; |
823 | } | 822 | } |
@@ -910,7 +909,7 @@ retry_baser: | |||
910 | shr = tmp & GITS_BASER_SHAREABILITY_MASK; | 909 | shr = tmp & GITS_BASER_SHAREABILITY_MASK; |
911 | if (!shr) { | 910 | if (!shr) { |
912 | cache = GITS_BASER_nC; | 911 | cache = GITS_BASER_nC; |
913 | __flush_dcache_area(base, PAGE_ORDER_TO_SIZE(order)); | 912 | gic_flush_dcache_to_poc(base, PAGE_ORDER_TO_SIZE(order)); |
914 | } | 913 | } |
915 | goto retry_baser; | 914 | goto retry_baser; |
916 | } | 915 | } |
@@ -1102,7 +1101,7 @@ static void its_cpu_init_lpis(void) | |||
1102 | } | 1101 | } |
1103 | 1102 | ||
1104 | /* Make sure the GIC will observe the zero-ed page */ | 1103 | /* Make sure the GIC will observe the zero-ed page */ |
1105 | __flush_dcache_area(page_address(pend_page), LPI_PENDBASE_SZ); | 1104 | gic_flush_dcache_to_poc(page_address(pend_page), LPI_PENDBASE_SZ); |
1106 | 1105 | ||
1107 | paddr = page_to_phys(pend_page); | 1106 | paddr = page_to_phys(pend_page); |
1108 | pr_info("CPU%d: using LPI pending table @%pa\n", | 1107 | pr_info("CPU%d: using LPI pending table @%pa\n", |
@@ -1287,13 +1286,13 @@ static bool its_alloc_device_table(struct its_node *its, u32 dev_id) | |||
1287 | 1286 | ||
1288 | /* Flush Lvl2 table to PoC if hw doesn't support coherency */ | 1287 | /* Flush Lvl2 table to PoC if hw doesn't support coherency */ |
1289 | if (!(baser->val & GITS_BASER_SHAREABILITY_MASK)) | 1288 | if (!(baser->val & GITS_BASER_SHAREABILITY_MASK)) |
1290 | __flush_dcache_area(page_address(page), baser->psz); | 1289 | gic_flush_dcache_to_poc(page_address(page), baser->psz); |
1291 | 1290 | ||
1292 | table[idx] = cpu_to_le64(page_to_phys(page) | GITS_BASER_VALID); | 1291 | table[idx] = cpu_to_le64(page_to_phys(page) | GITS_BASER_VALID); |
1293 | 1292 | ||
1294 | /* Flush Lvl1 entry to PoC if hw doesn't support coherency */ | 1293 | /* Flush Lvl1 entry to PoC if hw doesn't support coherency */ |
1295 | if (!(baser->val & GITS_BASER_SHAREABILITY_MASK)) | 1294 | if (!(baser->val & GITS_BASER_SHAREABILITY_MASK)) |
1296 | __flush_dcache_area(table + idx, GITS_LVL1_ENTRY_SIZE); | 1295 | gic_flush_dcache_to_poc(table + idx, GITS_LVL1_ENTRY_SIZE); |
1297 | 1296 | ||
1298 | /* Ensure updated table contents are visible to ITS hardware */ | 1297 | /* Ensure updated table contents are visible to ITS hardware */ |
1299 | dsb(sy); | 1298 | dsb(sy); |
@@ -1340,7 +1339,7 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id, | |||
1340 | return NULL; | 1339 | return NULL; |
1341 | } | 1340 | } |
1342 | 1341 | ||
1343 | __flush_dcache_area(itt, sz); | 1342 | gic_flush_dcache_to_poc(itt, sz); |
1344 | 1343 | ||
1345 | dev->its = its; | 1344 | dev->its = its; |
1346 | dev->itt = itt; | 1345 | dev->itt = itt; |