Message ID | 20200304203330.4967-11-maz@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | irqchip/gic-v4: GICv4.1 architecture support | expand |
On 3/4/20 9:33 PM, Marc Zyngier wrote: > Implement mask/unmask for virtual SGIs by calling into the > configuration helper. > > Signed-off-by: Marc Zyngier <maz@kernel.org> > Reviewed-by: Zenghui Yu <yuzenghui@huawei.com> > --- > drivers/irqchip/irq-gic-v3-its.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c > index e0db3f906f87..c93f178914ee 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -3939,6 +3939,22 @@ static void its_configure_sgi(struct irq_data *d, bool clear) > its_send_single_vcommand(find_4_1_its(), its_build_vsgi_cmd, &desc); > } > > +static void its_sgi_mask_irq(struct irq_data *d) > +{ > + struct its_vpe *vpe = irq_data_get_irq_chip_data(d); > + > + vpe->sgi_config[d->hwirq].enabled = false; > + its_configure_sgi(d, false); > +} > + > +static void its_sgi_unmask_irq(struct irq_data *d) > +{ > + struct its_vpe *vpe = irq_data_get_irq_chip_data(d); > + > + vpe->sgi_config[d->hwirq].enabled = true; > + its_configure_sgi(d, false); > +} > + > static int its_sgi_set_affinity(struct irq_data *d, > const struct cpumask *mask_val, > bool force) > @@ -3948,6 +3964,8 @@ static int its_sgi_set_affinity(struct irq_data *d, > > static struct irq_chip its_sgi_irq_chip = { > .name = "GICv4.1-sgi", > + .irq_mask = its_sgi_mask_irq, > + .irq_unmask = its_sgi_unmask_irq, > .irq_set_affinity = its_sgi_set_affinity, > }; > > Reviewed-by: Eric Auger <eric.auger@redhat.com> Thanks Eric
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index e0db3f906f87..c93f178914ee 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -3939,6 +3939,22 @@ static void its_configure_sgi(struct irq_data *d, bool clear) its_send_single_vcommand(find_4_1_its(), its_build_vsgi_cmd, &desc); } +static void its_sgi_mask_irq(struct irq_data *d) +{ + struct its_vpe *vpe = irq_data_get_irq_chip_data(d); + + vpe->sgi_config[d->hwirq].enabled = false; + its_configure_sgi(d, false); +} + +static void its_sgi_unmask_irq(struct irq_data *d) +{ + struct its_vpe *vpe = irq_data_get_irq_chip_data(d); + + vpe->sgi_config[d->hwirq].enabled = true; + its_configure_sgi(d, false); +} + static int its_sgi_set_affinity(struct irq_data *d, const struct cpumask *mask_val, bool force) @@ -3948,6 +3964,8 @@ static int its_sgi_set_affinity(struct irq_data *d, static struct irq_chip its_sgi_irq_chip = { .name = "GICv4.1-sgi", + .irq_mask = its_sgi_mask_irq, + .irq_unmask = its_sgi_unmask_irq, .irq_set_affinity = its_sgi_set_affinity, };