Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6557060rwl; Tue, 4 Apr 2023 14:57:29 -0700 (PDT) X-Google-Smtp-Source: AKy350a+MJbH8C+LnQPWoyuCkjDXJa0nLGB7gF360qwxmCHMkZ60LDY5gP3rjtZTfAyAamHDRy+O X-Received: by 2002:a05:6a20:1e4b:b0:d9:49a9:fe6c with SMTP id cy11-20020a056a201e4b00b000d949a9fe6cmr3191274pzb.11.1680645449468; Tue, 04 Apr 2023 14:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680645449; cv=none; d=google.com; s=arc-20160816; b=nmiuAV6Fq4aXOnam3ePvX1erfoHcrIIJVI9S4bTjfEr2wZU0Ya7FEbNwU2EpGrlPS2 I6g7qF2cnAOus9LdrzG/TWvK9fD++2RvXZwsDGH5snLxpr1yNyCYOlF/H11HV+RY08lu Ys53r9dIhHsbFZDFn8p5v3sQgyccuLGR/ckVGob1lYhmO79ZDzPwhiySNLzmVi4hJB/M +qfITfMYvM5lOsmq0J2dtw+uJrOj+xgd5otVAappDL0maGA8akc50uvP5NK0Z6s1cV8M tECvK1KsKillb2CLROVnpmJeOtVpJJqGq/B2Kxq3Qr3vSlDM9B7HdlntI3FjP2moAKZS xZeQ== 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=zHjZ16GpfLG+FcAgIZAoABWw8gUupEYfkCs4W2TqG4o=; b=oOQq74pWVbmK30Ua6V1T/+JKSvPMVuS+GHcjGJaRiSAwyAw0i34helWEpIKfyCr416 QaQmzCKUMAnWqCAtV2K2fa+fTzDiV2yu0KVkSFzYyiEbCVTUhqR0bl8iBVPaUE1NXYin /Hz53sRu8oTTRggEgt7smY9iL/+EGGkPJ/uBpvl9ubB6SNyS4NWtrz0mOPX978shb89A YZKmpg7+Xc/IRvKe+e3q9cRqpBwGzVYsFtTV0//RkEd+fHVl2TXiI/UGShWxI87K7DmW qGoaBwnPdWnWPE309MBbq+O/JqhgoDiWEHrxvkMAfiNLde72SK9swnEACfUrcuBeZZNk Y2+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 y32-20020a634960000000b00502d88d64d9si11024778pgk.53.2023.04.04.14.57.17; Tue, 04 Apr 2023 14:57:29 -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 S236552AbjDDV4E (ORCPT + 99 others); Tue, 4 Apr 2023 17:56:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236510AbjDDV4A (ORCPT ); Tue, 4 Apr 2023 17:56:00 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6EF014697; Tue, 4 Apr 2023 14:55:59 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 990E39200B3; Tue, 4 Apr 2023 23:55:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 96A0992009E; Tue, 4 Apr 2023 22:55:58 +0100 (BST) Date: Tue, 4 Apr 2023 22:55:58 +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 1/7] 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=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 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 --- No change from v6. No change from v5. 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 @@ -90,8 +90,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. @@ -213,7 +211,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))