Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6557973rwl; Tue, 4 Apr 2023 14:58:52 -0700 (PDT) X-Google-Smtp-Source: AKy350Z2Ml4FEYUka2AxNhppkxecAd1TIbA1Z50Hn3NplrvUfoHXvHsp8vbIHb4hRO187E2vrTqo X-Received: by 2002:a17:906:86d2:b0:930:d0f1:9d8 with SMTP id j18-20020a17090686d200b00930d0f109d8mr992976ejy.27.1680645532139; Tue, 04 Apr 2023 14:58:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680645532; cv=none; d=google.com; s=arc-20160816; b=XV/LifTsvPFitaE4bzta3f+PLL3Qe0byjAHXas5LMLmeYpAWswDgHn6W8yzZsXggOQ cM0uoMiDyKI/FGBV4lkk/32+SneJ/+zKg25r6o7RxrQ2/7q4G1h6oHoDq/V1fBagKu38 997Ijmgp99TT3L4vAXIhgDpVmdvmedCPXAZMcNtw7ERPBN1RCbEFeEHkUIWUjI2RLmNy 8einbdbOASMMzwDDwucabSbLWyoedg4i6ac/bimfvfLmInMTQyDX6HjX4Xqs8lowv5mx sjAS4RBydC6uVaOLDSwF0kNwK4Vz2kKnDlizwEBYxJzGjxGsUTJHZoaXfAUtnDH6cHI6 tU/A== 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=2xq7H5gDOPs2JyAkdYhHsqKRwN3A0GeI8/pSkVgDdUw=; b=y33axNc+7Es1WJxYrMJY3E9ARsmr4FrKI78qshFkRUQ7ccwMNTS+vVkKpzeTZ+NXvB ddzGobW2U0ck4vZcTWMw9/bHn9nfwBBIHQGqzTAxWLiIl+ZQDGdT4c2zRP6teCQ6Ygq4 O7JLrToC9FPX10qxsaQQWpk7vPlzPoCAEFUF1f43mbCHGjYx0TzWHmxQoY9tAyI5Wvqs uVimbeWGW+WgEQR+riAl+AmTruvMfndftLVJwZv3FA+NPd58BNRWiLKTzVgfc4+xCKkD i0cEex2C3LaXnImlIL8Y+75TuETb2/AmYz8EnZ7aGjHchOzlIsoX0Yp9Iyf4O2n0G5Or bv9A== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id uz29-20020a170907119d00b008e0363188e3si1129928ejb.953.2023.04.04.14.58.27; Tue, 04 Apr 2023 14:58:52 -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 S236625AbjDDV4y (ORCPT + 99 others); Tue, 4 Apr 2023 17:56:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236476AbjDDV4n (ORCPT ); Tue, 4 Apr 2023 17:56:43 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8BE884224; Tue, 4 Apr 2023 14:56:22 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 590169200C4; Tue, 4 Apr 2023 23:56:18 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 54C299200C3; Tue, 4 Apr 2023 22:56:18 +0100 (BST) Date: Tue, 4 Apr 2023 22:56:18 +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=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 v7 5/7] 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 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 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. 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; }