Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp469472yba; Wed, 15 May 2019 04:40:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1N/DXNzcyC89cUQTjo/L3c5GLd7+A1reFPkcIx6X/7RbmAjGOLFH+GTgIMKQCRve34Eml X-Received: by 2002:a63:5105:: with SMTP id f5mr27323711pgb.373.1557920452857; Wed, 15 May 2019 04:40:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557920452; cv=none; d=google.com; s=arc-20160816; b=C4VX3bM94MYf1FT6VRL+SlPDX5Xzrk2NOK8hUT6olBv6HIfmqiX+R9/dUb0nckGemU kcqT9ahwGwdroUMjTAiEQMzAcX+wRVrT3sUEFcjAlXssgr1TWmFCYAvGHV+2TWikBupj bI2TCRR+SLmy/UAbPrtf2fh+8aIAeAn7pqGyNgL9/vhl5iWnNXADAOZBArBRUWXkgWDD VS/kkXtwEbJkgj1RJScLmV0P2xGhlvrBhsQ8sXG2ENA0v90zLIdSW1JGs5lOsdArgBTO zWpy4IIztWTwiQNCUJjUYZZoxht8LUOkPbbTILRzV9gyEUEOUn7fFiTMbe48YS93J1Vc 85dQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vIMLwadnIeeTwiGIQVYJt9ica++QTHpacTL0E93afr8=; b=NIVro3GsCnp75I0e46cFV0ujgEYcW7dHv6Q6iIP0Y2UvAVFQvbtwkY2Q+JWGV3t/AN Wlajk3oDsfqmxWEV2eFdg4RZkMYzSykyh9t0s/lHaNr9yUy7ksbUT4wiKnB8QwcTFlZy zmIA3v+z7Y6r1w4NKId62WfeQf/F0/V+DUfyAtKHslwp94bCoyNFMotbxEMAhH7vAh66 WM/+zE5aKURtrujawW2v1gORMq68ihZv1VmfzuJfVuvShtLLBGECe8Vi78ebxQljeKG0 9CMn5hUeHNRAcFsaszvkrstg1IB9663Cp6pB4TP+8w8doyeGwqzY8mHFOruDWim13FMM lT2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gcuTpVYW; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 76si1601839pgf.582.2019.05.15.04.40.37; Wed, 15 May 2019 04:40:52 -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=gcuTpVYW; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733028AbfEOLhh (ORCPT + 99 others); Wed, 15 May 2019 07:37:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:43606 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732926AbfEOLbs (ORCPT ); Wed, 15 May 2019 07:31:48 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 3C81E2084F; Wed, 15 May 2019 11:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919907; bh=nwtm9ZWmzDSxG7h7/BFWe85TLgDGFIA/dCFejYmg5e8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gcuTpVYWo1OjwjptSNDUVg27WG/VZRUbUJ/t+WmJE3RJDzuCMR5Q5p1/xbXRXXEH1 45/keybPvXAhWH6v59CjIvfVMjIMNyQybwBVwFxROXm7hDRoKYM/kyeavQtFXhRuc/ ACns7V1ANNqZICaiTTfrcDwtRr4lqC7NLYToS1mc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heiner Kallweit , "David S. Miller" Subject: [PATCH 5.0 125/137] net: phy: fix phy_validate_pause Date: Wed, 15 May 2019 12:56:46 +0200 Message-Id: <20190515090702.949753637@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090651.633556783@linuxfoundation.org> References: <20190515090651.633556783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Heiner Kallweit [ Upstream commit b4010af981ac8cdf1f7f58eb6b131c482e5dee02 ] We have valid scenarios where ETHTOOL_LINK_MODE_Pause_BIT doesn't need to be supported. Therefore extend the first check to check for rx_pause being set. See also phy_set_asym_pause: rx=0 and tx=1: advertise asym pause only rx=0 and tx=0: stop advertising both pause modes The fixed commit isn't wrong, it's just the one that introduced the linkmode bitmaps. Fixes: 3c1bcc8614db ("net: ethernet: Convert phydev advertize and supported from u32 to link mode") Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/phy/phy_device.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -2083,11 +2083,14 @@ bool phy_validate_pause(struct phy_devic struct ethtool_pauseparam *pp) { if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT, - phydev->supported) || - (!linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, - phydev->supported) && - pp->rx_pause != pp->tx_pause)) + phydev->supported) && pp->rx_pause) return false; + + if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, + phydev->supported) && + pp->rx_pause != pp->tx_pause) + return false; + return true; } EXPORT_SYMBOL(phy_validate_pause);