From: Sasha Neftin <sasha.neftin@intel.com>
To: Ricky Wu <en-wei.wu@canonical.com>
Cc: <netdev@vger.kernel.org>, <rickywu0421@gmail.com>,
<linux-kernel@vger.kernel.org>, <edumazet@google.com>,
<intel-wired-lan@lists.osuosl.org>, <kuba@kernel.org>,
<anthony.l.nguyen@intel.com>, <pabeni@redhat.com>,
<davem@davemloft.net>,
"Brandeburg, Jesse" <jesse.brandeburg@intel.com>,
"Ruinskiy, Dima" <dima.ruinskiy@intel.com>,
"Lifshits, Vitaly" <vitaly.lifshits@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH v2 1/2] e1000e: let the sleep codes run every time
Date: Mon, 6 May 2024 18:53:14 +0300 [thread overview]
Message-ID: <7f533913-fba9-4a29-86a5-d3b32ac44632@intel.com> (raw)
In-Reply-To: <20240503101824.32717-1-en-wei.wu@canonical.com>
On 03/05/2024 13:18, Ricky Wu wrote:
> Originally, the sleep codes being moved forward only
> ran if we met some conditions (e.g. BMSR_LSTATUS bit
> not set in phy_status). Moving these sleep codes forward
> makes the usec_interval take effect every time.
>
> Signed-off-by: Ricky Wu <en-wei.wu@canonical.com>
> ---
>
> In v2:
> * Split the sleep codes into this patch
>
> drivers/net/ethernet/intel/e1000e/phy.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/e1000e/phy.c b/drivers/net/ethernet/intel/e1000e/phy.c
> index 93544f1cc2a5..4a58d56679c9 100644
> --- a/drivers/net/ethernet/intel/e1000e/phy.c
> +++ b/drivers/net/ethernet/intel/e1000e/phy.c
> @@ -1777,6 +1777,11 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
>
> *success = false;
> for (i = 0; i < iterations; i++) {
> + if (usec_interval >= 1000)
> + msleep(usec_interval / 1000);
> + else
> + udelay(usec_interval);
> +
I do not understand this approach. Why wait before first
reading/accessing the PHY IEEE register?
For further discussion, I would like to introduce Dima Ruinskiy (architect)
> /* Some PHYs require the MII_BMSR register to be read
> * twice due to the link bit being sticky. No harm doing
> * it across the board.
> @@ -1799,10 +1804,6 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
> *success = true;
> break;
> }
> - if (usec_interval >= 1000)
> - msleep(usec_interval / 1000);
> - else
> - udelay(usec_interval);
> }
>
> return ret_val;
next prev parent reply other threads:[~2024-05-06 15:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-03 10:18 Ricky Wu
2024-05-03 18:17 ` Keller, Jacob E
2024-05-06 15:53 ` Sasha Neftin [this message]
2024-05-06 16:46 ` [Intel-wired-lan] " En-Wei WU
2024-05-07 6:21 ` Ruinskiy, Dima
2024-05-07 8:54 ` En-Wei WU
2024-05-07 12:29 ` 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=7f533913-fba9-4a29-86a5-d3b32ac44632@intel.com \
--to=sasha.neftin@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=dima.ruinskiy@intel.com \
--cc=edumazet@google.com \
--cc=en-wei.wu@canonical.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jesse.brandeburg@intel.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rickywu0421@gmail.com \
--cc=vitaly.lifshits@intel.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
all inboxes | Powered by JetHome®