[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1ad537ab-ebe5-8745-c907-aea684fee56c@gmail.com>
Date: Tue, 4 Sep 2018 16:46:59 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: netdev@...r.kernel.org, vivien.didelot@...oirfairelinux.com,
davem@...emloft.net
Subject: Re: [PATCH net-next 2/5] net: dsa: b53: Make SRAB driver manage port
interrupts
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
Powered by blists - more mailing lists