From: Florian Fainelli <f.fainelli@gmail.com>
To: Jisheng Zhang <Jisheng.Zhang@synaptics.com>,
Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] net: phy: call phy_disable_interrupts() in phy_init_hw()
Date: Tue, 23 Jun 2020 20:36:46 -0700 [thread overview]
Message-ID: <996affa7-9f78-73c4-8f86-9bcd337191c4@gmail.com> (raw)
In-Reply-To: <20200624112624.200306ac@xhacker.debian>
Le 2020-06-23 à 20:26, Jisheng Zhang a écrit :
> Call phy_disable_interrupts() in phy_init_hw() to "have a defined init
> state as we don't know in which state the PHY is if the PHY driver is
> loaded. We shouldn't assume that it's the chip power-on defaults, BIOS
> or boot loader could have changed this. Or in case of dual-boot
> systems the other OS could leave the PHY in whatever state." as pointed
> out by Heiner.
>
> Suggested-by: Heiner Kallweit <hkallweit1@gmail.com>
> Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
> ---
> drivers/net/phy/phy_device.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 04946de74fa0..f17d397ba689 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -1090,10 +1090,13 @@ int phy_init_hw(struct phy_device *phydev)
> if (ret < 0)
> return ret;
>
> - if (phydev->drv->config_init)
> + if (phydev->drv->config_init) {
> ret = phydev->drv->config_init(phydev);
> + if (ret < 0)
> + return ret;
> + }
>
> - return ret;
> + return phy_disable_interrupts(phydev);
Not sure if the order makes sense here, it may seem more natural for a
driver writer to have interrupts disabled first and then config_init
called (which could enable interrupts not related to link management
like thermal events etc.)
--
Florian
next prev parent reply other threads:[~2020-06-24 3:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-24 3:25 [PATCH v3 0/2] net: phy: call phy_disable_interrupts() in phy_init_hw() Jisheng Zhang
2020-06-24 3:25 ` [PATCH v3 1/2] net: phy: make phy_disable_interrupts() non-static Jisheng Zhang
2020-06-24 3:26 ` [PATCH v3 2/2] net: phy: call phy_disable_interrupts() in phy_init_hw() Jisheng Zhang
2020-06-24 3:36 ` Florian Fainelli [this message]
2020-06-24 9:39 ` Russell King - ARM Linux admin
2020-06-24 21:43 ` [PATCH v3 0/2] " David Miller
2020-06-24 22:10 ` Florian Fainelli
2020-06-24 23:34 ` David Miller
2020-06-25 3:07 ` Florian Fainelli
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=996affa7-9f78-73c4-8f86-9bcd337191c4@gmail.com \
--to=f.fainelli@gmail.com \
--cc=Jisheng.Zhang@synaptics.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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