Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp467544yba; Wed, 15 May 2019 04:38:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgClZbxA1hnpgNuxOhC3tjinxWUFo1gF8zRtliTf+BFPmDrj6Lrg1n5+hbdLh72nsbiBR9 X-Received: by 2002:a63:2c4a:: with SMTP id s71mr26773387pgs.343.1557920302856; Wed, 15 May 2019 04:38:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557920302; cv=none; d=google.com; s=arc-20160816; b=yArHMq0ycvHUZnXGkwTxFVEWfRWLHSZtWTFMS/eSj90lkmH6PQlCvHYoVmPIyYzbQA 6ZoJgGm4nKEZRZslEAIn4YzUOrxg217tXzyUhb9R9qT2Ox9aEhlpc4oDXgquk41MaybL DCnzdfmh+dik9UC6qrX87vclkuO8Kqnft2epQ2vqtyFVaL6CSV9YamGKE4fRituZc6g3 jKMFYrcUzJn2cRLeI+YCciXSv9ziP5F5JPCcfqfEh8sDDYSRv5DsarTtBNNg8HNHt74s bMFu7TzjciaLyqTRbupo/UxUi9HBSb/lOTuqJphVvi4GZwVhFOj0YhwA/mvcBGg1pe8O l3bw== 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=Q1W5DDMHL4nF1WLv5omOXe5Eu0vZnnNkgztm5EDvwaU=; b=NAxIA1OpoclqudYAUwIP5FjqvQgzcvP25Ox8FwX8CTxJhXcLl8wZRTBqeT3dPWYZTZ 9uMD8FxSGE7XtKIqPzAVXiDB6rjBodl0a+JeQESTsfml6Im/pZL2lF/2BUmndUMPVsZB fEpI1IRH6mOQOi8jlQ6nK3WteStM2Zc8lnZO5HJmDD68rmPBwHN39NX8Frchg7C5dGvY fny0h+6sY5a3s243wq8DpMsy8mZOGC+1XzLeVZ+tEQowjZiAh8DkB+2SHKGrGR93A+x0 pSsqXj+nt3of4wK/CM8Tqx3H1hy5Fh9rwa7LV4ZDgsKtL3H7QMJIz+EUBKIauDUzQfxV SUIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tvO3fCgi; 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 x29si1623632pgl.194.2019.05.15.04.38.08; Wed, 15 May 2019 04:38:22 -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=tvO3fCgi; 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 S1733238AbfEOLdl (ORCPT + 99 others); Wed, 15 May 2019 07:33:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:45588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732631AbfEOLdj (ORCPT ); Wed, 15 May 2019 07:33:39 -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 E637A206BF; Wed, 15 May 2019 11:33:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557920018; bh=5un5W7faLGTbnVrsHgs32zUEtDbsdaDzzdUCFtETPGg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tvO3fCgibXFhI7sBia0ZwrsB51qQi/g+x1WD1fmaztap3VRDUD02hJJsqERqoEqOw K8EYzapJPWfd42dr2kpnptir+ml/jQlARVRG9ufsRhRSDGS5HG7GCA6Kx76L+t2E/e Y4Ufm/+SevyL2KcHGzc8YM5wCKZKa8L1kmSJyZN8= 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.1 34/46] net: phy: fix phy_validate_pause Date: Wed, 15 May 2019 12:56:58 +0200 Message-Id: <20190515090627.120276402@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090616.670410738@linuxfoundation.org> References: <20190515090616.670410738@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 @@ -2044,11 +2044,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);