From: Andrew Lunn <andrew@lunn.ch>
To: Qingfang DENG <dqfext@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>,
Jose Abreu <Jose.Abreu@synopsys.com>,
netdev@vger.kernel.org
Subject: Re: Handling standalone PCS IRQ
Date: Thu, 21 Jul 2022 19:05:08 +0200 [thread overview]
Message-ID: <YtmHRDdbCsDy3Wha@lunn.ch> (raw)
In-Reply-To: <20220719143912.2727014-1-dqfext@gmail.com>
On Tue, Jul 19, 2022 at 10:39:12PM +0800, Qingfang DENG wrote:
> Hi all,
>
> I was working with an SoC that has a built-in DWC XPCS with IRQ support.
> However the current driver still uses polling.
>
> I may modify xpcs_create() to try getting an IRQ number from DT, and fall back
> to polling if it fails (see the code below). But I don't know how to notify
> phylink in the IRQ handler.
>
> There is a phylink_mac_change() function to notify phylink, but it is supposed
> to be used in a MAC driver, and it requires a (struct phylink *), not a
> (struct phylink_pcs *). Do we need a similar one for PCS?
Russell should really answer this. But my take on this, is yes, you
should add a phylink_pcs_change(), which calls phylink_run_resolve().
As you say, i don't currently see a way to go from phylink_pcs to
phylink. So you might need to add a pointer to phylink_pcs. Just be
careful of race conditions, phylink->pcs can change, and you don't
want an interrupt delivered while it is changing. I would also make
the value in phylink_pcs opaque, we don't want the PCS actually using
information from the phylink structure.
Andrew
prev parent reply other threads:[~2022-07-21 17:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-19 14:39 Handling standalone PCS IRQ Qingfang DENG
2022-07-21 17:05 ` Andrew Lunn [this message]
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=YtmHRDdbCsDy3Wha@lunn.ch \
--to=andrew@lunn.ch \
--cc=Jose.Abreu@synopsys.com \
--cc=dqfext@gmail.com \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
/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).