Message ID | 20190905030845.15540-1-oohall@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | [v2,1/5] xive, interrupts: Add a mask() source op | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | success | Successfully applied on branch master (7b12d5489fcfd73ef7ec0cb27eff7f8a5f13b238) |
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot | success | Test snowpatch/job/snowpatch-skiboot on branch master |
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco | success | Signed-off-by present |
On 05/09/2019 05:08, Oliver O'Halloran wrote: > We want to be able to mask LSIs from inside of skiboot. For P9 most of > the actual interrupt wrangling is internal to the XIVE driver, so we > need to provide a way for XIVE based interrupt sources to mask > and interrupt. Do this by adding a mask() function to the interrupt > source ops structure. > > Signed-off-by: Oliver O'Halloran <oohall@gmail.com> > --- > v2: patch added in v2 > --- > hw/xive.c | 18 ++++++++++++++++++ > include/interrupts.h | 1 + > include/xive.h | 1 + > 3 files changed, 20 insertions(+) > > diff --git a/hw/xive.c b/hw/xive.c > index 76b41a9ee95f..ea970de7898e 100644 > --- a/hw/xive.c > +++ b/hw/xive.c > @@ -2705,6 +2705,23 @@ static void xive_source_eoi(struct irq_source *is, uint32_t isn) > __xive_source_eoi(is, isn); > } > > +void __xive_source_mask(struct irq_source *is, uint32_t isn) I would remove the '__' prefix. > +{ > + struct xive_src *s = container_of(is, struct xive_src, is); > + > + xive_update_irq_mask(s, isn - s->esb_base, true); > +} > + > +static void xive_source_mask(struct irq_source *is, uint32_t isn) and get rid of the mask() handler. The set_xive, get_xive, eoi handlers were introduced for issues in DD1 (PHB LSIs) and for the XICS emulation also maybe. I don't think we need to follow that pattern anymore. C. > +{ > + struct xive_src *s = container_of(is, struct xive_src, is); > + > + if (s->orig_ops && s->orig_ops->eoi) > + s->orig_ops->mask(is, isn); > + else > + __xive_source_mask(is, isn); > +} > + > static void xive_source_interrupt(struct irq_source *is, uint32_t isn) > { > struct xive_src *s = container_of(is, struct xive_src, is); > @@ -2739,6 +2756,7 @@ static const struct irq_source_ops xive_irq_source_ops = { > .interrupt = xive_source_interrupt, > .attributes = xive_source_attributes, > .name = xive_source_name, > + .mask = xive_source_mask, > }; > > static void __xive_register_source(struct xive *x, struct xive_src *s, > diff --git a/include/interrupts.h b/include/interrupts.h > index d1ee5c4c112b..a8c44be2217b 100644 > --- a/include/interrupts.h > +++ b/include/interrupts.h > @@ -153,6 +153,7 @@ struct irq_source_ops { > void (*interrupt)(struct irq_source *is, uint32_t isn); > void (*eoi)(struct irq_source *is, uint32_t isn); > char *(*name)(struct irq_source *is, uint32_t isn); > + void (*mask)(struct irq_source *is, uint32_t isn); > }; > > struct irq_source { > diff --git a/include/xive.h b/include/xive.h > index 4100e7127784..b1f4b82ee041 100644 > --- a/include/xive.h > +++ b/include/xive.h > @@ -511,5 +511,6 @@ void *xive_get_trigger_port(uint32_t girq); > /* To be used by special EOI override in PSI */ > struct irq_source; > void __xive_source_eoi(struct irq_source *is, uint32_t isn); > +void __xive_source_mask(struct irq_source *is, uint32_t isn); > > #endif /* __XIVE_H__ */ >
On Thu, Sep 5, 2019 at 4:52 PM Cédric Le Goater <clg@kaod.org> wrote: > > On 05/09/2019 05:08, Oliver O'Halloran wrote: > > We want to be able to mask LSIs from inside of skiboot. For P9 most of > > the actual interrupt wrangling is internal to the XIVE driver, so we > > need to provide a way for XIVE based interrupt sources to mask > > and interrupt. Do this by adding a mask() function to the interrupt > > source ops structure. > > > > Signed-off-by: Oliver O'Halloran <oohall@gmail.com> > > --- > > v2: patch added in v2 > > --- > > hw/xive.c | 18 ++++++++++++++++++ > > include/interrupts.h | 1 + > > include/xive.h | 1 + > > 3 files changed, 20 insertions(+) > > > > diff --git a/hw/xive.c b/hw/xive.c > > index 76b41a9ee95f..ea970de7898e 100644 > > --- a/hw/xive.c > > +++ b/hw/xive.c > > @@ -2705,6 +2705,23 @@ static void xive_source_eoi(struct irq_source *is, uint32_t isn) > > __xive_source_eoi(is, isn); > > } > > > > +void __xive_source_mask(struct irq_source *is, uint32_t isn) > I would remove the '__' prefix. > > > +{ > > + struct xive_src *s = container_of(is, struct xive_src, is); > > + > > + xive_update_irq_mask(s, isn - s->esb_base, true); > > +} > > + > > +static void xive_source_mask(struct irq_source *is, uint32_t isn) > > and get rid of the mask() handler. Yeah that's cleaner. I'll drop the new op and fold the addition of xive_source_mask() into the patch that uses it.
diff --git a/hw/xive.c b/hw/xive.c index 76b41a9ee95f..ea970de7898e 100644 --- a/hw/xive.c +++ b/hw/xive.c @@ -2705,6 +2705,23 @@ static void xive_source_eoi(struct irq_source *is, uint32_t isn) __xive_source_eoi(is, isn); } +void __xive_source_mask(struct irq_source *is, uint32_t isn) +{ + struct xive_src *s = container_of(is, struct xive_src, is); + + xive_update_irq_mask(s, isn - s->esb_base, true); +} + +static void xive_source_mask(struct irq_source *is, uint32_t isn) +{ + struct xive_src *s = container_of(is, struct xive_src, is); + + if (s->orig_ops && s->orig_ops->eoi) + s->orig_ops->mask(is, isn); + else + __xive_source_mask(is, isn); +} + static void xive_source_interrupt(struct irq_source *is, uint32_t isn) { struct xive_src *s = container_of(is, struct xive_src, is); @@ -2739,6 +2756,7 @@ static const struct irq_source_ops xive_irq_source_ops = { .interrupt = xive_source_interrupt, .attributes = xive_source_attributes, .name = xive_source_name, + .mask = xive_source_mask, }; static void __xive_register_source(struct xive *x, struct xive_src *s, diff --git a/include/interrupts.h b/include/interrupts.h index d1ee5c4c112b..a8c44be2217b 100644 --- a/include/interrupts.h +++ b/include/interrupts.h @@ -153,6 +153,7 @@ struct irq_source_ops { void (*interrupt)(struct irq_source *is, uint32_t isn); void (*eoi)(struct irq_source *is, uint32_t isn); char *(*name)(struct irq_source *is, uint32_t isn); + void (*mask)(struct irq_source *is, uint32_t isn); }; struct irq_source { diff --git a/include/xive.h b/include/xive.h index 4100e7127784..b1f4b82ee041 100644 --- a/include/xive.h +++ b/include/xive.h @@ -511,5 +511,6 @@ void *xive_get_trigger_port(uint32_t girq); /* To be used by special EOI override in PSI */ struct irq_source; void __xive_source_eoi(struct irq_source *is, uint32_t isn); +void __xive_source_mask(struct irq_source *is, uint32_t isn); #endif /* __XIVE_H__ */
We want to be able to mask LSIs from inside of skiboot. For P9 most of the actual interrupt wrangling is internal to the XIVE driver, so we need to provide a way for XIVE based interrupt sources to mask and interrupt. Do this by adding a mask() function to the interrupt source ops structure. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> --- v2: patch added in v2 --- hw/xive.c | 18 ++++++++++++++++++ include/interrupts.h | 1 + include/xive.h | 1 + 3 files changed, 20 insertions(+)