From: Florian Fainelli <f.fainelli@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, vivien.didelot@savoirfairelinux.com,
davem@davemloft.net
Subject: Re: [PATCH net-next 2/5] net: dsa: b53: Make SRAB driver manage port interrupts
Date: Tue, 4 Sep 2018 16:46:59 -0700 [thread overview]
Message-ID: <1ad537ab-ebe5-8745-c907-aea684fee56c@gmail.com> (raw)
In-Reply-To: <20180904225955.GH29121@lunn.ch>
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
next prev parent reply other threads:[~2018-09-05 4:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-04 22:11 [PATCH net-next 0/5] net: dsa: b53: SerDes support Florian Fainelli
2018-09-04 22:11 ` [PATCH net-next 1/5] net: dsa: b53: Add ability to enable/disable port interrupts Florian Fainelli
2018-09-04 22:11 ` [PATCH net-next 2/5] net: dsa: b53: Make SRAB driver manage " Florian Fainelli
2018-09-04 22:59 ` Andrew Lunn
2018-09-04 23:46 ` Florian Fainelli [this message]
2018-09-04 22:11 ` [PATCH net-next 3/5] net: dsa: b53: Add helper to set link parameters Florian Fainelli
2018-09-04 22:11 ` [PATCH net-next 4/5] net: dsa: b53: Add PHYLINK support Florian Fainelli
2018-09-04 22:11 ` [PATCH net-next 5/5] net: dsa: b53: Add SerDes support Florian Fainelli
2018-09-04 23:15 ` Andrew Lunn
2018-09-05 0:02 ` Florian Fainelli
2018-09-04 23:32 ` Andrew Lunn
2018-09-04 23:55 ` Florian Fainelli
2018-09-05 0:06 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1ad537ab-ebe5-8745-c907-aea684fee56c@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@savoirfairelinux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).