From patchwork Thu Jul 22 16:38:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 485247 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 583B1C6377D for ; Thu, 22 Jul 2021 16:39:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 46921613AF for ; Thu, 22 Jul 2021 16:39:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230093AbhGVP7E (ORCPT ); Thu, 22 Jul 2021 11:59:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:35342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232805AbhGVP6Q (ORCPT ); Thu, 22 Jul 2021 11:58:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DC2826135B; Thu, 22 Jul 2021 16:38:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626971931; bh=7sYbbC2XbITf3UNyJFgMAm53kuo6x7j5wKAiZq6v8S8=; h=From:To:Cc:Subject:Date:From; b=o78ASWpL16RbJZYevDHzZV/3Bf9xygqpiyyMX5HZELcy1Ln5lBiSS3Bh1XNwhP4nd Gx2LlIwL0FBGZVhajvvoa6wBfTLizwUyMVImzdewEEf0CTgDhhLEDHV+ekkWyiX65Z 44GWXYqrncv+PAjGJRdjscr2woce1G7K56G+LSTvxKIY7CWJecSISMyHekrdCKQ7Ww FKR7rqOeXlrz+0hWIBJk1RaiJvg6mXobj5a+1iiOwDroK9qtHIDJp1IZBDEuyjc7SZ ISQbht6DlxOfmS3GzZXR5bdVnEr2Q3jb86//D/nwcOBryh2ISLDsROoaZJgBPMzjAA IGydbjJcnPG3A== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: stable@vger.kernel.org Cc: gregkh@linuxfoundation.org, =?utf-8?q?Marek_Beh=C3=BAn?= , "David S . Miller" Subject: [PATCH 5.10 1/2] net: dsa: mv88e6xxx: enable SerDes RX stats for Topaz Date: Thu, 22 Jul 2021 18:38:47 +0200 Message-Id: <20210722163848.23080-1-kabel@kernel.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org commit a03b98d68367b18e5db6d6850e2cc18754fba94a upstream. Commit 0df952873636a ("mv88e6xxx: Add serdes Rx statistics") added support for RX statistics on SerDes ports for Peridot. This same implementation is also valid for Topaz, but was not enabled at the time. We need to use the generic .serdes_get_lane() method instead of the Peridot specific one in the stats methods so that on Topaz the proper one is used. Signed-off-by: Marek BehĂșn Fixes: 0df952873636a ("mv88e6xxx: Add serdes Rx statistics") Signed-off-by: David S. Miller --- drivers/net/dsa/mv88e6xxx/chip.c | 6 ++++++ drivers/net/dsa/mv88e6xxx/serdes.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 429ce8638c2b..8029e76b0745 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -3433,6 +3433,9 @@ static const struct mv88e6xxx_ops mv88e6141_ops = { .serdes_irq_enable = mv88e6390_serdes_irq_enable, .serdes_irq_status = mv88e6390_serdes_irq_status, .gpio_ops = &mv88e6352_gpio_ops, + .serdes_get_sset_count = mv88e6390_serdes_get_sset_count, + .serdes_get_strings = mv88e6390_serdes_get_strings, + .serdes_get_stats = mv88e6390_serdes_get_stats, .phylink_validate = mv88e6341_phylink_validate, }; @@ -4205,6 +4208,9 @@ static const struct mv88e6xxx_ops mv88e6341_ops = { .gpio_ops = &mv88e6352_gpio_ops, .avb_ops = &mv88e6390_avb_ops, .ptp_ops = &mv88e6352_ptp_ops, + .serdes_get_sset_count = mv88e6390_serdes_get_sset_count, + .serdes_get_strings = mv88e6390_serdes_get_strings, + .serdes_get_stats = mv88e6390_serdes_get_stats, .phylink_validate = mv88e6341_phylink_validate, }; diff --git a/drivers/net/dsa/mv88e6xxx/serdes.c b/drivers/net/dsa/mv88e6xxx/serdes.c index 9c07b4f3d345..6920e62c864d 100644 --- a/drivers/net/dsa/mv88e6xxx/serdes.c +++ b/drivers/net/dsa/mv88e6xxx/serdes.c @@ -590,7 +590,7 @@ static struct mv88e6390_serdes_hw_stat mv88e6390_serdes_hw_stats[] = { int mv88e6390_serdes_get_sset_count(struct mv88e6xxx_chip *chip, int port) { - if (mv88e6390_serdes_get_lane(chip, port) == 0) + if (mv88e6xxx_serdes_get_lane(chip, port) == 0) return 0; return ARRAY_SIZE(mv88e6390_serdes_hw_stats); @@ -602,7 +602,7 @@ int mv88e6390_serdes_get_strings(struct mv88e6xxx_chip *chip, struct mv88e6390_serdes_hw_stat *stat; int i; - if (mv88e6390_serdes_get_lane(chip, port) == 0) + if (mv88e6xxx_serdes_get_lane(chip, port) == 0) return 0; for (i = 0; i < ARRAY_SIZE(mv88e6390_serdes_hw_stats); i++) { @@ -638,7 +638,7 @@ int mv88e6390_serdes_get_stats(struct mv88e6xxx_chip *chip, int port, int lane; int i; - lane = mv88e6390_serdes_get_lane(chip, port); + lane = mv88e6xxx_serdes_get_lane(chip, port); if (lane == 0) return 0; From patchwork Thu Jul 22 16:38:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 484485 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B229CC6379C for ; Thu, 22 Jul 2021 16:41:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 978D061435 for ; Thu, 22 Jul 2021 16:41:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233828AbhGVQAw (ORCPT ); Thu, 22 Jul 2021 12:00:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:35404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233250AbhGVP6S (ORCPT ); Thu, 22 Jul 2021 11:58:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 213E96138C; Thu, 22 Jul 2021 16:38:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626971933; bh=8REEDGipbr9mTvWuq5PaPNgjliagseRwWEoaLK1hhT0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SwGac6dcnzasvzEIljJQhHzKfNIfuU7MJwG+XJcEMIPIfpAtPE4EVlTU1B1f9gwqG grzbTYEOCxDUBKJIfZCIpg6PKL8kvFxByLjueUUMzpQQp7O/EweVwATSc0g+qSQwav ePLRu4UZ7aOf/nngT+y8mfd4tgcEkc6wvD1AxWWsLkR7oI0bfczmyvAK2YJ6+Dg/cc 1EdvGHVCcmTHDbelRLHBLT15vDuIA7D+IUGkssS9jMe3N1m/xPEP7G9unllT3ALi9/ wucQEZ+L/o4sISz4fi/QLn4GhtaG44Pjaro+UPwAdOzCXFalS36p7BXxucxH/HkBb1 5c9lsSH+bQ2Jg== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: stable@vger.kernel.org Cc: gregkh@linuxfoundation.org, =?utf-8?q?Marek_Beh=C3=BAn?= , Andrew Lunn , "David S . Miller" Subject: [PATCH 5.10 2/2] net: dsa: mv88e6xxx: enable SerDes PCS register dump via ethtool -d on Topaz Date: Thu, 22 Jul 2021 18:38:48 +0200 Message-Id: <20210722163848.23080-2-kabel@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210722163848.23080-1-kabel@kernel.org> References: <20210722163848.23080-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org commit 953b0dcbe2e3f7bee98cc3bca2ec82c8298e9c16 upstream. Commit bf3504cea7d7e ("net: dsa: mv88e6xxx: Add 6390 family PCS registers to ethtool -d") added support for dumping SerDes PCS registers via ethtool -d for Peridot. The same implementation is also valid for Topaz, but was not enabled at the time. Signed-off-by: Marek BehĂșn Fixes: bf3504cea7d7e ("net: dsa: mv88e6xxx: Add 6390 family PCS registers to ethtool -d") Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller --- drivers/net/dsa/mv88e6xxx/chip.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 8029e76b0745..184cbc93328c 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -3436,6 +3436,8 @@ static const struct mv88e6xxx_ops mv88e6141_ops = { .serdes_get_sset_count = mv88e6390_serdes_get_sset_count, .serdes_get_strings = mv88e6390_serdes_get_strings, .serdes_get_stats = mv88e6390_serdes_get_stats, + .serdes_get_regs_len = mv88e6390_serdes_get_regs_len, + .serdes_get_regs = mv88e6390_serdes_get_regs, .phylink_validate = mv88e6341_phylink_validate, }; @@ -4211,6 +4213,8 @@ static const struct mv88e6xxx_ops mv88e6341_ops = { .serdes_get_sset_count = mv88e6390_serdes_get_sset_count, .serdes_get_strings = mv88e6390_serdes_get_strings, .serdes_get_stats = mv88e6390_serdes_get_stats, + .serdes_get_regs_len = mv88e6390_serdes_get_regs_len, + .serdes_get_regs = mv88e6390_serdes_get_regs, .phylink_validate = mv88e6341_phylink_validate, };