Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4603133rwd; Sun, 11 Jun 2023 10:48:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4DXedYXVRzIbMo97wniwi99bP8VKFSEHxiWP+DTuBoHzpXFfbCGQDXqfkbMyXPRHxm4Ku3 X-Received: by 2002:a17:906:ee83:b0:974:5480:171e with SMTP id wt3-20020a170906ee8300b009745480171emr8881404ejb.32.1686505726474; Sun, 11 Jun 2023 10:48:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686505726; cv=none; d=google.com; s=arc-20160816; b=dX/78xIIivgW+PxuhFj4SiNHh+5bgjF+ySa3TfdGCjQbxotrX3nD8QDl1lnuU9P4QI u+gqO6Of9loL0rZ0kTAiYkje+X0g2vWjKjXxwLb/qQbTrwHcEDbRvQkiSGEPEFu7zpMC 9W+hhrVexaXRuzOWVYG0SKjAAgyot8sj6XbAzyF5riEk8Pvs/e75KOjpuxGp5Rlzu1VY vFD3nX6U0G2oGYLv1Nu5hrNnDzZxyarqV11nIO/zK5/i9V3DfaKgIms/1JPUIsTQVzGh roofseJ5yPWa1/DJdHU2ODzRiEziRYgmD5ww2XQTHFOqhBfN0ofORAbWzTgjfYkkRDEQ f3sQ== 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=lIlFy+sUklVWA07f2WsNkrJoBRqOCpMxq4gcyXJh+Fw=; b=izg6AFb5K9+cNBXZwaacYLd0v+fAOaO9/GriBL+Zy1NwrIqLXFgB2XBmpWSG1REejE 0V8PYXCwMEKutxUBXX7uxxp8iDxGmAO1KUDqqcQIP2XzSzmnK55Qr7cxaIhCFxkcns9x Z/qHuI8zHZRWQuCc+fxL6SydbEkpDhREKqDo9A9rGUF385yTmaaiGLqo/6k4sZktLFZa QdxHLxdw++oeWk16Jrlph/jOSXPc/U8zMvkaQPepYRVlzngQvu/95vOqDqRgec/1G+nT FfVwW2z30eCaN+2wgEl7HJB9ui3CrAtwD2b/JwhOEdHHK0/qx2shbv7zJuMaLRyfCgze Sl/Q== 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 qw7-20020a170906fca700b00978970d5573si4124006ejb.156.2023.06.11.10.48.22; Sun, 11 Jun 2023 10:48:46 -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 S233238AbjFKRTT (ORCPT + 99 others); Sun, 11 Jun 2023 13:19:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229636AbjFKRTR (ORCPT ); Sun, 11 Jun 2023 13:19:17 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0981BE5F for ; Sun, 11 Jun 2023 10:19:15 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 0EA1A9200B4; Sun, 11 Jun 2023 19:19:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 0B5499200B3; Sun, 11 Jun 2023 18:19:15 +0100 (BST) Date: Sun, 11 Jun 2023 18:19:14 +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 v9 01/14] 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=-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 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 Reviewed-by: Lukas Wunner --- NB this has been compile-tested only with PPC64LE and x86-64 configurations. No change from v8. Changes from v7: - Add Reviewed-by: tag by Lukas Wunner. - Reorder from 6/7. 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)" : ""); /*