Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp814866ybl; Wed, 11 Dec 2019 07:56:40 -0800 (PST) X-Google-Smtp-Source: APXvYqxI18IJ3cseQEXsp8ISK/zRSsmwkXOq/8vOxdRvww64s1eOf4R7uLI23oIdxTc9XYOyDApo X-Received: by 2002:a9d:630d:: with SMTP id q13mr2622688otk.31.1576079800666; Wed, 11 Dec 2019 07:56:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576079800; cv=none; d=google.com; s=arc-20160816; b=qhAJGAdyKBmIxP0ajISMfyNgAGQc2uEq6ko40VxDyCSp3RTc1E36cGrZQ8ANXKhECX afHSCnfCjBRKIy8GYyOTLBI01KUbzKrprQw+Z+d83DrDiuowMOLhVQ8kKsiYtdFH5ZIK PAvi2iDDefUn6/myiWJKWRTwRSVF3g3bbE9Jv2h7flzgw05qxNlqlPrflvjm9Fox6i1y +lS2fjDJdb9xqQcU4tn2LtQ2t92gQY0an6kFfiVZSZwXdDcIa500cL0202Fbg6X6nLOG D+UKmBfKlCp+LdLCq32D1K9K9Vf7EuaGpCfGS5vgyog6j/g+wEb5gd7VZxdmMup0htu0 ltTg== 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=nok5Ffr9mQ4v+GInIqMTUxZ0/CGRKlWxKyP4BvniL+E=; b=P3Ssx3Ylfp94oJ54YiyTiVvovLKUwtmh1R8HoPNdFKyAxxxmw3nciBNBUHYVGVtMSi IqDBagpeNgqTBQMHgr/rNYeW1fIt4Yo/f6CFlDu0ZjA8PfZE7U+aPy1ZAbc4kbctyv77 3BF1RVXVOitwt3Y5MvU7YoKLsc68Ijgcz8upjAteO5Moo+tIRuiQp6VYt0aRUw2zgXCJ dbwvcLiH4uQKh0+659QbOQQV3lYUwWN1WdgryAtNVgEFpGtb2b/Vy4aihQ1cVqsisapo CJIGYi+tf9Sh6qga3NOeZ9Vtn3+ttZS+rnQ54eaATrjhRa9ed86VAUqVwjnSwMPpoJT/ jA3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZaYASGxI; 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 m24si1271091otn.67.2019.12.11.07.56.26; Wed, 11 Dec 2019 07:56:40 -0800 (PST) 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=ZaYASGxI; 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 S1731913AbfLKPRz (ORCPT + 99 others); Wed, 11 Dec 2019 10:17:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:45494 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731235AbfLKPRy (ORCPT ); Wed, 11 Dec 2019 10:17:54 -0500 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 44DF42073D; Wed, 11 Dec 2019 15:17:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077473; bh=8013jwBuvI1srCrDO5iwcCxUJN4JuFZEz6Kzc/43Vz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZaYASGxIul/32e6kdzdmXCZ84VhrUQj6Ym9vQhrtoc9xV+pwBYG/bP3+wtEar3VnS H/8Z7/9YZrECZRIy1nWdKEYr21j2VO3YBXu+Dgqllk5zmVSrH5nx9eKHJvf0GU3g3G 9JnDmKI+6saQ6jf4NpFNXy1StGi3Q2E4VfUzGGGU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Healy , Andrew Lunn , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 052/243] net: dsa: mv88e6xxx: Work around mv886e6161 SERDES missing MII_PHYSID2 Date: Wed, 11 Dec 2019 16:03:34 +0100 Message-Id: <20191211150342.605556169@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@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: Andrew Lunn [ Upstream commit ddc49acb659a2d8bfc5fdb0de0ef197712c11d75 ] We already have a workaround for a couple of switches whose internal PHYs only have the Marvel OUI, but no model number. We detect such PHYs and give them the 6390 ID as the model number. However the mv88e6161 has two SERDES interfaces in the same address range as its internal PHYs. These suffer from the same problem, the Marvell OUI, but no model number. As a result, these SERDES interfaces were getting the same PHY ID as the mv88e6390, even though they are not PHYs, and the Marvell PHY driver was trying to drive them. Add a special case to stop this from happen. Reported-by: Chris Healy Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/dsa/mv88e6xxx/chip.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 411ae9961bf4f..43b00e8bcdcd7 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -2645,11 +2645,22 @@ static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg) mutex_unlock(&chip->reg_lock); if (reg == MII_PHYSID2) { - /* Some internal PHYS don't have a model number. Use - * the mv88e6390 family model number instead. - */ - if (!(val & 0x3f0)) - val |= MV88E6XXX_PORT_SWITCH_ID_PROD_6390 >> 4; + /* Some internal PHYs don't have a model number. */ + if (chip->info->family != MV88E6XXX_FAMILY_6165) + /* Then there is the 6165 family. It gets is + * PHYs correct. But it can also have two + * SERDES interfaces in the PHY address + * space. And these don't have a model + * number. But they are not PHYs, so we don't + * want to give them something a PHY driver + * will recognise. + * + * Use the mv88e6390 family model number + * instead, for anything which really could be + * a PHY, + */ + if (!(val & 0x3f0)) + val |= MV88E6XXX_PORT_SWITCH_ID_PROD_6390 >> 4; } return err ? err : val; -- 2.20.1