On 09/04/2018 03:59 PM, Andrew Lunn wrote: >> +static irqreturn_t b53_srab_port_isr(int irq, void *dev_id) >> +{ >> + struct b53_srab_port_priv *port = dev_id; >> + struct b53_device *dev = port->dev; >> + struct b53_srab_priv *priv = dev->priv; >> + >> + /* Acknowledge the interrupt */ >> + writel(BIT(port->num), priv->regs + B53_SRAB_INTR); >> + >> + schedule_work(&port->irq_work); >> + >> + return IRQ_HANDLED; >> +} >> + >> +static int b53_srab_irq_enable(struct b53_device *dev, int port) >> +{ >> + struct b53_srab_priv *priv = dev->priv; >> + struct b53_srab_port_priv *p = &priv->port_intrs[port]; >> + int ret; >> + >> + ret = request_irq(p->irq, b53_srab_port_isr, 0, >> + dev_name(dev->dev), p); > > Hi Florian > > Could you use a threaded interrupt? Save you from having to implement > your own work queue. I think you can have a function called in both > interrupt context in order to acknowledged the interrupt, and thread > context to do the remaining work.
Indeed, this works nicely actually, thanks for the suggestion. -- Florian