From: Lukas Wunner <lukas@wunner.de>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>,
netdev@vger.kernel.org, linux-usb@vger.kernel.org,
Steve Glendinning <steve.glendinning@shawell.net>,
UNGLinuxDriver@microchip.com, Oliver Neukum <oneukum@suse.com>,
Andre Edich <andre.edich@microchip.com>,
Oleksij Rempel <linux@rempel-privat.de>,
Martyn Welch <martyn.welch@collabora.com>,
Gabriel Hojda <ghojda@yo2urs.ro>,
Christoph Fritz <chf.fritz@googlemail.com>,
Lino Sanfilippo <LinoSanfilippo@gmx.de>,
Philipp Rosenberger <p.rosenberger@kunbus.com>,
Simon Han <z.han@kunbus.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
Andrew Lunn <andrew@lunn.ch>,
Russell King <linux@armlinux.org.uk>,
Ferry Toth <fntoth@gmail.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
linux-samsung-soc@vger.kernel.org
Subject: Re: [PATCH net] net: phy: smsc: Disable Energy Detect Power-Down in interrupt mode
Date: Mon, 20 Jun 2022 21:33:18 +0200 [thread overview]
Message-ID: <20220620193318.GA15322@wunner.de> (raw)
In-Reply-To: <c40cc5fb-a84d-23f2-a400-c01b5b419bc9@gmail.com>
On Mon, Jun 20, 2022 at 10:03:26AM -0700, Florian Fainelli wrote:
> On 6/20/22 04:04, Lukas Wunner wrote:
> > --- a/drivers/net/phy/smsc.c
> > +++ b/drivers/net/phy/smsc.c
> > @@ -110,7 +110,7 @@ static int smsc_phy_config_init(struct phy_device *phydev)
> > struct smsc_phy_priv *priv = phydev->priv;
> > int rc;
> > - if (!priv->energy_enable)
> > + if (!priv->energy_enable || phydev->irq != PHY_POLL)
>
> phy_interrupt_is_valid() may be more appropriate, since you are assuming
> that you either have PHY_POLL or valid "external" PHY interrupt but there is
> also the special case of PHY_MAC_INTERRUPT that is not dealt with.
I deliberately disable EDPD for PHY_MAC_INTERRUPT as well.
That's a proper interrupt, i.e. the PHY signals interrupts
to the MAC (e.g. through an interrupt pin on the MAC),
which forwards the interrupts to phylib. EDPD cannot
be used in that situation either.
> > @@ -217,7 +219,7 @@ static int lan87xx_read_status(struct phy_device *phydev)
> > int err = genphy_read_status(phydev);
> > - if (!phydev->link && priv->energy_enable) {
> > + if (!phydev->link && priv->energy_enable && phydev->irq == PHY_POLL) {
>
> phy_polling_mode()?
Personally I think checking for PHY_POLL is succinct,
but if you or anyone else feels strongly about it
I'll be happy to add such a static inline to
include/linux/phy.h.
Thanks,
Lukas
next prev parent reply other threads:[~2022-06-20 19:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-20 11:04 [PATCH net] net: phy: smsc: Disable Energy Detect Power-Down in interrupt mode Lukas Wunner
2022-06-20 17:03 ` Florian Fainelli
2022-06-20 19:33 ` Lukas Wunner [this message]
2022-06-22 5:50 ` patchwork-bot+netdevbpf
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=20220620193318.GA15322@wunner.de \
--to=lukas@wunner.de \
--cc=LinoSanfilippo@gmx.de \
--cc=UNGLinuxDriver@microchip.com \
--cc=andre.edich@microchip.com \
--cc=andrew@lunn.ch \
--cc=chf.fritz@googlemail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=fntoth@gmail.com \
--cc=ghojda@yo2urs.ro \
--cc=hkallweit1@gmail.com \
--cc=krzk@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=linux@rempel-privat.de \
--cc=m.szyprowski@samsung.com \
--cc=martyn.welch@collabora.com \
--cc=netdev@vger.kernel.org \
--cc=oneukum@suse.com \
--cc=p.rosenberger@kunbus.com \
--cc=pabeni@redhat.com \
--cc=steve.glendinning@shawell.net \
--cc=z.han@kunbus.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).