linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] irq-gic: select all CPU's selected in interrupt affinity settings
@ 2019-11-19 23:12 event
  2019-11-19 23:36 ` Russell King - ARM Linux admin
  0 siblings, 1 reply; 21+ messages in thread
From: event @ 2019-11-19 23:12 UTC (permalink / raw)
  To: linux-arm-kernel

So far only a CPU selected with top affinity bit was selected. This
resulted in all interrupts
being processed by CPU0 by default despite "FF" default affinity
setting for all interrupts
---
 drivers/irqchip/irq-gic.c | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 30ab62334..e6c6451ea 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -331,25 +331,30 @@ static int gic_set_affinity(struct irq_data *d,
const struct cpumask *mask_val,
 {
  void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3);
  unsigned int cpu, shift = (gic_irq(d) % 4) * 8;
- u32 val, mask, bit;
+ u32 val, reg_mask, bits = 0;
  unsigned long flags;
+ const struct cpumask* cpu_mask;

- if (!force)
- cpu = cpumask_any_and(mask_val, cpu_online_mask);
+ if (force)
+ cpu_mask = mask_val;
  else
- cpu = cpumask_first(mask_val);
+ cpu_mask = cpu_online_mask;

- if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids)
- return -EINVAL;
+ for_each_cpu_and(cpu, mask_val, cpu_mask) {
+ if (cpu >= NR_GIC_CPU_IF || cpu >= nr_cpu_ids) {
+ return -EINVAL;
+ }
+ bits |= gic_cpu_map[cpu];
+ }

  gic_lock_irqsave(flags);
- mask = 0xff << shift;
- bit = gic_cpu_map[cpu] << shift;
- val = readl_relaxed(reg) & ~mask;
- writel_relaxed(val | bit, reg);
+ reg_mask = 0xff << shift;
+ bits <<= shift;
+ val = readl_relaxed(reg) & ~reg_mask;
+ writel_relaxed(val | bits, reg);
  gic_unlock_irqrestore(flags);

- irq_data_update_effective_affinity(d, cpumask_of(cpu));
+ irq_data_update_effective_affinity(d, cpu_mask);

  return IRQ_SET_MASK_OK_DONE;
 }
--
2.17.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2019-11-20 17:55 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-19 23:12 [PATCH] irq-gic: select all CPU's selected in interrupt affinity settings event
2019-11-19 23:36 ` Russell King - ARM Linux admin
2019-11-20  0:24   ` Leonid Movshovich
2019-11-20  1:15     ` Robin Murphy
2019-11-20 10:44       ` Leonid Movshovich
2019-11-20 10:50         ` Russell King - ARM Linux admin
2019-11-20 11:25           ` Leonid Movshovich
2019-11-20 13:33             ` Robin Murphy
2019-11-20 13:58               ` Russell King - ARM Linux admin
2019-11-20 15:07                 ` Leonid Movshovich
2019-11-20 17:13                   ` Russell King - ARM Linux admin
2019-11-20 17:54                     ` Leonid Movshovich
2019-11-20 15:04       ` Marc Zyngier
2019-11-20 15:28         ` Leonid Movshovich
2019-11-20 15:39           ` Marc Zyngier
2019-11-20 16:45             ` Leonid Movshovich
2019-11-20 17:17               ` Russell King - ARM Linux admin
2019-11-20 17:37                 ` Leonid Movshovich
2019-11-20 17:55                   ` Russell King - ARM Linux admin
2019-11-20 17:14           ` Russell King - ARM Linux admin
2019-11-20 17:48             ` Leonid Movshovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).