All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Neftin, Sasha" <sasha.neftin@intel.com>
To: Li Zhong <floridsleeves@gmail.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<intel-wired-lan@lists.osuosl.org>
Cc: "Fuxbrumer, Devora" <devora.fuxbrumer@intel.com>,
	edumazet@google.com, "Ruinskiy, Dima" <dima.ruinskiy@intel.com>,
	kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net
Subject: Re: [Intel-wired-lan] [PATCH net-next v2] drivers/net/ethernet: check return value of e1e_rphy()
Date: Mon, 29 Aug 2022 21:03:21 +0300	[thread overview]
Message-ID: <3226a822-b8be-b712-737a-f8cc523ebed1@intel.com> (raw)
In-Reply-To: <20220826065627.1615965-1-floridsleeves@gmail.com>

On 8/26/2022 09:56, Li Zhong wrote:
> e1e_rphy() could return error value, which needs to be checked and
> reported for debugging and diagnose.
> 
> Signed-off-by: Li Zhong <floridsleeves@gmail.com>
> ---
>   drivers/net/ethernet/intel/e1000e/phy.c | 20 +++++++++++++++++---
>   1 file changed, 17 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/e1000e/phy.c b/drivers/net/ethernet/intel/e1000e/phy.c
> index fd07c3679bb1..060b263348ce 100644
> --- a/drivers/net/ethernet/intel/e1000e/phy.c
> +++ b/drivers/net/ethernet/intel/e1000e/phy.c
> @@ -2697,9 +2697,14 @@ static s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
>   void e1000_power_up_phy_copper(struct e1000_hw *hw)
>   {
>   	u16 mii_reg = 0;
> +	int ret;
>   
>   	/* The PHY will retain its settings across a power down/up cycle */
> -	e1e_rphy(hw, MII_BMCR, &mii_reg);
> +	ret = e1e_rphy(hw, MII_BMCR, &mii_reg);
> +	if (ret) {
> +		e_dbg("Error reading PHY register\n");
> +		return;
> +	}
>   	mii_reg &= ~BMCR_PDOWN;
>   	e1e_wphy(hw, MII_BMCR, mii_reg);
>   }
> @@ -2715,9 +2720,14 @@ void e1000_power_up_phy_copper(struct e1000_hw *hw)
>   void e1000_power_down_phy_copper(struct e1000_hw *hw)
>   {
>   	u16 mii_reg = 0;
> +	int ret;
>   
>   	/* The PHY will retain its settings across a power down/up cycle */
> -	e1e_rphy(hw, MII_BMCR, &mii_reg);
> +	ret = e1e_rphy(hw, MII_BMCR, &mii_reg);
> +	if (ret) {
> +		e_dbg("Error reading PHY register\n");
> +		return;
> +	}
>   	mii_reg |= BMCR_PDOWN;
>   	e1e_wphy(hw, MII_BMCR, mii_reg);
>   	usleep_range(1000, 2000);
> @@ -3037,7 +3047,11 @@ s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw)
>   		return 0;
>   
>   	/* Do not apply workaround if in PHY loopback bit 14 set */
> -	e1e_rphy(hw, MII_BMCR, &data);
> +	ret_val = e1e_rphy(hw, MII_BMCR, &data);
> +	if (ret_val) {
> +		e_dbg("Error reading PHY register\n");
> +		return ret_val;
> +	}
>   	if (data & BMCR_LOOPBACK)
>   		return 0;
>   
Generally, I am good with this patch. One question - it is old HW, any 
idea how to check it? (82577/82578 GbE LOM - from 2008)
Li, how did you check it manually?
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

  reply	other threads:[~2022-08-29 18:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26  6:56 [PATCH net-next v2] drivers/net/ethernet: check return value of e1e_rphy() Li Zhong
2022-08-26  6:56 ` [Intel-wired-lan] " Li Zhong
2022-08-29 18:03 ` Neftin, Sasha [this message]
2022-08-30  7:05   ` Li Zhong
2022-08-30  7:05     ` Li Zhong
2022-08-29 22:07 ` Tony Nguyen
2022-08-29 22:07   ` [Intel-wired-lan] " Tony Nguyen

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=3226a822-b8be-b712-737a-f8cc523ebed1@intel.com \
    --to=sasha.neftin@intel.com \
    --cc=davem@davemloft.net \
    --cc=devora.fuxbrumer@intel.com \
    --cc=dima.ruinskiy@intel.com \
    --cc=edumazet@google.com \
    --cc=floridsleeves@gmail.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.