From patchwork Thu Sep 16 12:03:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 513509 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 2E5D9C433F5 for ; Thu, 16 Sep 2021 12:04:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 12ECC61251 for ; Thu, 16 Sep 2021 12:04:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238958AbhIPMFe (ORCPT ); Thu, 16 Sep 2021 08:05:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238947AbhIPMFd (ORCPT ); Thu, 16 Sep 2021 08:05:33 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EE89C061764 for ; Thu, 16 Sep 2021 05:04:12 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id g1so17517833lfj.12 for ; Thu, 16 Sep 2021 05:04:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tavpQkYuy52OCAShN3NPMI9ZYShoBfhaEMeVmVE/1KY=; b=q4C25UGJusCW19Pdj64ThhcZXC5vfuDrZ7zSXxrVqsAJzJk5wbqi4wEwMaeM/0vvNW BmokrpXJMxgFe4BhzA2Oy4dbwIcR+ytRpSVydQrPXxx0OlFM0gETqmKDiYTfiNTzTkeF dgtBv6F4B05p+90fk2z9QGw53alXLBACbKzv25Htr/LE0uEvSrEfQtvDXsg+USyy+eeq tQa4DSQMpPIcYUS9ZH5SVWhoU7Hr7HhBtg5BtjVLi+1D01yLzCsq2GP95BNw+BwAvkSt JjbdHc6tD8jqzT+U4E923nPL5cU3hGlVX/jh+gqCSEJn3x7M8hnnujNCzG6uxrEXATIT ng2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tavpQkYuy52OCAShN3NPMI9ZYShoBfhaEMeVmVE/1KY=; b=rFF4ppYKeYA4koMshOEwbqE5Inp+uTxa5nZ9cfs8VBLkGZttaFZnOiUHQp5FA4EOw7 8VyPh+idP9V50yqHQ0gPeHqn0BgM3dMkUjNVuFELzDlK8dpUzCfHBXc9C6PRM4SwmF1A QulIirNp8uUdowqmgMcqXrXr7A/zoBtCUi1ecd48xqYbt28XIJwv5CojEkjzz4b8aIXi Ma0UMPOTVhtJOfqQ6ZC45eXvC7NaPdrsYDQrJgKJZ1DMqDHtXTWy/uQGefnfBKXsorge MR6+BXUk04qYjVMXJWSsSYtsnO7xy0dYIVPNSjU2wFh2YK4HGmSC5wGBVmZPnvRgzlvz 8slg== X-Gm-Message-State: AOAM533ik4H/zIZcpwYQIzO/2nd2UahM1KLvcs2OyxkcerF+MLVwndBf 4/JZcXGWNgGCP/GZpxpm84Q= X-Google-Smtp-Source: ABdhPJzv8hMzTMEzdoWAXEan6debKSfQfFlUSqr0dtebLdfPBHgNGQOFk4cPXXTUpP2175cNXy0CXw== X-Received: by 2002:a19:6b13:: with SMTP id d19mr3766848lfa.344.1631793850747; Thu, 16 Sep 2021 05:04:10 -0700 (PDT) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id h8sm243010lfk.227.2021.09.16.05.04.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Sep 2021 05:04:10 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Andrew Lunn , Vivien Didelot , Vladimir Oltean , "David S . Miller" , Jakub Kicinski Cc: Florian Fainelli , netdev@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH net-next 3/4] net: dsa: b53: Improve flow control setup on BCM5301x Date: Thu, 16 Sep 2021 14:03:53 +0200 Message-Id: <20210916120354.20338-4-zajec5@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210916120354.20338-1-zajec5@gmail.com> References: <20210916120354.20338-1-zajec5@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Rafał Miłecki According to the Broadcom's reference driver flow control needs to be enabled for any CPU switch port (5, 7 or 8 - depending on which one is used). Current code makes it work only for the port 5. Use dsa_is_cpu_port() which solved that problem. Signed-off-by: Rafał Miłecki --- drivers/net/dsa/b53/b53_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index ca84e32baca0..13f337a102ba 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -1222,7 +1222,7 @@ static void b53_adjust_link(struct dsa_switch *ds, int port, return; /* Enable flow control on BCM5301x's CPU port */ - if (is5301x(dev) && port == dev->cpu_port) + if (is5301x(dev) && dsa_is_cpu_port(ds, port)) tx_pause = rx_pause = true; if (phydev->pause) {