From patchwork Fri May 31 14:24:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enguerrand de Ribaucourt X-Patchwork-Id: 13681751 X-Patchwork-Delegate: kuba@kernel.org Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 616251B812 for ; Fri, 31 May 2024 14:24:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=208.88.110.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717165485; cv=none; b=R0G8tTERh6FNaj8gyCqYfSHtDy+NqwKzUEtC44O25YrSyffK4wNhJ0pisdsEBkYfQH1T7Tdmlk4ZoMVEVtJdtjzmpTDYAdcnt7GnAFj+gg1TtrQk8qZmGYJNPrludMCQJziSs1dyfn8UzblOjVy/wzfUWwToJ3APB1acscmDLy4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717165485; c=relaxed/simple; bh=F/lC81aXVeUBqq3h4uAuT4G8dbDnChzUbZFxu3OH0Pc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=M3HEBfT91UWpFj/xL+16GBxX9XCIJppkQwcetHmSgUHjCMmpCPUTxnQ21H7zhtfKr/BK4RQsBY4rw9sQyFr+Fw02EAQIKChI09cwryxnsDZHAIKJSxMTy64xLs1F11Y3EWIvGA8OMYIZOo6KS4fwhKrJ8r1F68BWTNkAVKp6+Fw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com; spf=pass smtp.mailfrom=savoirfairelinux.com; dkim=pass (2048-bit key) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.b=jStJaSaa; arc=none smtp.client-ip=208.88.110.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=savoirfairelinux.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.b="jStJaSaa" Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 0CA639C34B5; Fri, 31 May 2024 10:24:42 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id 4_BuAkUUgsSV; Fri, 31 May 2024 10:24:41 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 0CEC29C32FC; Fri, 31 May 2024 10:24:41 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 0CEC29C32FC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1717165481; bh=LWQF28JPL5s3Fgvw2CqqQV0SIuI0xDj9KUU7AGLLXfw=; h=From:To:Date:Message-Id:MIME-Version; b=jStJaSaaI/cEi/EWuMMCwqwi3U4CcYqzuEuTdk/uDzDHuvjMAED+BtA7PyASPHcLI XC+XzdoT/iEMKB+nEeQjRESYaB0QKxWw41ApRDf6VoyJcYx/Wu1Ibq42kqQYMc0/xd oSY2RtdpCzTdkvpdUFESju8mgoHB2CTOmpLwl0XRnx0heu3DxadrsbK6OGF4jIJhrO w7See49jFFqvdXADWLyfX/5BraVSryXpp+Xr1GThUgyuiLpeAuVusvoyAZK/uN+WTp vlXzEdbdbPlh2Gi+1fmKNqc1H8aEvM2Mz4Gh22VCaJGN27GhtmcZaV9MWZQwD+UgNW 8PWi9p2KX6oug== X-Virus-Scanned: amavis at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10026) with ESMTP id YDyPLlVayKkQ; Fri, 31 May 2024 10:24:40 -0400 (EDT) Received: from sfl-deribaucourt.rennes.sfl (lmontsouris-657-1-69-118.w80-15.abo.wanadoo.fr [80.15.101.118]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 1C36E9C405E; Fri, 31 May 2024 10:24:40 -0400 (EDT) From: Enguerrand de Ribaucourt To: netdev@vger.kernel.org Cc: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, woojung.huh@microchip.com, UNGLinuxDriver@microchip.com, Enguerrand de Ribaucourt Subject: [PATCH net v4 1/5] net: phy: micrel: add Microchip KSZ 9897 Switch PHY support Date: Fri, 31 May 2024 14:24:26 +0000 Message-Id: <20240531142430.678198-2-enguerrand.de-ribaucourt@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240531142430.678198-1-enguerrand.de-ribaucourt@savoirfairelinux.com> References: <20240530102436.226189-1-enguerrand.de-ribaucourt@savoirfairelinux.com> <20240531142430.678198-1-enguerrand.de-ribaucourt@savoirfairelinux.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org There is a DSA driver for microchip,ksz9897 which can be controlled through SPI or I2C. This patch adds support for it's CPU ports PHYs to also allow network access to the switch's CPU port. The CPU ports PHYs of the KSZ9897 are not documented in the datasheet. They weirdly use the same PHY ID as the KSZ8081, which is a different PHY and that driver isn't compatible with KSZ9897. Before this patch, the KSZ8081 driver was used for the CPU ports of the KSZ9897 but the link would never come up. A new driver for the KSZ9897 is added, based on the compatible KSZ87XX. I could not test if Gigabit Ethernet works, but the link comes up and can successfully allow packets to be sent and received with DSA tags. To resolve the KSZ8081/KSZ9897 phy_id conflicts, I could not find any stable register to distinguish them. Instead of a match_phy_device() , I've declared a virtual phy_id with the highest value in Microchip's OUI range. Example usage in the device tree: compatible = "ethernet-phy-id0022.17ff"; A discussion to find better alternatives had been opened with the Microchip team, with no response yet. See https://lore.kernel.org/all/20220207174532.362781-1-enguerrand.de-ribaucourt@savoirfairelinux.com/ Fixes: b987e98e50ab ("dsa: add DSA switch driver for Microchip KSZ9477") Signed-off-by: Enguerrand de Ribaucourt --- v4: - rebase on net/main - add Fixes tag - use pseudo phy_id instead of of_tree search v3: https://lore.kernel.org/all/20240530102436.226189-2-enguerrand.de-ribaucourt@savoirfairelinux.com/ --- drivers/net/phy/micrel.c | 14 +++++++++++++- include/linux/micrel_phy.h | 4 ++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 2b8f8b7f1517..8a6dfaceeab3 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -16,7 +16,7 @@ * ksz8081, ksz8091, * ksz8061, * Switch : ksz8873, ksz886x - * ksz9477, lan8804 + * ksz9477, ksz9897, lan8804 */ #include @@ -5495,6 +5495,17 @@ static struct phy_driver ksphy_driver[] = { .suspend = genphy_suspend, .resume = genphy_resume, .get_features = ksz9477_get_features, +}, { + .phy_id = PHY_ID_KSZ9897, + .phy_id_mask = MICREL_PHY_ID_MASK, + .name = "Microchip KSZ9897 Switch", + /* PHY_BASIC_FEATURES */ + .config_init = kszphy_config_init, + .config_aneg = ksz8873mll_config_aneg, + .read_status = ksz8873mll_read_status, + /* No suspend/resume callbacks because of errata DS00002330D: + * Toggling PHY Powerdown can cause errors or link failures in adjacent PHYs + */ } }; module_phy_driver(ksphy_driver); @@ -5520,6 +5531,7 @@ static struct mdio_device_id __maybe_unused micrel_tbl[] = { { PHY_ID_LAN8814, MICREL_PHY_ID_MASK }, { PHY_ID_LAN8804, MICREL_PHY_ID_MASK }, { PHY_ID_LAN8841, MICREL_PHY_ID_MASK }, + { PHY_ID_KSZ9897, MICREL_PHY_ID_MASK }, { } }; diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h index 591bf5b5e8dc..81cc16dc2ddf 100644 --- a/include/linux/micrel_phy.h +++ b/include/linux/micrel_phy.h @@ -39,6 +39,10 @@ #define PHY_ID_KSZ87XX 0x00221550 #define PHY_ID_KSZ9477 0x00221631 +/* Pseudo ID to specify in compatible field of device tree. + * Otherwise the device reports the same ID as KSZ8081 on CPU ports. + */ +#define PHY_ID_KSZ9897 0x002217ff /* struct phy_device dev_flags definitions */ #define MICREL_PHY_50MHZ_CLK BIT(0) From patchwork Fri May 31 14:24:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enguerrand de Ribaucourt X-Patchwork-Id: 13681752 X-Patchwork-Delegate: kuba@kernel.org Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 326F81BF40 for ; Fri, 31 May 2024 14:24:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=208.88.110.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717165486; cv=none; b=DcdiGPe+C6fcsBmItUnGQV492lpXih3TFhJzwoTotGzswAR7Ohr3eCyvBD5snAMvtT7ZHHVbnaoIa5dCl2nXzzYSd8hzzb0ND2P9kvAXtVQY4MgY0EFdOJ7arjA46wWHwQaopY6DOQfLrwgqcEie9M5CKu/PP8LJh8eZgADEQHg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717165486; c=relaxed/simple; bh=3GCpDhULczbPiUCJtF27T1bqkcED8cluiRZ0Q72BTng=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=A3nfWf7tsuVHl18pBQJhVUJ+vexGa3mphYoSY0lsCImoLHi6ayfAml4f7GFT607iTH8h88V0DZRdEwXRsbNy9xA5j/EGz7dhwusp/X0essyzFeaGOh5hd4gn8t7dWpF2a48iPBwFUap1vcMO+hcV8jFbgWoqKgOTJffsrADt9jU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com; spf=pass smtp.mailfrom=savoirfairelinux.com; dkim=pass (2048-bit key) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.b=xb9qkkuf; arc=none smtp.client-ip=208.88.110.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=savoirfairelinux.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.b="xb9qkkuf" Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id B94EB9C58F5; Fri, 31 May 2024 10:24:42 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id T07ojGVVkwdW; Fri, 31 May 2024 10:24:42 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 16B689C32FC; Fri, 31 May 2024 10:24:42 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 16B689C32FC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1717165482; bh=Z7k2RaPV2b/xiu+bo3AWdjel+DLcBS01fw7SBTNCuHM=; h=From:To:Date:Message-Id:MIME-Version; b=xb9qkkufxsIYciLPez4+YQumRlJD2aIFDe5G+dQQJFV/jBi+rWSlYVF29RALIIEhZ JlQyLFo1ipgh+NDk8B3LoxjLHQwOdnNgdWlCyU4ZJ/3z7BJZsbbYMeGlVq+uWuqjix rowNAqk1I3fZHwneXF0bFc30PsbVwFheN6lbBAelg1pw5DKBQBcImkNofPRs5zY57O n14s6I96p8QcTWIhW8iKjUYU4GaeFFkFZdb5MUcWxDhjfpFQXLcftRW2FzzkRZhSsH YU1lTyqQrGV3ACbHOPj8tRc+97twYsrygD5+d2S7N85gUegJB/A2T4J3GBG3JvrXZI s6N0BhMXu9Ykg== X-Virus-Scanned: amavis at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10026) with ESMTP id 4xUeHZGwb-1P; Fri, 31 May 2024 10:24:42 -0400 (EDT) Received: from sfl-deribaucourt.rennes.sfl (lmontsouris-657-1-69-118.w80-15.abo.wanadoo.fr [80.15.101.118]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 286859C5899; Fri, 31 May 2024 10:24:41 -0400 (EDT) From: Enguerrand de Ribaucourt To: netdev@vger.kernel.org Cc: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, woojung.huh@microchip.com, UNGLinuxDriver@microchip.com, Enguerrand de Ribaucourt Subject: [PATCH net v4 2/5] net: phy: micrel: disable suspend/resume callbacks following errata Date: Fri, 31 May 2024 14:24:27 +0000 Message-Id: <20240531142430.678198-3-enguerrand.de-ribaucourt@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240531142430.678198-1-enguerrand.de-ribaucourt@savoirfairelinux.com> References: <20240530102436.226189-1-enguerrand.de-ribaucourt@savoirfairelinux.com> <20240531142430.678198-1-enguerrand.de-ribaucourt@savoirfairelinux.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Microchip's erratas state that powering down a PHY may cause errors on the adjacent PHYs due to the power supply noise. The suggested workaround is to avoid toggling the powerdown bit dynamically while traffic may be present. Fixes: fc3973a1fa09 ("phy: micrel: add Microchip KSZ 9477 Switch PHY support") Signed-off-by: Enguerrand de Ribaucourt --- v4: - rebase on net/main - add Fixes tag v3: https://lore.kernel.org/all/20240530102436.226189-3-enguerrand.de-ribaucourt@savoirfairelinux.com/ --- drivers/net/phy/micrel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 8a6dfaceeab3..2608d6cc7257 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -5492,8 +5492,9 @@ static struct phy_driver ksphy_driver[] = { .config_init = ksz9477_config_init, .config_intr = kszphy_config_intr, .handle_interrupt = kszphy_handle_interrupt, - .suspend = genphy_suspend, - .resume = genphy_resume, + /* No suspend/resume callbacks because of errata DS80000758: + * Toggling PHY Powerdown can cause errors or link failures in adjacent PHYs + */ .get_features = ksz9477_get_features, }, { .phy_id = PHY_ID_KSZ9897, From patchwork Fri May 31 14:24:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enguerrand de Ribaucourt X-Patchwork-Id: 13681753 X-Patchwork-Delegate: kuba@kernel.org Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACFE21C687 for ; Fri, 31 May 2024 14:24:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=208.88.110.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717165486; cv=none; b=E+nTWC/avDfsml939UB/XvGLtkZCyECWTJvKRz+7vDyVm0XOqHAHyXepCwaDqiutg2BF0I6rh1cI659jeoI57WXSwUtiEF7epacemrdIm1XRTABrC5GzZVq8Lpq4uRjJ7H8MU8k0lFPvMF+KTKLwwOZwGeU1UctJ5oMs53UFnUQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717165486; c=relaxed/simple; bh=4CSp4OvvZBR8EkePW4ABjuf5q/9jqMjLNcEqMkNSSVg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KLSaWAYumnLlSJY/mLgL8S+ebr3W7yGhzq2GEeQso6WxgHH8l2n4fdxT/h4SNTSbA13lRG+s4NnBNfAsZhT42w0N3gYKVZwtOzCkGroa4q65qDwu6ZmwERYD76UIGvpg1A0scpZF4sk06a+JaFxBSKpX8EgN2zp5E6VItqwLE7E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com; spf=pass smtp.mailfrom=savoirfairelinux.com; dkim=pass (2048-bit key) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.b=c1acFYcQ; arc=none smtp.client-ip=208.88.110.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=savoirfairelinux.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.b="c1acFYcQ" Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id A36D49C59F4; Fri, 31 May 2024 10:24:43 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id w8lZUojev2ft; Fri, 31 May 2024 10:24:43 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 1EDFD9C32FC; Fri, 31 May 2024 10:24:43 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 1EDFD9C32FC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1717165483; bh=+0WGUL++y09ZdFElCyNjG/nTorMgcqWoWBpR2PNNffI=; h=From:To:Date:Message-Id:MIME-Version; b=c1acFYcQKwH7C+Ovt2qtFO6ezatXY0pQgn4KVE7f5pwYGI2gGD1o7ONnO+7/UwB0H L2wbDai3jPBsMyAWFidR+RGsTP7RTXz2psSZMI/kVLwleHoHn+vnhHL1J275qTXr1S jWE46ONi9cN5G3HjOrEcDYYSCY4qGH9YvXgdXSRinf59XlhlAoorBQwtE3vHjJ8EnG xCptNO5oINgQmpoHt0IQ/OJCrpLizG4sUrLGuBIXjkQ+AkSittguFQbqrHViTQhzA1 bdVRCUXblcX83zC9w7zjeOP+3yHFLtfJi9Ujjk5FnFCBjuypoVgZph2uEH2ef5Nk4f Z4VJsl5+KSPjw== X-Virus-Scanned: amavis at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10026) with ESMTP id RGcbFm9d3xcd; Fri, 31 May 2024 10:24:43 -0400 (EDT) Received: from sfl-deribaucourt.rennes.sfl (lmontsouris-657-1-69-118.w80-15.abo.wanadoo.fr [80.15.101.118]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 32AD19C405E; Fri, 31 May 2024 10:24:42 -0400 (EDT) From: Enguerrand de Ribaucourt To: netdev@vger.kernel.org Cc: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, woojung.huh@microchip.com, UNGLinuxDriver@microchip.com, Enguerrand de Ribaucourt Subject: [PATCH net v4 3/5] net: phy: micrel: add Microchip KSZ 9477 to the device table Date: Fri, 31 May 2024 14:24:28 +0000 Message-Id: <20240531142430.678198-4-enguerrand.de-ribaucourt@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240531142430.678198-1-enguerrand.de-ribaucourt@savoirfairelinux.com> References: <20240530102436.226189-1-enguerrand.de-ribaucourt@savoirfairelinux.com> <20240531142430.678198-1-enguerrand.de-ribaucourt@savoirfairelinux.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org PHY_ID_KSZ9477 was supported but not added to the device table passed to MODULE_DEVICE_TABLE. Fixes: fc3973a1fa09 ("phy: micrel: add Microchip KSZ 9477 Switch PHY support") Signed-off-by: Enguerrand de Ribaucourt --- v4: - rebase on net/main - add Fixes tag v3: https://lore.kernel.org/all/20240530102436.226189-4-enguerrand.de-ribaucourt@savoirfairelinux.com/ --- drivers/net/phy/micrel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 2608d6cc7257..f700485793bd 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -5529,6 +5529,7 @@ static struct mdio_device_id __maybe_unused micrel_tbl[] = { { PHY_ID_KSZ8081, MICREL_PHY_ID_MASK }, { PHY_ID_KSZ8873MLL, MICREL_PHY_ID_MASK }, { PHY_ID_KSZ886X, MICREL_PHY_ID_MASK }, + { PHY_ID_KSZ9477, MICREL_PHY_ID_MASK }, { PHY_ID_LAN8814, MICREL_PHY_ID_MASK }, { PHY_ID_LAN8804, MICREL_PHY_ID_MASK }, { PHY_ID_LAN8841, MICREL_PHY_ID_MASK }, From patchwork Fri May 31 14:24:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enguerrand de Ribaucourt X-Patchwork-Id: 13681754 X-Patchwork-Delegate: kuba@kernel.org Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EEF51CAA1 for ; Fri, 31 May 2024 14:24:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=208.88.110.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717165487; cv=none; b=st/aSNZVQfOyiAnexcfvWiHsLWzr3N76yJaLXrSOV6DrlHVytJD4nFcfuES9wbmlo365co+MQCX0h/iZz+KM48gL08eEdZ9W/S6Hdgm/NIx467h/d1EsCjGaBBuxmiJRb+xX6CgGhBPhQdrunOnaInQmfoumuaPQPHRTuqaKGnI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717165487; c=relaxed/simple; bh=gAD17GSP2qQmZM27ES+lgK6Zny+HH1r2uUv3Dh/c+Qc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Acigin1cnpzXtU878mSJpQBEs4aeDjGeALM131GvzpPsAnQgdtNXU+mcCAnfYc9AYG+BSg26grg72zl2sFCQHJua5pombzK9mKQL7C3dbcknRZvf4aU618EvoIla7YsAPkIVRnRR+EsQfInCS3NIj67+vGzKezvNPUsWyeoyNtw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com; spf=pass smtp.mailfrom=savoirfairelinux.com; dkim=pass (2048-bit key) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.b=ZAhzX9RJ; arc=none smtp.client-ip=208.88.110.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=savoirfairelinux.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.b="ZAhzX9RJ" Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id B13CC9C59F6; Fri, 31 May 2024 10:24:44 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id SZwqb7YPoe1P; Fri, 31 May 2024 10:24:44 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 29F4C9C32FC; Fri, 31 May 2024 10:24:44 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 29F4C9C32FC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1717165484; bh=ZKjn3PIFadtGtz2CeX70M2bKDtmFiU5Jcl1jleK7TGY=; h=From:To:Date:Message-Id:MIME-Version; b=ZAhzX9RJ2uQm13m2IEcUJ3quktN1Z9eI7xe0jACZe6jJbBHk4L8OW9DtYdr0onUEk vScxiYdlzWfmmzVpA+nPwavLI6P2sCOX2l9NCYznIZcGhFOspR2b5XrNIabkCzNP9K Jk+FnN5VpMPyfppTSei5QFZPdzKu/FLIAUy22dLiMcNksPZV0BjLBr2/9c3b8Kc3HR pXEp5QE+9p0OK7Grl04PYPBbzXgkKonsnmtW5NG2fovLHkZpGtZChIIks4EErqCQ4E 68FTmUwrvPMIENEN6CTHwGT1BOr+z/wPQ7h+CXZ65/yliAqWNDxB2uvXRuH9V33afO P7Yb5uJa5o+Rg== X-Virus-Scanned: amavis at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10026) with ESMTP id bviycrDBzs4p; Fri, 31 May 2024 10:24:44 -0400 (EDT) Received: from sfl-deribaucourt.rennes.sfl (lmontsouris-657-1-69-118.w80-15.abo.wanadoo.fr [80.15.101.118]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 3CF439C405E; Fri, 31 May 2024 10:24:43 -0400 (EDT) From: Enguerrand de Ribaucourt To: netdev@vger.kernel.org Cc: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, woojung.huh@microchip.com, UNGLinuxDriver@microchip.com, Enguerrand de Ribaucourt Subject: [PATCH net v4 4/5] net: dsa: microchip: use collision based back pressure mode Date: Fri, 31 May 2024 14:24:29 +0000 Message-Id: <20240531142430.678198-5-enguerrand.de-ribaucourt@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240531142430.678198-1-enguerrand.de-ribaucourt@savoirfairelinux.com> References: <20240530102436.226189-1-enguerrand.de-ribaucourt@savoirfairelinux.com> <20240531142430.678198-1-enguerrand.de-ribaucourt@savoirfairelinux.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Errata DS80000758 states that carrier sense back pressure mode can cause link down issues in 100BASE-TX half duplex mode. The datasheet also recommends to always use the collision based back pressure mode. Fixes: b987e98e50ab ("dsa: add DSA switch driver for Microchip KSZ9477") Signed-off-by: Enguerrand de Ribaucourt --- v4: - rebase on net/main - add Fixes tag v3: https://lore.kernel.org/all/20240530102436.226189-5-enguerrand.de-ribaucourt@savoirfairelinux.com/ --- drivers/net/dsa/microchip/ksz9477.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c index f8ad7833f5d9..343b9d7538e9 100644 --- a/drivers/net/dsa/microchip/ksz9477.c +++ b/drivers/net/dsa/microchip/ksz9477.c @@ -1299,6 +1299,9 @@ int ksz9477_setup(struct dsa_switch *ds) /* Enable REG_SW_MTU__2 reg by setting SW_JUMBO_PACKET */ ksz_cfg(dev, REG_SW_MAC_CTRL_1, SW_JUMBO_PACKET, true); + /* Use collision based back pressure mode. */ + ksz_cfg(dev, REG_SW_MAC_CTRL_1, SW_BACK_PRESSURE, false); + /* Now we can configure default MTU value */ ret = regmap_update_bits(ksz_regmap_16(dev), REG_SW_MTU__2, REG_SW_MTU_MASK, VLAN_ETH_FRAME_LEN + ETH_FCS_LEN); From patchwork Fri May 31 14:24:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enguerrand de Ribaucourt X-Patchwork-Id: 13681755 X-Patchwork-Delegate: kuba@kernel.org Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C7672837D for ; Fri, 31 May 2024 14:24:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=208.88.110.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717165488; cv=none; b=V8AobI+gO3AyQAEvLr0VXqr3gxaGfemNxv/06PJjWnwxILmjHOarrn2YcH9EB4hUthR3PjXE2Hh3Gjt/Wzt/6AP2H9+DEbkg6HVKcjgPt++GULtTuV1SvOLW2eYS0oM3jo4Bvdn6lIs+gtHukUnw8K6LTE1ddqlVs1AiSGC9F3Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717165488; c=relaxed/simple; bh=Lfs/KUSHLBDNE5S/XFidUV2cUUXtUJg5a9ooZeLuaJc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HCwJLPBqVNvGX/okoIvil2sFfql17P0HQDtQUMP2dAsNLkupSoT4Hqo5cRIBNJ7pZO4djKVusqgftZbAg8frpMmgLJFgECfGpFHy/JITfCEHN4wlH4QIB9bWhpDvN9iXYqIlEa+1QHMx2ocrydSBub0W3GmEqQEr3jccFfOIV0I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com; spf=pass smtp.mailfrom=savoirfairelinux.com; dkim=pass (2048-bit key) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.b=dyrJ/imL; arc=none smtp.client-ip=208.88.110.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=savoirfairelinux.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=savoirfairelinux.com header.i=@savoirfairelinux.com header.b="dyrJ/imL" Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 992FB9C405E; Fri, 31 May 2024 10:24:46 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10032) with ESMTP id CPfsGg65tdHE; Fri, 31 May 2024 10:24:45 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 331089C32FC; Fri, 31 May 2024 10:24:45 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 331089C32FC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1717165485; bh=Zh3SrCOoE5gcB4w9AEOZxFggzCrs9zEQkfGnuOBZIhc=; h=From:To:Date:Message-Id:MIME-Version; b=dyrJ/imLP3e+PAdfMz1duDqn/LdQPb6Sj309KXZXmTqEvfWYyaaGpZ0bm3edjRGNQ XaEc/0aNjzq/laP7nFuTgv5++mndgsuxOvpxxghyDYb107plmlgYZKZUqMXdPfcWO4 O6SFg5/D7Xf2EzLTjm83oi4mvinnIqUq7BsJf40sF7H+VnT0ECjWdGVfNpZMHmO+3x fiD1VS/xSdXDNPgYzibpu7sUWGaDNp4tiGQX1+CXhkrDGC58GRlb3h4BVd6GFKoka/ evfigOZRt7LxwguBQvrSreIJqRdbDhcuxX4OmDGsxj44BzcqUM2ZtIvMkJLlKGtJpr c/dVoc4k/sJPw== X-Virus-Scanned: amavis at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavis, port 10026) with ESMTP id IU6Wxgl6dWEt; Fri, 31 May 2024 10:24:45 -0400 (EDT) Received: from sfl-deribaucourt.rennes.sfl (lmontsouris-657-1-69-118.w80-15.abo.wanadoo.fr [80.15.101.118]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 4772B9C405E; Fri, 31 May 2024 10:24:44 -0400 (EDT) From: Enguerrand de Ribaucourt To: netdev@vger.kernel.org Cc: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, woojung.huh@microchip.com, UNGLinuxDriver@microchip.com, Enguerrand de Ribaucourt Subject: [PATCH net v4 5/5] net: dsa: microchip: monitor potential faults in half-duplex mode Date: Fri, 31 May 2024 14:24:30 +0000 Message-Id: <20240531142430.678198-6-enguerrand.de-ribaucourt@savoirfairelinux.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240531142430.678198-1-enguerrand.de-ribaucourt@savoirfairelinux.com> References: <20240530102436.226189-1-enguerrand.de-ribaucourt@savoirfairelinux.com> <20240531142430.678198-1-enguerrand.de-ribaucourt@savoirfairelinux.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The errata DS80000754 recommends monitoring potential faults in half-duplex mode for the KSZ9477 familly. half-duplex is not very common so I just added a critical message when the fault conditions are detected. The switch can be expected to be unable to communicate anymore in these states and a software reset of the switch would be required which I did not implement. Fixes: b987e98e50ab ("dsa: add DSA switch driver for Microchip KSZ9477") Signed-off-by: Enguerrand de Ribaucourt --- v4: - rebase on net/main - add Fixes tag - reverse x-mas tree v3: https://lore.kernel.org/all/20240530102436.226189-6-enguerrand.de-ribaucourt@savoirfairelinux.com/ --- drivers/net/dsa/microchip/ksz9477.c | 34 +++++++++++++++++++++++++ drivers/net/dsa/microchip/ksz9477.h | 2 ++ drivers/net/dsa/microchip/ksz9477_reg.h | 8 ++++-- drivers/net/dsa/microchip/ksz_common.c | 7 +++++ drivers/net/dsa/microchip/ksz_common.h | 1 + 5 files changed, 50 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c index 343b9d7538e9..9c69c78c0b92 100644 --- a/drivers/net/dsa/microchip/ksz9477.c +++ b/drivers/net/dsa/microchip/ksz9477.c @@ -429,6 +429,40 @@ void ksz9477_freeze_mib(struct ksz_device *dev, int port, bool freeze) mutex_unlock(&p->mib.cnt_mutex); } +void ksz9477_errata_monitor(struct ksz_device *dev, int port, + u64 tx_late_col) +{ + u32 pmavbc; + u8 status; + u16 pqm; + + ksz_pread8(dev, port, REG_PORT_STATUS_0, &status); + if (!((status & PORT_INTF_SPEED_MASK) == PORT_INTF_SPEED_MASK) && + !(status & PORT_INTF_FULL_DUPLEX)) { + dev_warn_once(dev->dev, + "Half-duplex detected on port %d, transmission halt may occur\n", + port); + /* Errata DS80000754 recommends monitoring potential faults in + * half-duplex mode. The switch might not be able to communicate anymore + * in these states. + */ + if (tx_late_col != 0) { + /* Transmission halt with late collisions */ + dev_crit_ratelimited(dev->dev, + "TX late collisions detected, transmission may be halted on port %d\n", + port); + } + ksz_pread16(dev, port, REG_PORT_QM_TX_CNT_0__4, &pqm); + ksz_read32(dev, REG_PMAVBC, &pmavbc); + if (((pmavbc & PMAVBC_MASK) >> PMAVBC_SHIFT <= 0x580) || + ((pqm & PORT_QM_TX_CNT_M) >= 0x200)) { + /* Transmission halt with Half-Duplex and VLAN */ + dev_crit_ratelimited(dev->dev, + "resources out of limits, transmission may be halted\n"); + } + } +} + void ksz9477_port_init_cnt(struct ksz_device *dev, int port) { struct ksz_port_mib *mib = &dev->ports[port].mib; diff --git a/drivers/net/dsa/microchip/ksz9477.h b/drivers/net/dsa/microchip/ksz9477.h index ce1e656b800b..3312ef28e99c 100644 --- a/drivers/net/dsa/microchip/ksz9477.h +++ b/drivers/net/dsa/microchip/ksz9477.h @@ -36,6 +36,8 @@ int ksz9477_port_mirror_add(struct ksz_device *dev, int port, bool ingress, struct netlink_ext_ack *extack); void ksz9477_port_mirror_del(struct ksz_device *dev, int port, struct dsa_mall_mirror_tc_entry *mirror); +void ksz9477_errata_monitor(struct ksz_device *dev, int port, + u64 tx_late_col); void ksz9477_get_caps(struct ksz_device *dev, int port, struct phylink_config *config); int ksz9477_fdb_dump(struct ksz_device *dev, int port, diff --git a/drivers/net/dsa/microchip/ksz9477_reg.h b/drivers/net/dsa/microchip/ksz9477_reg.h index f3a205ee483f..3238b9748d0f 100644 --- a/drivers/net/dsa/microchip/ksz9477_reg.h +++ b/drivers/net/dsa/microchip/ksz9477_reg.h @@ -842,8 +842,7 @@ #define REG_PORT_STATUS_0 0x0030 -#define PORT_INTF_SPEED_M 0x3 -#define PORT_INTF_SPEED_S 3 +#define PORT_INTF_SPEED_MASK 0x0018 #define PORT_INTF_FULL_DUPLEX BIT(2) #define PORT_TX_FLOW_CTRL BIT(1) #define PORT_RX_FLOW_CTRL BIT(0) @@ -1167,6 +1166,11 @@ #define PORT_RMII_CLK_SEL BIT(7) #define PORT_MII_SEL_EDGE BIT(5) +#define REG_PMAVBC 0x03AC + +#define PMAVBC_MASK 0x7ff0000 +#define PMAVBC_SHIFT 16 + /* 4 - MAC */ #define REG_PORT_MAC_CTRL_0 0x0400 diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index 2818e24e2a51..edc7467f101d 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -1382,6 +1382,7 @@ const struct ksz_chip_data ksz_switch_chips[] = { .tc_cbs_supported = true, .ops = &ksz9477_dev_ops, .phylink_mac_ops = &ksz9477_phylink_mac_ops, + .phy_errata_9477 = true, .mib_names = ksz9477_mib_names, .mib_cnt = ARRAY_SIZE(ksz9477_mib_names), .reg_mib_cnt = MIB_COUNTER_NUM, @@ -1416,6 +1417,7 @@ const struct ksz_chip_data ksz_switch_chips[] = { .num_ipms = 8, .ops = &ksz9477_dev_ops, .phylink_mac_ops = &ksz9477_phylink_mac_ops, + .phy_errata_9477 = true, .mib_names = ksz9477_mib_names, .mib_cnt = ARRAY_SIZE(ksz9477_mib_names), .reg_mib_cnt = MIB_COUNTER_NUM, @@ -1450,6 +1452,7 @@ const struct ksz_chip_data ksz_switch_chips[] = { .num_ipms = 8, .ops = &ksz9477_dev_ops, .phylink_mac_ops = &ksz9477_phylink_mac_ops, + .phy_errata_9477 = true, .mib_names = ksz9477_mib_names, .mib_cnt = ARRAY_SIZE(ksz9477_mib_names), .reg_mib_cnt = MIB_COUNTER_NUM, @@ -1540,6 +1543,7 @@ const struct ksz_chip_data ksz_switch_chips[] = { .tc_cbs_supported = true, .ops = &ksz9477_dev_ops, .phylink_mac_ops = &ksz9477_phylink_mac_ops, + .phy_errata_9477 = true, .mib_names = ksz9477_mib_names, .mib_cnt = ARRAY_SIZE(ksz9477_mib_names), .reg_mib_cnt = MIB_COUNTER_NUM, @@ -1861,6 +1865,9 @@ void ksz_r_mib_stats64(struct ksz_device *dev, int port) pstats->rx_pause_frames = raw->rx_pause; spin_unlock(&mib->stats64_lock); + + if (dev->info->phy_errata_9477) + ksz9477_errata_monitor(dev, port, raw->tx_late_col); } void ksz88xx_r_mib_stats64(struct ksz_device *dev, int port) diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h index c784fd23a993..ee7db46e469d 100644 --- a/drivers/net/dsa/microchip/ksz_common.h +++ b/drivers/net/dsa/microchip/ksz_common.h @@ -66,6 +66,7 @@ struct ksz_chip_data { bool tc_cbs_supported; const struct ksz_dev_ops *ops; const struct phylink_mac_ops *phylink_mac_ops; + bool phy_errata_9477; bool ksz87xx_eee_link_erratum; const struct ksz_mib_names *mib_names; int mib_cnt;