Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6558200rwl; Tue, 4 Apr 2023 14:59:11 -0700 (PDT) X-Google-Smtp-Source: AKy350bu4y18aZhcWYSTlyuvkw1UgsCMMJjcdSx5THGscb51sHhOSBpTGVA/UaAvDTHQxyxULxnR X-Received: by 2002:a17:906:c2c6:b0:931:95a1:a05a with SMTP id ch6-20020a170906c2c600b0093195a1a05amr1131582ejb.62.1680645551569; Tue, 04 Apr 2023 14:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680645551; cv=none; d=google.com; s=arc-20160816; b=IluVG3oavvXhadPgBwzrD+EhVI93D657Q+7m+J8nuA8cAJpFYYkiddc5N3LEe0EA2s QKywtueO+QmcMBYVB3G7FeoP9fUUY8Nw5A0GrN0l/qXg3XVa7QQE0yxufh4b1cCEvptX 4PW0NIPwxhe5LAoBm8IdNmZfIdpJbk9pXleTNrisLgcDs+n8T87QF4dbJnam7F6lPAsr PpPl5Xv+0roOy89AaqmkZhxV8jtyxXLIT3FwX38daMELkkvYK6Ns7jB7ziRuEu3dQtwc guHFsPlDXctTBjqu/uqLIISZR5aWH/GUrfkaL+sDiqIQcRggmyux2etH0+0KEs+2Au8c T4hA== 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=kAsLVXOhW4GJKVjNBgEHDKkNomMpALuvkJ8Lifwtd3c=; b=G3z59DRkHbwpXlJ602BLP5A2m40HoqOz/7vpr1+S0dVCg8b494Ul3m0nKfdqZfVGWc NDGiczWZ2wDDRoUSTRdXyJimvODS02c+3Qm/78nVGbm08HHl0Pb9/F9FFMc+rMmSDXFz UBV0Bq4xxsgCWpX13eb6ANV+QWfJIa4ND4aMhwateQKAcARtJGeZcuOMfBvUi4km4PdR l64XsK0a2NaMB09LKkvsT1f15ZdFsZaLOJ/c5HMzfvumKGd/n8K6F/s9e44wQKFmx/02 j54qayZ7MXcHGdNljP2QCTgX1xuQChp6tFQiqo57shxkw7AJgpsZCs9GV/PHZPErnMk4 kYpw== 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 n27-20020a17090625db00b00920e94e35cdsi2672020ejb.901.2023.04.04.14.58.47; Tue, 04 Apr 2023 14:59:11 -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 S236557AbjDDV45 (ORCPT + 99 others); Tue, 4 Apr 2023 17:56:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236614AbjDDV4o (ORCPT ); Tue, 4 Apr 2023 17:56:44 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 51DC3469F; Tue, 4 Apr 2023 14:56:28 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 5CAD49200C5; Tue, 4 Apr 2023 23:56:21 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 591F29200C3; Tue, 4 Apr 2023 22:56:21 +0100 (BST) Date: Tue, 4 Apr 2023 22:56:21 +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 6/7] PCI: pciehp: 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. No change from v6. New change in v6. --- drivers/pci/hotplug/pciehp_hpc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) linux-pcie-link-active-reporting-hpc.diff Index: linux-macro/drivers/pci/hotplug/pciehp_hpc.c =================================================================== --- linux-macro.orig/drivers/pci/hotplug/pciehp_hpc.c +++ linux-macro/drivers/pci/hotplug/pciehp_hpc.c @@ -984,7 +984,7 @@ static inline int pcie_hotplug_depth(str struct controller *pcie_init(struct pcie_device *dev) { struct controller *ctrl; - u32 slot_cap, slot_cap2, link_cap; + u32 slot_cap, slot_cap2; u8 poweron; struct pci_dev *pdev = dev->port; struct pci_bus *subordinate = pdev->subordinate; @@ -1030,9 +1030,6 @@ struct controller *pcie_init(struct pcie if (dmi_first_match(inband_presence_disabled_dmi_table)) ctrl->inband_presence_disabled = 1; - /* Check if Data Link Layer Link Active Reporting is implemented */ - pcie_capability_read_dword(pdev, PCI_EXP_LNKCAP, &link_cap); - /* Clear all remaining event bits in Slot Status register. */ pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, PCI_EXP_SLTSTA_ABP | PCI_EXP_SLTSTA_PFD | @@ -1051,7 +1048,7 @@ struct controller *pcie_init(struct pcie FLAG(slot_cap, PCI_EXP_SLTCAP_EIP), FLAG(slot_cap, PCI_EXP_SLTCAP_NCCS), FLAG(slot_cap2, PCI_EXP_SLTCAP2_IBPD), - FLAG(link_cap, PCI_EXP_LNKCAP_DLLLARC), + FLAG(pdev->link_active_reporting, true), pdev->broken_cmd_compl ? " (with Cmd Compl erratum)" : ""); /*