From patchwork Sun Jun 11 17:19:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 106143 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2151317vqr; Sun, 11 Jun 2023 10:49:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7BtROQ6Wo3G9ABHKfCTfnvpPycyHmTP2mqFgyWzD0zg5Ipk6wm8v+E1g2wP5GxnkdmFHHe X-Received: by 2002:a17:907:2d26:b0:94b:4a4:2836 with SMTP id gs38-20020a1709072d2600b0094b04a42836mr8010542ejc.69.1686505759369; Sun, 11 Jun 2023 10:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686505759; cv=none; d=google.com; s=arc-20160816; b=dcKj5ODRKw1cs+bhpLqGRAqp8t3W/E4+d1dOFCS4VRo25EIjTFXXpE8Y0wVBo36plM sLgS6old1ZTzlDRmgYxioWByaUnl1eL9MEYD8blyvtxAy0aaQSz2du70QneKr0KfAi66 k4eKrwjnKmIwsMrhPu3QYP7HOMm5S+X3udNgKA8vCYkMrPkkeE9ZVJy1qPT2mch2FCbZ kLVPeIR3bps9W+yoIVjNa1pCZ+3/rrx//HWsZDnljMEVxQa7Xp69aYI8/sCiOFSY9//t jexuJcURyI7TV8n2bdAUYdoKDKiQpyW0aGhwgWW74cBSM7/LrjyAC46tkjBm0QYO+pSA epTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=dP7IJu7EVYI3ipczc08Dg8dBO1T7j1G381JN6RJ5mVY=; b=M0QV9sf+jDV2j05zDkFy4GjcYyBdeB/GYMAdAK9YmsFxMsGOKgRT3IcTGh7vFpyBnB j32YrujRUdb14mPx3StohN5ztAhDKkUxNojNSedPQ1Geb9TpagrBYy9SEZSKlJxrJEc8 TxXz/o0k983gbL4Jw7+xuVsgYaHCqV6HCSm0Z0CZMtc8uVKVYIeKXoyHbzDg4z8zA218 v0OgruczjhIrjpc+8IRe+jAcO2KrEwItCRumb/OX9UDv7ZOtYpdigEN1umuP+clq3ay6 hj/8UR140qg9nEIlzcFyac2bnQAqti1N/Q+TzVTAAcUzINZMXLznGiCLjHIxodnUouxr Xcyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j4-20020aa7ca44000000b005149dd97237si4932671edt.219.2023.06.11.10.48.55; Sun, 11 Jun 2023 10:49:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229604AbjFKRUW (ORCPT + 99 others); Sun, 11 Jun 2023 13:20:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230515AbjFKRUU (ORCPT ); Sun, 11 Jun 2023 13:20:20 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 210661BDF; Sun, 11 Jun 2023 10:19:57 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 060279200C4; Sun, 11 Jun 2023 19:19:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id F3F579200C0; Sun, 11 Jun 2023 18:19:36 +0100 (BST) Date: Sun, 11 Jun 2023 18:19:36 +0100 (BST) From: "Maciej W. Rozycki" To: Bjorn Helgaas , Mahesh J Salgaonkar , Oliver O'Halloran , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni cc: Alex Williamson , Lukas Wunner , Mika Westerberg , Stefan Roese , Jim Wilson , David Abdurachmanov , =?utf-8?q?Pali_Roh?= =?utf-8?q?=C3=A1r?= , linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v9 06/14] net/mlx5: Rely on `link_active_reporting' In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768429463129707314?= X-GMAIL-MSGID: =?utf-8?q?1768429463129707314?= Use `link_active_reporting' to determine whether Data Link Layer Link Active Reporting is available rather than re-retrieving the capability. Signed-off-by: Maciej W. Rozycki --- NB this has been compile-tested only with PPC64LE and x86-64 configurations. No change from v8. Changes from v7: - Reorder from 5/7. Changes from v6: - Regenerate against 6.3-rc5. New change in v6. --- drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) linux-pcie-link-active-reporting-mlx5.diff Index: linux-macro/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c =================================================================== --- linux-macro.orig/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c +++ linux-macro/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c @@ -307,7 +307,6 @@ static int mlx5_pci_link_toggle(struct m unsigned long timeout; struct pci_dev *sdev; int cap, err; - u32 reg32; /* Check that all functions under the pci bridge are PFs of * this device otherwise fail this function. @@ -346,11 +345,8 @@ static int mlx5_pci_link_toggle(struct m return err; /* Check link */ - err = pci_read_config_dword(bridge, cap + PCI_EXP_LNKCAP, ®32); - if (err) - return err; - if (!(reg32 & PCI_EXP_LNKCAP_DLLLARC)) { - mlx5_core_warn(dev, "No PCI link reporting capability (0x%08x)\n", reg32); + if (!bridge->link_active_reporting) { + mlx5_core_warn(dev, "No PCI link reporting capability\n"); msleep(1000); goto restore; }