From patchwork Tue Jun 8 11:16:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 456423 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.8 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, 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 ABEAAC47082 for ; Tue, 8 Jun 2021 11:17:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E37D61008 for ; Tue, 8 Jun 2021 11:17:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231710AbhFHLTA (ORCPT ); Tue, 8 Jun 2021 07:19:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231172AbhFHLS7 (ORCPT ); Tue, 8 Jun 2021 07:18:59 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B623C061574 for ; Tue, 8 Jun 2021 04:17:06 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id og14so26694142ejc.5 for ; Tue, 08 Jun 2021 04:17:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=X1OHkdWCJzA5G7HjR6q3jFZ8XtuTT/1SsQlBOUKHX8w=; b=llB4PJmVUsltHY6Bdhw6pj/kBXElBqyntNdc83ShracFJqPIH/r+8zwQxvEObJBB/n tEQD7LbgMZqeE0NORju8D5DrpVoZybiRaTlPnB+ZfRvbookOQQqaqJ+RBDNjLNITMRbH 6jEJlLply41FN3M+gnROWGkM0BYxglofI+zM4BFAvNy5P9qmnZG6J9Egzk5FhbVMYzHN nznFBroWLidsZ346lt+pd+WROW8m4vwqqFbKPn2YaZ5Uhuljqz9t81egDDatQNHeG0n6 rOpAoKtThQMcbsbARe0upGK1Kcks1qJcTHurqZM5wtakMZhMBfn00iiBE57ZFFvJoThd BIxA== 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:mime-version :content-transfer-encoding; bh=X1OHkdWCJzA5G7HjR6q3jFZ8XtuTT/1SsQlBOUKHX8w=; b=B/gofTsDQHwh3wdtnBZVUT+Y3AKdbUh6sjMDYrGlK6cjc6BwIt2xYsN4v4+kb5iKB7 vMLYe4G8vS2/M7PDzkV851q3yYAXybjo3RUj9DKUvXp2wf2V+69c718O6GgfdYSY8vO9 sElNhMqonKYas7csFwpSS/isIsSB6JgPZRbUPYwilGFSWx4yVE26oozoVzOl9xmnSI46 hz5hAFvgyoZPOlC4d3uLlJxcyy5ByB2qowqJUHHGjznvMGiSTArwuYAES0bONb1C1DvP 1mGdpRKLLAXrQ0uaxiHNNKnhAERlLRNuhcqnX6yvl03S7zRkTmP2pGP6xLwnSi7z3j9R seLQ== X-Gm-Message-State: AOAM5314FnROwk7eI8PXktlCWI3U7P3dCb5D8gAPBjjjFtB5wfmxE7SA iH7TjjTkL6gh9cS5mhMXhdI= X-Google-Smtp-Source: ABdhPJzb8oZqoghixaytf4ptmAzDTkVd+aldnC2/HmnaXH02zcldyTkdSt9l0Q+PIBSBjd26fNnc+g== X-Received: by 2002:a17:906:e4b:: with SMTP id q11mr22412770eji.404.1623151023456; Tue, 08 Jun 2021 04:17:03 -0700 (PDT) Received: from localhost.localdomain ([188.26.52.84]) by smtp.gmail.com with ESMTPSA id am5sm7617980ejc.28.2021.06.08.04.17.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 04:17:03 -0700 (PDT) From: Vladimir Oltean To: Jakub Kicinski , "David S. Miller" , netdev@vger.kernel.org Cc: Florian Fainelli , Andrew Lunn , Vivien Didelot , Michael Walle , Heiner Kallweit , Russell King , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Vladimir Oltean Subject: [PATCH net-next] net: dsa: felix: set TX flow control according to the phylink_mac_link_up resolution Date: Tue, 8 Jun 2021 14:16:51 +0300 Message-Id: <20210608111651.4084572-1-olteanv@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Vladimir Oltean Instead of relying on the static initialization done by ocelot_init_port() which enables flow control unconditionally, set SYS_PAUSE_CFG_PAUSE_ENA according to the parameters negotiated by the PHY. Signed-off-by: Vladimir Oltean --- drivers/net/dsa/ocelot/felix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index ce607fbaaa3a..a2a15919b960 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -940,6 +940,8 @@ static void felix_phylink_mac_link_up(struct dsa_switch *ds, int port, ocelot_write_rix(ocelot, 0, ANA_POL_FLOWC, port); + ocelot_fields_write(ocelot, port, SYS_PAUSE_CFG_PAUSE_ENA, tx_pause); + /* Undo the effects of felix_phylink_mac_link_down: * enable MAC module */