From: Andrew Lunn <andrew@lunn.ch>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
Vivien Didelot <vivien.didelot@savoirfairelinux.com>,
netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH RFC 2/6] net: phy: Use threaded IRQ, to allow IRQ from sleeping devices
Date: Wed, 28 Sep 2016 23:16:32 +0200 [thread overview]
Message-ID: <20160928211632.GA32406@lunn.ch> (raw)
In-Reply-To: <b93c08b9-1ed0-19d4-bd77-53a4958da97e@cogentembedded.com>
On Wed, Sep 28, 2016 at 02:38:03PM +0300, Sergei Shtylyov wrote:
> Hello.
>
> On 9/28/2016 11:32 AM, Andrew Lunn wrote:
>
> >The interrupt lines from PHYs maybe connected to I2C bus expanders, or
> >from switches on MDIO busses. Such interrupts are sourced from devices
> >which sleep, so use threaded interrupts. Threaded interrupts require
> >that the interrupt requester also uses the threaded API. Change the
> >phylib to use the threaded API, which is backwards compatible with
> >none-threaded IRQs.
> >
> >Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> >---
> > drivers/net/phy/phy.c | 7 +++----
> > 1 file changed, 3 insertions(+), 4 deletions(-)
> >
> >diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> >index c6f66832a1a6..5c29ed72f721 100644
> >--- a/drivers/net/phy/phy.c
> >+++ b/drivers/net/phy/phy.c
> >@@ -722,10 +722,9 @@ phy_err:
> > int phy_start_interrupts(struct phy_device *phydev)
> > {
> > atomic_set(&phydev->irq_disable, 0);
> >- if (request_irq(phydev->irq, phy_interrupt,
> >- IRQF_SHARED,
> >- "phy_interrupt",
> >- phydev) < 0) {
> >+ if (request_threaded_irq(phydev->irq, NULL, phy_interrupt,
> >+ IRQF_ONESHOT, "phy_interrupt",
>
> What about IRQF_SHARED?
IRQF_ONESHOT | IRQF_SHARED does work.
However, it requires all uses of the interrupt use the same flags.
The commit messages suggests IRQF_SHARED is there because of boards
which have multiple PHYs using one IRQ. That case will work, since all
PHYs will be using this code.
What will be an issue is if the sharing is between a PHY and something
else. That something else will also need to use IRQF_ONESHOT. Anybody
know if this situation actually exists?
Thanks
Andrew
next prev parent reply other threads:[~2016-09-28 21:16 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1475051544-18561-1-git-send-email-andrew@lunn.ch>
2016-09-28 8:32 ` [PATCH RFC 1/6] net: dsa: mv88e6xxx: Implement interrupt support Andrew Lunn
2016-09-28 10:22 ` Andrew Lunn
2016-09-28 8:32 ` [PATCH RFC 2/6] net: phy: Use threaded IRQ, to allow IRQ from sleeping devices Andrew Lunn
2016-09-28 11:38 ` Sergei Shtylyov
2016-09-28 12:24 ` Andrew Lunn
2016-09-28 21:16 ` Andrew Lunn [this message]
2016-09-28 8:32 ` [PATCH RFC 3/6] net: phy: Threaded interrupts allow some simplification Andrew Lunn
2016-09-28 11:46 ` Sergei Shtylyov
2016-09-28 12:13 ` Sergei Shtylyov
2016-09-28 12:28 ` Andrew Lunn
2016-09-28 13:38 ` Sergei Shtylyov
2016-09-28 17:14 ` Florian Fainelli
2016-10-18 10:37 ` Sergei Shtylyov
2016-10-18 10:46 ` Andrew Lunn
2016-09-28 8:32 ` [PATCH RFC 4/6] net: phy: Use phy name when requesting the interrupt Andrew Lunn
2016-09-28 17:18 ` Florian Fainelli
2016-09-28 8:32 ` [PATCH RFC 5/6] net: phy: Trigger state machine on state change and not polling Andrew Lunn
2016-09-28 21:31 ` Florian Fainelli
2016-09-29 7:08 ` Andrew Lunn
2016-09-28 8:32 ` [PATCH RFC 6/6] arm: vf610: zii devel b: Add support for switch interrupts 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=20160928211632.GA32406@lunn.ch \
--to=andrew@lunn.ch \
--cc=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=sergei.shtylyov@cogentembedded.com \
--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).