Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp288995rwb; Sat, 17 Sep 2022 05:25:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4h7M/J2BcGpqE9vfsz9k9HkWITTSBgw8O/YcBUlOAZsq8BO7xnqW4HPJv3n5+mG/uGo8ph X-Received: by 2002:a05:6402:1ad1:b0:44e:8dfb:2d04 with SMTP id ba17-20020a0564021ad100b0044e8dfb2d04mr7588808edb.400.1663417555913; Sat, 17 Sep 2022 05:25:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663417555; cv=none; d=google.com; s=arc-20160816; b=w0H3zSYqerUpXt5Xc5XU3RAf68cTBUc0aSFqowyG28kfYM5e1YvZCjm7ZGWEYdF8tb t/cMfHM6w8c/VfA0jf9U09T67an3rVQNrK0UzXQDh3AvkGZwBmkiSTOR71+CiB/pZkRu iFVWmVOzs38G92HP51o3Uipj+gCZjm+ZYCz9rrUgBdZFru+sXj4Dz+vbsK9FADwHVNvi /CXv4douC6BXHM2sNtWfcUa7gGDE8fastVUgoyUIGfW+Y4TPsuzwEMHc66vUhCy5MFTJ QxLe0tzIq2kbJRxvr2dRHaN1kqINZuV4djs7vd/u8mUJ96KUQGleURNC68yrl0c3K0wC DMAg== 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=pVX+SCPFuv8Voo4fb88U/O3piEm2oEIGC5yzjmThsTo=; b=LIOGkguGJ+aMo9dtKxMlNx7+19K6bGxY6OuhVYAYmSIeAqfTo3zQu45Wnm3Pr9MoNE aqJjro4U2xhNc4cKlL7qIbZ6IswdhvqrAEovc74YkG4Yw1FykL6TglLYJhMAYAb15JRm luVvLwLubdaaeV7Cccw4N6waOmqgbzhU1V2+UzLam/RzGYF4zo0XnavrMbS2QjLj1Whx WIzqacVZYQi5j37T8ceisBLWHebjqh9oAEiHt6D+CFPF1FNPuRt+JGtXQxHBrrt05Lal +R6rH2/S5+OeoARXnGD5dClyCmevWh/DSyyNT3LXSCBdSDnBrtkvbzWvMnh/QQIPZam3 DH0g== 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 hz6-20020a1709072ce600b0077085fc25aesi19282977ejc.510.2022.09.17.05.25.30; Sat, 17 Sep 2022 05:25:55 -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 S229714AbiIQMDe (ORCPT + 99 others); Sat, 17 Sep 2022 08:03:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229658AbiIQMDV (ORCPT ); Sat, 17 Sep 2022 08:03:21 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BAE0C39B93 for ; Sat, 17 Sep 2022 05:03:20 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id E39DC92009C; Sat, 17 Sep 2022 14:03:19 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id DCEA292009B; Sat, 17 Sep 2022 13:03:19 +0100 (BST) Date: Sat, 17 Sep 2022 13:03:19 +0100 (BST) From: "Maciej W. Rozycki" To: Bjorn Helgaas cc: Stefan Roese , Jim Wilson , David Abdurachmanov , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 3/5] PCI: Export PCI link retrain timeout 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 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 Rename LINK_RETRAIN_TIMEOUT to PCIE_LINK_RETRAIN_TIMEOUT and make it available via "pci.h" for PCI drivers to use. Signed-off-by: Maciej W. Rozycki --- New change in v5. --- drivers/pci/pci.h | 2 ++ drivers/pci/pcie/aspm.c | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) linux-pcie-link-retrain-timeout.diff Index: linux-macro/drivers/pci/pci.h =================================================================== --- linux-macro.orig/drivers/pci/pci.h +++ linux-macro/drivers/pci/pci.h @@ -11,6 +11,8 @@ #define PCI_VSEC_ID_INTEL_TBT 0x1234 /* Thunderbolt */ +#define PCIE_LINK_RETRAIN_TIMEOUT HZ + extern const unsigned char pcie_link_speed[]; extern bool pci_early_dump; Index: linux-macro/drivers/pci/pcie/aspm.c =================================================================== --- linux-macro.orig/drivers/pci/pcie/aspm.c +++ linux-macro/drivers/pci/pcie/aspm.c @@ -89,8 +89,6 @@ static const char *policy_str[] = { [POLICY_POWER_SUPERSAVE] = "powersupersave" }; -#define LINK_RETRAIN_TIMEOUT HZ - /* * The L1 PM substate capability is only implemented in function 0 in a * multi function device. @@ -212,7 +210,7 @@ static bool pcie_retrain_link(struct pci } /* Wait for link training end. Break out after waiting for timeout */ - end_jiffies = jiffies + LINK_RETRAIN_TIMEOUT; + end_jiffies = jiffies + PCIE_LINK_RETRAIN_TIMEOUT; do { pcie_capability_read_word(parent, PCI_EXP_LNKSTA, ®16); if (!(reg16 & PCI_EXP_LNKSTA_LT))