From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9671C2B9F8 for ; Tue, 25 May 2021 06:53:37 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B862761400 for ; Tue, 25 May 2021 06:53:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B862761400 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9287181F66; Tue, 25 May 2021 08:53:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="n5eq8O4d"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 670FE81F66; Tue, 25 May 2021 08:53:32 +0200 (CEST) Received: from mail-oo1-xc30.google.com (mail-oo1-xc30.google.com [IPv6:2607:f8b0:4864:20::c30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9410A82CDD for ; Tue, 25 May 2021 08:53:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rfried.dev@gmail.com Received: by mail-oo1-xc30.google.com with SMTP id i8-20020a4aa1080000b0290201edd785e7so6933512ool.1 for ; Mon, 24 May 2021 23:53:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lJ1RjMCy8viNomGUZNfq2YFQhOT7cq7CEfPmctRKUtg=; b=n5eq8O4dtJ7qWg5CH10i59kXLTIzplqNVtuYPgm7O/2CtF+eSVQFsitVLikijo3Ydq oWweHIOGzhGq8Fl8Tm+yzirOpN77Xz2Gy5jgAA9pTgGa8nDzvbWFXi+5CuMd4htnI4tP uEL8z3w2EPhqaMQvOKwtUH3aw6aPMqZxGfN8rTVlA+t0PillEjr9RsoTYa7j5LmNfrbz KmBVhTdlkxqxP4yJSzNbveWNFg35Ue6kJQRlakIbQkDLvwwx/B4aeI45YzRpfP0/6C7e EJUambGhO2GnHeVWF47rrBkd7EhZ1f+etAbdV6VTC513mdbjVhhenpwbMc/M5/1eOOZA Cclg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lJ1RjMCy8viNomGUZNfq2YFQhOT7cq7CEfPmctRKUtg=; b=Wr+KP7xwGAW1CwXF8CNtiXvWEjuFTNitiJWQM4cfiv+QIWXYoZSQpo/lmXqV9VYjQs 56pewugYFrRjhWV5CuLBSrQcoOfWySboyJgsl/RCPihFly3Y/LDi/zu0E5LjsGKNzKza +lCpLaE7DNb94VR709rGOa/ht22vG6pgbUEYtJvpyumokhqtDBRYHfQGR9Nez4xdCypZ Ui91sAgYoOSb+EFMhtO3EqKQ8jBI+LMvHAez31LP5uuaDDehYNBmP1Jj8LMqDFqGoGJQ VTXgkjqnAejF9gtS4Tp/y9C1g1i5UWYA3LRd9CL9tb1qhHNG5q81cN2q/dM+Hm3zdmim pkig== X-Gm-Message-State: AOAM532UuAil5odV3Y/+80O8xi08KWeQHvOfP0B6OCd4MgnXDWXV6L9D 9K+r1mjqA65X+6dmOA4becqIMwHD6MTj37UNyvU= X-Google-Smtp-Source: ABdhPJxaR5ROUBbCTxBg898RQYDHpR0uKFxLrn54RR9Rf0BrJV2b6o2qWeXLOun+vYSfbviWRjnEkyS2F+ZhVpqK0WM= X-Received: by 2002:a4a:dc4e:: with SMTP id q14mr21372697oov.43.1621925608240; Mon, 24 May 2021 23:53:28 -0700 (PDT) MIME-Version: 1.0 References: <20210523222449.1495352-1-daniil.stas@posteo.net> In-Reply-To: <20210523222449.1495352-1-daniil.stas@posteo.net> From: Ramon Fried Date: Tue, 25 May 2021 09:53:17 +0300 Message-ID: Subject: Re: [PATCH] net: dwc_eth_qos: Fix needless phy auto-negotiation restarts To: Daniil Stas Cc: U-Boot Mailing List , Joe Hershberger , Patrick Delaunay , Patrice Chotard Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean On Mon, May 24, 2021 at 1:18 AM 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 > Cc: Ramon Fried > Cc: Joe Hershberger > Cc: Patrick Delaunay > Cc: Patrice Chotard > --- > 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 > Reviewed-by: Ramon Fried