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=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no 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 F1899C433DF for ; Mon, 22 Jun 2020 23:10:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D079C206E2 for ; Mon, 22 Jun 2020 23:10:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731371AbgFVXKC (ORCPT ); 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.