Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3151069ybt; Mon, 22 Jun 2020 16:40:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhE23079YI1vm1ug4mJ33WaS0vFTNTp3O7bVysku+cGFL222pf12Yh0rKHLJkSXKhNhpyb X-Received: by 2002:a17:906:b88d:: with SMTP id hb13mr18186154ejb.96.1592869244955; Mon, 22 Jun 2020 16:40:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592869244; cv=none; d=google.com; s=arc-20160816; b=GXxT/+pvKhjvedTveGkaQdV6tvS7H7NF7geGw0Y6mtXusvoAu3hLkksV0zy5yevFFn 8bbeLm1VjbZaj9b1F+fAUtalPKIF2MzRcRO1+ABWGvRHIBjaBCj5dEIyyO5fTR2hIGod TL9pbo2/dzbawfUKkVhPvBqz3H6mXAjjP3eeeQiaBCNRz31HuHDd6qCkG2RTJ1tqvZ1r xdLotroUPIDBoQxhto6/dT61mEpBavK/GpdedmRUaolEyOgzS5CzJ9e6VTm9m8p+0fyK UeDtQMfF9l90NyOFIc0SlFCz6CE8RtFB803fudDZgiSBHbj+1Q5avlYwRM64bJW6JYmo YtYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=hAl1QsQCrNpsr/aI47UeBgsZzDyAzJWGQWCyFNcQBfU=; b=YhLNUWJM15i1LQD82PjgAtTN2Z7UL7/nb1jzfxRl4YVQJ0ToA6mQ6fgbEQYeFYOAVA 0HLIT35MYtPROVmikK6qqKaP2kmsCiyrCtR33yj2dFReS5b2UwD9cP9gEvUtv+ne5Wpb 0v+d9Y7mvfLU2FDsVFcdc5q2/qzMJFXAXscOfmAWjCDgJQ5HkyUFPv47Vlm/TsWArEDY Ym38Mcetu19SSy4JFQsDU3n3gJdWpM1OA4hD/rLknLM16Xk6U3N+xOtWR3bi+Y1cKH+P cCoysl5V0UjGVJCAaUbWleNiqAtzzzuv0Sx4qOdeAqwjr6xtddZFomkt77NBUEZUv4Aj vrYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y5si9746355edu.279.2020.06.22.16.40.21; Mon, 22 Jun 2020 16:40:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731338AbgFVXKC (ORCPT + 99 others); Mon, 22 Jun 2020 19:10:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730785AbgFVXKB (ORCPT ); Mon, 22 Jun 2020 19:10:01 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C220CC061573; Mon, 22 Jun 2020 16:10:01 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id F3E831296FB73; Mon, 22 Jun 2020 16:10:00 -0700 (PDT) Date: Mon, 22 Jun 2020 16:09:59 -0700 (PDT) Message-Id: <20200622.160959.832115149084246410.davem@davemloft.net> To: zhengdejin5@gmail.com Cc: andrew@lunn.ch, f.fainelli@gmail.com, hkallweit1@gmail.com, linux@armlinux.org.uk, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kgroeneveld@gmail.com Subject: Re: [PATCH net v3] net: phy: smsc: fix printing too many logs From: David Miller In-Reply-To: <20200620145534.10475-1-zhengdejin5@gmail.com> References: <20200620145534.10475-1-zhengdejin5@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 22 Jun 2020 16:10:01 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dejin Zheng Date: Sat, 20 Jun 2020 22:55:34 +0800 > Commit 7ae7ad2f11ef47 ("net: phy: smsc: use phy_read_poll_timeout() > to simplify the code") will print a lot of logs as follows when Ethernet > cable is not connected: > > [ 4.473105] SMSC LAN8710/LAN8720 2188000.ethernet-1:00: lan87xx_read_status failed: -110 > > When wait 640 ms for check ENERGYON bit, the timeout should not be > regarded as an actual error and an error message also should not be > printed. due to a hardware bug in LAN87XX device, it leads to unstable > detection of plugging in Ethernet cable when LAN87xx is in Energy Detect > Power-Down mode. the workaround for it involves, when the link is down, > and at each read_status() call: > > - disable EDPD mode, forcing the PHY out of low-power mode > - waiting 640ms to see if we have any energy detected from the media > - re-enable entry to EDPD mode > > This is presumably enough to allow the PHY to notice that a cable is > connected, and resume normal operations to negotiate with the partner. > The problem is that when no media is detected, the 640ms wait times > out and this commit was modified to prints an error message. it is an > inappropriate conversion by used phy_read_poll_timeout() to introduce > this bug. so fix this issue by use read_poll_timeout() to replace > phy_read_poll_timeout(). > > Fixes: 7ae7ad2f11ef47 ("net: phy: smsc: use phy_read_poll_timeout() to simplify the code") > Reported-by: Kevin Groeneveld > Signed-off-by: Dejin Zheng Applied and queued up for -stable, thanks.