From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH net-next 2/5] net: dsa: b53: Make SRAB driver manage port interrupts Date: Wed, 5 Sep 2018 00:59:55 +0200 Message-ID: <20180904225955.GH29121@lunn.ch> References: <20180904221120.13018-1-f.fainelli@gmail.com> <20180904221120.13018-3-f.fainelli@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, vivien.didelot@savoirfairelinux.com, davem@davemloft.net To: Florian Fainelli Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:52339 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725825AbeIED1P (ORCPT ); Tue, 4 Sep 2018 23:27:15 -0400 Content-Disposition: inline In-Reply-To: <20180904221120.13018-3-f.fainelli@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: > +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. Andrew