Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5761703imm; Mon, 23 Jul 2018 05:45:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcf7oDF/0k4NphdTPcXx116p/A5cw5nzq4L4QEGgoKoO5ceo3bs0BpvuipTMjsJ6Y2h/r5A X-Received: by 2002:a65:50cc:: with SMTP id s12-v6mr710152pgp.375.1532349919884; Mon, 23 Jul 2018 05:45:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532349919; cv=none; d=google.com; s=arc-20160816; b=m5aT28VKeQ4qQs8FkUhkZKJsYe/OcJ6TM9MlyUlzpt30FDs/tsmefcoqX0Ivo2SyFI huKB4/QXTvpt1K+Dn54a38n09TF63VZMl7TybIvJE6IssNGLty6qR/oB1S9pT9qrgf66 kcTOE0rp3mT9LINdun6NkdZKKE5AWVKEFSEWrdS9CcwEPHw/oF1OPRk2xpYgvAwvZ/bd dqKnUreYjdO3yOzAbLrMAlkj/lAj0ak/WkH3keVxWLgoOhSQpnE2mgS4LZV6vyoMElnE dlansCkwqwpsJmGWnBW9mglc76xo66ouMYGrSZ3h8+0Ujyq3rPnNxlwbbXaRWKrsi9tI hSsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=F2+y4R3V5Zk4499g7leoHygEykEjbXhSBOrKmetK+3g=; b=qd3VPC07iNsqIoN/eeM3TsYo4+JVUnilFqRWfJYcu3kGW0abiSmHrPwQx2hfQmzMGS XVhgiISMgzZw5oV4ObkZiyPkPwCHm5zHEL+oHh6inXao2pLe2jvzRLiC+J+lwSHUbmyD gQtKkiynZPdgrwve/9n8WHmubiEfoI74Uqvn+PyhpPOr06EpQJqJqaRh1yUsXddJMgqk oSoMOry7lLYv8+Ea8TiUadBivypXkT5DA1SfvJBVTsDruh19YLaq5ixXhKMTT1crkdSa fo9eou7uqMAxsg33XJ0o35Pn1jx044s6EkH2HWXPajaojozTPZWSXlrCiMw6NMuuJTkk Zuag== ARC-Authentication-Results: i=1; mx.google.com; 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 z63-v6si8734415pfi.214.2018.07.23.05.45.04; Mon, 23 Jul 2018 05:45:19 -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; 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 S2388636AbeGWNoA (ORCPT + 99 others); Mon, 23 Jul 2018 09:44:00 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47632 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388242AbeGWNn7 (ORCPT ); Mon, 23 Jul 2018 09:43:59 -0400 Received: from localhost (LFbn-1-12238-233.w90-92.abo.wanadoo.fr [90.92.53.233]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 414AE40B; Mon, 23 Jul 2018 12:42:56 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heiner Kallweit , Andrew Lunn , Florian Fainelli , "David S. Miller" Subject: [PATCH 4.4 012/107] net: phy: fix flag masking in __set_phy_supported Date: Mon, 23 Jul 2018 14:41:06 +0200 Message-Id: <20180723122413.454617395@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180723122413.003644357@linuxfoundation.org> References: <20180723122413.003644357@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Heiner Kallweit [ Upstream commit df8ed346d4a806a6eef2db5924285e839604b3f9 ] Currently also the pause flags are removed from phydev->supported because they're not included in PHY_DEFAULT_FEATURES. I don't think this is intended, especially when considering that this function can be called via phy_set_max_speed() anywhere in a driver. Change the masking to mask out only the values we're going to change. In addition remove the misleading comment, job of this small function is just to adjust the supported and advertised speeds. Fixes: f3a6bd393c2c ("phylib: Add phy_set_max_speed helper") Signed-off-by: Heiner Kallweit Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/phy/phy_device.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -1265,11 +1265,8 @@ static int gen10g_resume(struct phy_devi static int __set_phy_supported(struct phy_device *phydev, u32 max_speed) { - /* The default values for phydev->supported are provided by the PHY - * driver "features" member, we want to reset to sane defaults first - * before supporting higher speeds. - */ - phydev->supported &= PHY_DEFAULT_FEATURES; + phydev->supported &= ~(PHY_1000BT_FEATURES | PHY_100BT_FEATURES | + PHY_10BT_FEATURES); switch (max_speed) { default: