Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1298472pxu; Sat, 5 Dec 2020 10:36:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJwj4+12n4HJfEVzo8PlTH74Ft46MGrNmhtHtFgTZ0SYKupXRkxPYhSItRt/lEplk3DS/F/R X-Received: by 2002:a17:906:a183:: with SMTP id s3mr12765003ejy.60.1607193384548; Sat, 05 Dec 2020 10:36:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607193384; cv=none; d=google.com; s=arc-20160816; b=VEZPhcXV0xk5IGZEmZRo7raAoKQFO7hrQLL3KBIYL2quZY92FbeBJqVoKMyodXIdSn ++mTx0GAuH1MicKaoTRAkcdIabUOzzfiFtt868jerm21b9YuZZFa3gIn5B/paH4ZfFDd fZtKQzxADY3XX+VfPXTPZdOZb1MYw9wIeFi/ArnKeS3UjXGVAx3jpi3sis/44iRak5p7 wPNoheYmlceSrcg5hRw1cTCXMzioH3YyBAHuS8sJBuEYFSBZwuaHsymhSdi8SPJV5OSq nY3iQP4srAh/Qb8vl3THWVsx/n2wjkdtpxJZSidL1PGGSIg42S0pdAuzwBoIpivcrF/9 mfIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=p27tFArilkZQWJdOTlf5pr+2+ufCtLUXxx/1mCNOCZE=; b=s7lbWfHcvoNRGaC1x7fjsv8OEKo0fdDR+eFbO9mOSur4MHy3sZh0fB02XiZ8FXUXbj r6JNQMHaHZuFkglQjbGId2vLT07MYamOcJr649CGvEk7+UKsE3n+G5VLamfOpeG7qz4I ypZd2YW6mUZrJPogLoF8lMcPmVHTrHs9zW2mZNAb1Vy+I3jrK5aIMmosEf5jNYLT9VVP oOwP/8KLiB7ky39U28mVFP+7Y0ICHbp/k0mlhzEXli6BchmAWWG0AZrFozUAbz5lt+qM yfqYPbtRLar4aOfYtdHfvCgMoTUNFVpCsT+AP5lqwvI/duJpKDhl4UvraFUUebB/WeG1 N48A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hDqspYp+; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mf27si3550988ejb.129.2020.12.05.10.36.01; Sat, 05 Dec 2020 10:36:24 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=hDqspYp+; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727718AbgLESdh (ORCPT + 99 others); Sat, 5 Dec 2020 13:33:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728129AbgLES2L (ORCPT ); Sat, 5 Dec 2020 13:28:11 -0500 Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F45AC02B8F4; Sat, 5 Dec 2020 07:28:21 -0800 (PST) Received: by mail-qk1-x743.google.com with SMTP id v143so8463721qkb.2; Sat, 05 Dec 2020 07:28:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=p27tFArilkZQWJdOTlf5pr+2+ufCtLUXxx/1mCNOCZE=; b=hDqspYp+RpmFlHKhRJ0iKCqouC3FQC8x9de7IcsA6Xzh9PLeAhRZAFLvfRSGWOrGLL 1YBstsLwavL2oX40C1X5WbhiYx04K4eKvhyZl47O63+8T8cML3jxc1BrkESokJmns4EV RSgoanu3FYwdBF2XgjWRtqTItVKAdccf5T6h38Bw7Q8l9PM5eyfxylMFBuRBHezxG3k/ rsRJPAOC+ZGEeRzs98WPKYOIbkqFT4YWi+asOrtBSUPg6+018MTB1LjiU+iI5zCqHbSb RyZ0IsgN7szcIdBeu//tv3yCus/wniSC2WtAZflhqjPdhcwqZkE2qtySFDNzw2Y8M/Tm XGtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=p27tFArilkZQWJdOTlf5pr+2+ufCtLUXxx/1mCNOCZE=; b=mnxnZkiCoyv80KOszGr26r2suIOLqIFKIObi7B0SyuugCBCnYJaRrgUaANQG5XsLeU Vf9/wE2NvgwLhous93iPFYizw/Vw40O5FtuMb+DeQDLDCx04TagKEMr7Gm1bb31twJtG Dt8Hk9XntV4R+OoTXRYZggGAw18kYEGP4J5EVOuZB2QYLK/1p3B39nH4n0N0UEmMaYz3 7JQM1+Zac2O5aUsd81MsTf9oPTOuENeKLq5txyfHETeA1dzhY/yAiqo3aqF1Trmckeqo rOHJ31qODsHPH77xghH+PL7fZRY+QkhB+xrjldkoV0BBYtn3ZQ0gS5/E9iIBNqTQQdwf +32g== X-Gm-Message-State: AOAM532Gg02GY4j/SA1lxlsTktPfOUjCcNwpMzyIfp3OcjiMahzPTsPu LYlRoMSUBv2+oI0Z4Q+eJts= X-Received: by 2002:a37:9f4a:: with SMTP id i71mr1841817qke.480.1607182100064; Sat, 05 Dec 2020 07:28:20 -0800 (PST) Received: from localhost.localdomain ([198.52.185.246]) by smtp.gmail.com with ESMTPSA id o16sm9008554qkg.27.2020.12.05.07.28.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2020 07:28:19 -0800 (PST) From: Sven Van Asbroeck X-Google-Original-From: Sven Van Asbroeck To: Woojung Huh , Microchip Linux Driver Support , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , David S Miller , Jakub Kicinski Cc: Sven Van Asbroeck , Helmut Grohne , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net v1 2/2] net: dsa: microchip: improve port count comments Date: Sat, 5 Dec 2020 10:28:14 -0500 Message-Id: <20201205152814.7867-2-TheSven73@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201205152814.7867-1-TheSven73@gmail.com> References: <20201205152814.7867-1-TheSven73@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sven Van Asbroeck Port counts in microchip dsa drivers can be quite confusing: on the ksz8795, ksz_chip_data->port_cnt excludes the cpu port, yet on the ksz9477, it includes the cpu port. Add comments to document this situation explicitly. Fixes: 912aae27c6af ("net: dsa: microchip: really look for phy-mode in port nodes") Signed-off-by: Sven Van Asbroeck --- Tree: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git # 905b2032fa42 To: Woojung Huh To: Microchip Linux Driver Support To: Andrew Lunn To: Vivien Didelot To: Florian Fainelli To: Vladimir Oltean To: "David S. Miller" To: Jakub Kicinski Cc: Helmut Grohne Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org drivers/net/dsa/microchip/ksz8795.c | 12 +++++++++--- drivers/net/dsa/microchip/ksz9477.c | 16 ++++++++++++---- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c index f5779e152377..99183347053f 100644 --- a/drivers/net/dsa/microchip/ksz8795.c +++ b/drivers/net/dsa/microchip/ksz8795.c @@ -1190,7 +1190,9 @@ static const struct ksz_chip_data ksz8795_switch_chips[] = { .num_alus = 0, .num_statics = 8, .cpu_ports = 0x10, /* can be configured as cpu port */ - .port_cnt = 4, /* total physical port count */ + .port_cnt = 4, /* total physical port count, excluding + * the cpu port + */ }, { .chip_id = 0x8794, @@ -1199,7 +1201,9 @@ static const struct ksz_chip_data ksz8795_switch_chips[] = { .num_alus = 0, .num_statics = 8, .cpu_ports = 0x10, /* can be configured as cpu port */ - .port_cnt = 3, /* total physical port count */ + .port_cnt = 3, /* total physical port count, excluding + * the cpu port + */ }, { .chip_id = 0x8765, @@ -1208,7 +1212,9 @@ static const struct ksz_chip_data ksz8795_switch_chips[] = { .num_alus = 0, .num_statics = 8, .cpu_ports = 0x10, /* can be configured as cpu port */ - .port_cnt = 4, /* total physical port count */ + .port_cnt = 4, /* total physical port count, excluding + * the cpu port + */ }, }; diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c index 2f5506ac7d19..e56122ffd495 100644 --- a/drivers/net/dsa/microchip/ksz9477.c +++ b/drivers/net/dsa/microchip/ksz9477.c @@ -1482,7 +1482,9 @@ static const struct ksz_chip_data ksz9477_switch_chips[] = { .num_alus = 4096, .num_statics = 16, .cpu_ports = 0x7F, /* can be configured as cpu port */ - .port_cnt = 7, /* total physical port count */ + .port_cnt = 7, /* total physical port count, including + * the cpu port + */ .phy_errata_9477 = true, }, { @@ -1492,7 +1494,9 @@ static const struct ksz_chip_data ksz9477_switch_chips[] = { .num_alus = 4096, .num_statics = 16, .cpu_ports = 0x7F, /* can be configured as cpu port */ - .port_cnt = 7, /* total physical port count */ + .port_cnt = 7, /* total physical port count, including + * the cpu port + */ .phy_errata_9477 = true, }, { @@ -1502,7 +1506,9 @@ static const struct ksz_chip_data ksz9477_switch_chips[] = { .num_alus = 4096, .num_statics = 16, .cpu_ports = 0x07, /* can be configured as cpu port */ - .port_cnt = 3, /* total port count */ + .port_cnt = 3, /* total physical port count, including + * the cpu port + */ }, { .chip_id = 0x00956700, @@ -1511,7 +1517,9 @@ static const struct ksz_chip_data ksz9477_switch_chips[] = { .num_alus = 4096, .num_statics = 16, .cpu_ports = 0x7F, /* can be configured as cpu port */ - .port_cnt = 7, /* total physical port count */ + .port_cnt = 7, /* total physical port count, including + * the cpu port + */ }, }; -- 2.17.1