Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1380409ybt; Sat, 20 Jun 2020 08:46:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7LtPz9QpBjeiJPlaHTD9am4Jha2VsbzOkdkDLa69nTiJymYdVv0dobrhiL6MiDj37FtVk X-Received: by 2002:a17:906:d961:: with SMTP id rp1mr8755170ejb.118.1592667988340; Sat, 20 Jun 2020 08:46:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592667988; cv=none; d=google.com; s=arc-20160816; b=bATGucl3Luu+ylMgYRF4RM9cVxwjVyPToxJGErjFEbOlF8FFSuJLXy3QS1a3wGZgfs DafWRC8FwSaiEtlPxvmoELWRFJFu+owaeRoN/2wXhyvbQQcU5NHuQlSDQo6/AoDbFwZE ismbYVvcD7y3yxseKIqTUYKtdm8er+MS5Yxgakyzi5+58on4H0GuEJXStVUVBtndd2r7 GI38thaIS47oiUHqsd8LX+mgB3r35BCjCxdUM08gt4OwrZ33sjC6p4OveNQOLE9/X8XA vu/JsaHXfxHPHOd0Vc7AyDxN4yKK8T6kucZoGGKxP7GgDJ810m1H73dSHZDBccjodbB4 7USw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=pW2jhMZ2OTLXeKQo+YTruBbLZ2t9g8hL1c8xHJX6lhI=; b=IeKI8maoeb6b+29anj/Lb1IcKh2s+DTyecn8qQ1SeC7T1QJZmOrnpJI68PrV5AhcdV AA1xEe2evDdq8tG33BJtTwO3Z8xq65tMITVxl9xM5/2ocHsxV6ozItzvHgzC4Vlh5HUb CVDGwKCS2aX8VH6dQhbBx9HrAecLvxIHXI8odFISG7fI0qp/stZ4wAgVu9jbCjk7nF1r SGcUBsHiJWeMojiCeFwnEZTGDEIrSOU1Ylhk6Kxx3m6sPZQA7EFxCcB2A2dtTzqOiaj+ TfcCuCQ8qc2iVycAW6nXbwiYU9vv1BK6va1vNeGQjJxyybRVf7zQyCdUMkzrOIA4Ahto 6sAQ== 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 v1si3683238ejd.249.2020.06.20.08.46.05; Sat, 20 Jun 2020 08:46:28 -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 S1727798AbgFTPlg (ORCPT + 99 others); Sat, 20 Jun 2020 11:41:36 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:50164 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725826AbgFTPlW (ORCPT ); Sat, 20 Jun 2020 11:41:22 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1jmfcK-001PRr-Mj; Sat, 20 Jun 2020 17:41:16 +0200 Date: Sat, 20 Jun 2020 17:41:16 +0200 From: Andrew Lunn To: Dejin Zheng Cc: f.fainelli@gmail.com, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Kevin Groeneveld Subject: Re: [PATCH net v3] net: phy: smsc: fix printing too many logs Message-ID: <20200620154116.GP304147@lunn.ch> References: <20200620145534.10475-1-zhengdejin5@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200620145534.10475-1-zhengdejin5@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 20, 2020 at 10:55:34PM +0800, Dejin Zheng wrote: > 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 Reviewed-by: Andrew Lunn Andrew