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.8 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 E435CC48BE5 for ; Sat, 12 Jun 2021 18:36:52 +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 0CC55611CD for ; Sat, 12 Jun 2021 18:36:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0CC55611CD 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 17FB480C67; Sat, 12 Jun 2021 20:36:50 +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="El2I5AG5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 24AA680C72; Sat, 12 Jun 2021 20:36:48 +0200 (CEST) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) (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 6F28C80797 for ; Sat, 12 Jun 2021 20:36:45 +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-ed1-x52a.google.com with SMTP id s15so80558edt.13 for ; Sat, 12 Jun 2021 11:36:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:content-transfer-encoding:date:message-id:to:cc :subject:from:references:in-reply-to; bh=GocAwEgHS9QAGfWWEtlJ+Aj65reSqdfypk+yG6G8wGU=; b=El2I5AG5UXGXTJj+VMK4vlikzotBGgvfhOZCTtGAIxuILhDNFyCUs0tzlZfJv1oW9k s7Ye+i0BScwTk1T4U7JKY7nxxxUSzXhFBfunyZzHJ4LRExJv9diNWduGQE7LpScwxEqr eswpoG+hEVmUBE1+idWMY/ize92yAPN607xqDwW+nUgjjINU5M01RUaAuk5yT+NsuSYJ JOced1JBRA57e56ojrGxNVcLR/FcnM/9nU97Qp4xDty/HCrdcpizsyWM7VnnjzMYAdYV bg6ovXugNtK4rxb15QCGrQFTBXwlAln7hIFUSsWEQytKVSRQMuB46ygyN9F4mSuxY5Ak 8qdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding:date :message-id:to:cc:subject:from:references:in-reply-to; bh=GocAwEgHS9QAGfWWEtlJ+Aj65reSqdfypk+yG6G8wGU=; b=Z2SPl0RQA/bVYV7s9owfZqVZDg9Wx6MHxle4TD6iYnzooJdby/FcToVQPY7rNzujyW LscciZYisUVVkd2ARbTVTKXi2vdiYxVwGIcUVMzp9DAEe8yklODW6CgOyFW4GEIP4u+5 dDQ6+95daixZNeKX2z6GvfuJzDgL/be9t6S87IX9FMTTfpToymyS/uktbzW7Ih9Rfro1 0v/2nx7NUifFzbx7WSdNJkEYlfnvZo4M3i/qrthALlU1weAjr8hCp8oPY+vf97W8vvkq AgKirnlFCKpxnod3BXfhr+cCdGC7OBvOOUXT3J12Fccz2DQTk5B2fQQ6SVzqVfICqRY8 1i+g== X-Gm-Message-State: AOAM531UHRfHAQiIREC1QzRI3K0iq1JYOqfN1J7m93J5cT+RvaFrvT2y s8VUMlVL4hUqgOMkZ/VcTzc= X-Google-Smtp-Source: ABdhPJzh6IltOpMeCXqZgN+/HnnqhFNJI1FsBjWdGTIzQw+uCsMwY1/vra5xugxoATQIhHSBb1cdBQ== X-Received: by 2002:a05:6402:26ce:: with SMTP id x14mr9778604edd.104.1623523005174; Sat, 12 Jun 2021 11:36:45 -0700 (PDT) Received: from localhost ([2a00:a040:198:e68a::1004]) by smtp.gmail.com with ESMTPSA id w1sm4321398eds.37.2021.06.12.11.36.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 12 Jun 2021 11:36:44 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 12 Jun 2021 21:36:42 +0300 Message-Id: To: "Daniil Stas" , Cc: "Joe Hershberger" , "Patrick Delaunay" , "Patrice Chotard" Subject: Re: [PATCH] net: dwc_eth_qos: Fix needless phy auto-negotiation restarts From: "Ramon Fried" References: <20210523222449.1495352-1-daniil.stas@posteo.net> In-Reply-To: <20210523222449.1495352-1-daniil.stas@posteo.net> 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.103.2 at phobos.denx.de X-Virus-Status: Clean 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 > 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; > }; > =20 > /* > @@ -591,12 +592,13 @@ static int eqos_start_clks_stm32(struct udevice > *dev) > goto err_disable_clk_rx; > } > =20 > - if (clk_valid(&eqos->clk_ck)) { > + if (clk_valid(&eqos->clk_ck) && !eqos->clk_ck_enabled) { > ret =3D 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 =3D true; > } > #endif > =20 > @@ -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 > =20 > debug("%s: OK\n", __func__); > -- > 2.31.0 Applied to u-boot-net/master, thanks! Best regards, Ramon Fried