All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "Ramon Fried" <rfried.dev@gmail.com>
To: "Daniil Stas" <daniil.stas@posteo.net>, <u-boot@lists.denx.de>
Cc: "Joe Hershberger" <joe.hershberger@ni.com>,
	"Patrick Delaunay" <patrick.delaunay@foss.st.com>,
	"Patrice Chotard" <patrice.chotard@foss.st.com>
Subject: Re: [PATCH] net: dwc_eth_qos: Fix needless phy auto-negotiation restarts
Date: Sat, 12 Jun 2021 21:36:42 +0300	[thread overview]
Message-ID: <CC1UVF5KX51U.T5ALTMCV25D8@stdcall-pc> (raw)
In-Reply-To: <20210523222449.1495352-1-daniil.stas@posteo.net>

On Mon May 24, 2021 at 1:24 AM IDT, Daniil Stas wrote:
> Disabling clk_ck clock leads to link up status loss in phy, which
> leads to auto-negotiation restart before each network command
> execution.
>
> This issue is especially big for PXE boot protocol because of
> auto-negotiation restarts before each configuration filename trial.
>
> To avoid this issue don't disable clk_ck clock after it was enabled.
>
> Signed-off-by: Daniil Stas <daniil.stas@posteo.net>
> Cc: Ramon Fried <rfried.dev@gmail.com>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
> Cc: Patrice Chotard <patrice.chotard@foss.st.com>
> ---
> drivers/net/dwc_eth_qos.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
> index e8242ca4e1..2f088c758f 100644
> --- a/drivers/net/dwc_eth_qos.c
> +++ b/drivers/net/dwc_eth_qos.c
> @@ -321,6 +321,7 @@ struct eqos_priv {
> void *rx_pkt;
> bool started;
> bool reg_access_ok;
> + bool clk_ck_enabled;
> };
>  
> /*
> @@ -591,12 +592,13 @@ static int eqos_start_clks_stm32(struct udevice
> *dev)
> goto err_disable_clk_rx;
> }
>  
> - if (clk_valid(&eqos->clk_ck)) {
> + if (clk_valid(&eqos->clk_ck) && !eqos->clk_ck_enabled) {
> ret = clk_enable(&eqos->clk_ck);
> if (ret < 0) {
> pr_err("clk_enable(clk_ck) failed: %d", ret);
> goto err_disable_clk_tx;
> }
> + eqos->clk_ck_enabled = true;
> }
> #endif
>  
> @@ -648,8 +650,6 @@ static void eqos_stop_clks_stm32(struct udevice
> *dev)
> clk_disable(&eqos->clk_tx);
> clk_disable(&eqos->clk_rx);
> clk_disable(&eqos->clk_master_bus);
> - if (clk_valid(&eqos->clk_ck))
> - clk_disable(&eqos->clk_ck);
> #endif
>  
> debug("%s: OK\n", __func__);
> --
> 2.31.0

Applied to u-boot-net/master, thanks!

Best regards,
Ramon Fried

      parent reply	other threads:[~2021-06-12 18:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-23 22:24 [PATCH] net: dwc_eth_qos: Fix needless phy auto-negotiation restarts Daniil Stas
2021-05-23 22:24 ` [PATCH] spi: stm32_qspi: Fix short data write operation Daniil Stas
2021-05-24  7:40   ` Patrice CHOTARD
2021-05-24 12:53     ` Daniil Stas
2021-05-25 16:02       ` Patrice CHOTARD
2021-06-18  8:01         ` Patrice CHOTARD
2021-06-01 15:31   ` Patrick DELAUNAY
2021-05-24  8:30 ` [PATCH] net: dwc_eth_qos: Fix needless phy auto-negotiation restarts Patrice CHOTARD
2021-05-25  6:53 ` Ramon Fried
2021-06-01 15:26 ` Patrick DELAUNAY
2021-06-12 18:36 ` Ramon Fried [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=CC1UVF5KX51U.T5ALTMCV25D8@stdcall-pc \
    --to=rfried.dev@gmail.com \
    --cc=daniil.stas@posteo.net \
    --cc=joe.hershberger@ni.com \
    --cc=patrice.chotard@foss.st.com \
    --cc=patrick.delaunay@foss.st.com \
    --cc=u-boot@lists.denx.de \
    /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.