Message ID | 20161018160757.11595-9-p.zabel@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, Oct 19, 2016 at 12:07 AM, Philipp Zabel <p.zabel@pengutronix.de> wrote: > If we want to stop resetting the IPU in the future, masking all > interrupts before registering the irq handlers will not be enough to > avoid spurious interrupts. We also have to clear them. > > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Liu Ying <gnuiyl@gmail.com> > --- > drivers/gpu/ipu-v3/ipu-common.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c > index b7d7bd6..97218af 100644 > --- a/drivers/gpu/ipu-v3/ipu-common.c > +++ b/drivers/gpu/ipu-v3/ipu-common.c > @@ -1286,8 +1286,11 @@ static int ipu_irq_init(struct ipu_soc *ipu) > return ret; > } > > - for (i = 0; i < IPU_NUM_IRQS; i += 32) > + /* Mask and clear all interrupts */ > + for (i = 0; i < IPU_NUM_IRQS; i += 32) { > ipu_cm_write(ipu, 0, IPU_INT_CTRL(i / 32)); > + ipu_cm_write(ipu, ~unused[i / 32], IPU_INT_STAT(i / 32)); > + } > > for (i = 0; i < IPU_NUM_IRQS; i += 32) { > gc = irq_get_domain_generic_chip(ipu->domain, i); > -- > 2.9.3 >
diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c index b7d7bd6..97218af 100644 --- a/drivers/gpu/ipu-v3/ipu-common.c +++ b/drivers/gpu/ipu-v3/ipu-common.c @@ -1286,8 +1286,11 @@ static int ipu_irq_init(struct ipu_soc *ipu) return ret; } - for (i = 0; i < IPU_NUM_IRQS; i += 32) + /* Mask and clear all interrupts */ + for (i = 0; i < IPU_NUM_IRQS; i += 32) { ipu_cm_write(ipu, 0, IPU_INT_CTRL(i / 32)); + ipu_cm_write(ipu, ~unused[i / 32], IPU_INT_STAT(i / 32)); + } for (i = 0; i < IPU_NUM_IRQS; i += 32) { gc = irq_get_domain_generic_chip(ipu->domain, i);
If we want to stop resetting the IPU in the future, masking all interrupts before registering the irq handlers will not be enough to avoid spurious interrupts. We also have to clear them. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> --- drivers/gpu/ipu-v3/ipu-common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)