Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1971410ybb; Sat, 11 Apr 2020 16:53:16 -0700 (PDT) X-Google-Smtp-Source: APiQypJl2llnlqJYE1EBA5isNzj5gfeUsKwJEYrrTH/LgHGcnrDGE48a5/sfVkzdr+X82KVeN/wT X-Received: by 2002:a05:6214:164c:: with SMTP id f12mr8633065qvw.181.1586649195978; Sat, 11 Apr 2020 16:53:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586649195; cv=none; d=google.com; s=arc-20160816; b=Fdcxs9vQ//6tZlHUtQ7DJ+IgSbgCJVErO/4SExODbxg4IgdHbSu0yRP6/CpVUDVwYu L3mp/jdyJc60UUQww5QsUbJJYYZT3UG6sjQ0QGTquZuS37ECUGXXUyTRfmqWXyJGOSuq tblEHqgLHTqzdpBevd4Roxq/svIRAKLj5kydfKkL1qm/UZgFBoG7f/kLIjhqaUVJvIoI R3pwOtvOGUbIryPdE7j0UUYruI6u1IA3uENEj2/z79e6UNHyI6zqp7T0cdHCQziKRuye qQjdSMsam7lHgq2Gvx+nwcUZcwZPEOAzQXDI2KZNvzdULNdnLXkiuLijUWKmkeCR/CzW e1Lg== 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:message-id:subject:cc:to:from:date :dkim-signature; bh=Ym5/Rs7FQZaQnckyKdQvwOS6ye1oZltesicNVGOVbek=; b=Vozk6FhkD/muOf/v1kcICpa8uP1ulFdOw6aRrNY48HoZnb93sEBTpXHMohfCJQmgI8 lBKq5ttxn72jG7EACMjWzlLXnkNlJsErP0c0UminvIYCoXTwbVsmhnt/1JD5TWWi+n/v dMhwOBMFVYKg0gN0BunMHa652TBmq3dGeJbU6waxL3WoecqbDblznv9QyJe+xNEe2yo3 VOm2cfKtaxt/7HAfJriYBf1Vfc0UsGkaYeH1O66X8UBmPHVIykkTEf4Pgd8uIl/iaQgb fTEvXH2nhQ6b0QVhnJn4YzOI7SdJ8YIaZg8ey80pA7LwV1prencS8SUw0APWp8ItXG92 3b9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IfCoR5ee; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c55si3505342qtb.303.2020.04.11.16.53.01; Sat, 11 Apr 2020 16:53:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IfCoR5ee; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730130AbgDKXud (ORCPT + 99 others); Sat, 11 Apr 2020 19:50:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:55784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727415AbgDKXub (ORCPT ); Sat, 11 Apr 2020 19:50:31 -0400 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8526720936; Sat, 11 Apr 2020 23:50:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586649031; bh=GrmMSd83oRr7yDkchC4S4UHDHr94N0l328ftQ/s1suc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IfCoR5eegu4iaVZvOa1j8RZ/3DrAETQOIkN15zO5inDIcQo7KLjMBOzooL02CI+fJ XkxH1lHcuKkoeEaMA5SyNNlNSoq/RFnb4+lJ6XGyTUOpokevYENX/WXQRmyDKbc34n NRhr5roPXt2fbsXJ+Q2Jf5YXSAkE6cHtJ9gbygC4= Date: Sat, 11 Apr 2020 16:50:29 -0700 From: Jakub Kicinski To: Russell King - ARM Linux admin Cc: Clemens Gruber , netdev@vger.kernel.org, Andrew Lunn , Florian Fainelli , Heiner Kallweit , "David S . Miller" , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] net: phy: marvell: Fix pause frame negotiation Message-ID: <20200411165029.694a1b8b@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20200411234559.GL25745@shell.armlinux.org.uk> References: <20200411165125.1091-1-clemens.gruber@pqgruber.com> <20200411162824.59791b84@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20200411234559.GL25745@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 12 Apr 2020 00:45:59 +0100 Russell King - ARM Linux admin wrote: > On Sat, Apr 11, 2020 at 04:28:24PM -0700, Jakub Kicinski wrote: > > On Sat, 11 Apr 2020 18:51:25 +0200 Clemens Gruber wrote: > > > The negotiation of flow control / pause frame modes was broken since > > > commit fcf1f59afc67 ("net: phy: marvell: rearrange to use > > > genphy_read_lpa()") moved the setting of phydev->duplex below the > > > phy_resolve_aneg_pause call. Due to a check of DUPLEX_FULL in that > > > function, phydev->pause was no longer set. > > > > > > Fix it by moving the parsing of the status variable before the blocks > > > dealing with the pause frames. > > > > > > As the Marvell 88E1510 datasheet does not specify the timing between the > > > link status and the "Speed and Duplex Resolved" bit, we have to force > > > the link down as long as the resolved bit is not set, to avoid reporting > > > link up before we even have valid Speed/Duplex. > > > > > > Tested with a Marvell 88E1510 (RGMII to Copper/1000Base-T) > > > > > > Fixes: fcf1f59afc67 ("net: phy: marvell: rearrange to use genphy_read_lpa()") > > > Signed-off-by: Clemens Gruber > > > --- > > > Changes since v1: > > > - Force link to 0 if resolved bit is not set as suggested by Russell King > > > > > > drivers/net/phy/marvell.c | 46 ++++++++++++++++++++------------------- > > > 1 file changed, 24 insertions(+), 22 deletions(-) > > > > > > diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c > > > index 9a8badafea8a..561df5e33f65 100644 > > > --- a/drivers/net/phy/marvell.c > > > +++ b/drivers/net/phy/marvell.c > > > @@ -1278,6 +1278,30 @@ static int marvell_read_status_page_an(struct phy_device *phydev, > > > int lpa; > > > int err; > > > > > > + if (!(status & MII_M1011_PHY_STATUS_RESOLVED)) { > > > + phydev->link = 0; > > > + return 0; > > > + } > > > > This doesn't address my comment, so was I wrong? What I was trying to > > say is that the function updates the established link info as well as > > autoneg advertising info. If the link is not resolved we can't read the > > link info, but we should still report the advertising modes. No? > > If we report that the link is down, then the advertising modes are > irrelevent. Ugh, these are link partner modes... Applied, thanks!