Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3423866pxf; Mon, 29 Mar 2021 01:39:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYhSLfpROAuskaibGyXzRepWrKm9HIl8aiigeY7f0a9xAwXMZm8DljKSreHiwJNDqQkmad X-Received: by 2002:a05:6402:4245:: with SMTP id g5mr27710366edb.306.1617007175975; Mon, 29 Mar 2021 01:39:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617007175; cv=none; d=google.com; s=arc-20160816; b=y7QHQvQvD/RpZCXwTAzFMJiMKMVy6xQ8OXVZUGZPzFvKlnWnQPuMkhUiGc76pe+Tpv auAHlKWisds0IfY+zaiaJvbF/4YoxwRb7hhSyQCNoYx76aFRXaKN9NiTXdDZGhksi7Fk p5ABmw75O0ogJc9rkLQi/JuIhLuuBh+rZAP+BhhhTlFU51bbkY/t+WCSWYWRanr4uE7b /P+Ezshj3ySzYuUUkdVkGOGXemohvNj/I5VxkbC2wvpXU0eoXZqQqOhm1mHHE5TpbJ7I HqUKDbfiTMOE017BqZaeJ9XhaugBtdoYLy1ygZplDsVl3VPEmMqQeDaaVwNdsqb5zzw7 KUtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=R+ispLR3KcpLoL1MbAqepyI71SHZ5luyIC7Ajx+YsPw=; b=pJ17LmRU/+ysg3qT0YRSU04x0DuuAKIpWSm80qlsCa2k1lElWSN+6eznp+ui6CbdgS JMGIOtEIm7xjUllYQSroUXn+fVqiPBp8nthEBT2rpxJ9tzutw9Q3UQIDkh/QlNmpzkbD 9zxSeOckqm+vKzCvyuSK5gkr4n8yiTbswD/DAH0EG+x/be3kNwXkTbLeTrW4qidVvryF ho7vxus1VdxOpFWkBnx2e0hbUVnM9I75dVNceg7Lb1kzyR/zZBM2j3cACX32ZZ7La7KG 7V0HvDyTa9dEFHuM+5nk1e1STzIpE7KBTl5KEhWEOOHGAypsuAbSsN+nNM/HumgGzvSo M3GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nw4foYdH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g24si12109038ejw.478.2021.03.29.01.39.13; Mon, 29 Mar 2021 01:39:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nw4foYdH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234642AbhC2IhD (ORCPT + 99 others); Mon, 29 Mar 2021 04:37:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:39408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233962AbhC2IWm (ORCPT ); Mon, 29 Mar 2021 04:22:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 70E7461601; Mon, 29 Mar 2021 08:22:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006162; bh=aQL8e2UvMAXGXiDvf3F/f1tSQeYBEynMdQ5zlvgXOe0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nw4foYdHU4E3BFBR9hSrkERqHkNADdYmbvy3NPQ82WHfyAN83imCYcm2SKQVYLVAK x0D3DRRhXBg9RUBH1XbciG3pYhAVGSSynnKP0YFgGjY+sMPsf554zKJTDSBVtVhlcf FHrVBV2MSjLaNQtVzlfQrQFy14GsVPknjkxGplRo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Fainelli , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 104/221] net: dsa: bcm_sf2: Qualify phydev->dev_flags based on port Date: Mon, 29 Mar 2021 09:57:15 +0200 Message-Id: <20210329075632.682144609@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Florian Fainelli [ Upstream commit 47142ed6c34d544ae9f0463e58d482289cbe0d46 ] Similar to commit 92696286f3bb37ba50e4bd8d1beb24afb759a799 ("net: bcmgenet: Set phydev->dev_flags only for internal PHYs") we need to qualify the phydev->dev_flags based on whether the port is connected to an internal or external PHY otherwise we risk having a flags collision with a completely different interpretation depending on the driver. Fixes: aa9aef77c761 ("net: dsa: bcm_sf2: communicate integrated PHY revision to PHY driver") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/dsa/bcm_sf2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c index edb0a1027b38..510324916e91 100644 --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c @@ -584,8 +584,10 @@ static u32 bcm_sf2_sw_get_phy_flags(struct dsa_switch *ds, int port) * in bits 15:8 and the patch level in bits 7:0 which is exactly what * the REG_PHY_REVISION register layout is. */ - - return priv->hw_params.gphy_rev; + if (priv->int_phy_mask & BIT(port)) + return priv->hw_params.gphy_rev; + else + return 0; } static void bcm_sf2_sw_validate(struct dsa_switch *ds, int port, -- 2.30.1