Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp896665ybx; Thu, 7 Nov 2019 04:19:55 -0800 (PST) X-Google-Smtp-Source: APXvYqzYO9NRrc0Yfx+1xqgxKl2zA7NbYa5kqLKWvSpfPic6t9hvlE5BD1umXgydftRjwyb2D36k X-Received: by 2002:a17:906:3fca:: with SMTP id k10mr1262408ejj.107.1573129195188; Thu, 07 Nov 2019 04:19:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573129195; cv=none; d=google.com; s=arc-20160816; b=QRIe8bEYg6ChTzteU+1DKe9c13Sk3WMTV/QgZR4pqB1vpvFRiKlzOYX4jGfNYsaw1T lgq96JKABoYzHerN4ahlvpEd2UVjjIGtBgkiExhklmAdWsRWkumX707724YAGqVgC6hf nfILuAWNY8irKOm9nof67w5ur5yfcMhbg0fkGUfGINYGwzqqLpNnUMs09oHDBMsH/rW4 GKNkEuU0mIN/Qqz0PlOzDNow6qMusrR/ORLVTbpvUkOGH8kWvRzDWIc/6C52y0JB5aXU Y15B8JYOy/+3a/b9+Dpq/yEvh2cK9ED1OlkRQe+dAunOzWJyLYg6whWtSegi3Y9kTVZQ rKSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=odqJi3zAULnZkt5Ra1IGJaxbtv1Em6KLmbCeVouZVq8=; b=tpCqNCena/yLBNAt2Pd0/Su4aCaRx0pJJ/YCB8x9b1/Zxi/2Q9JQZfr7Qy6zMPU1PU OpnH1aYH6VqVzvgpnNSZFlbXeN1zNS1ZUGBAArdKwL0L16hM17F9ny+p5B5qiu4InT6Z ntU5TOSiSFHksvMNsgsCU3SS9pDqVF6OpNPUStjrW3gg9gVYAr8VYvrjogHxBlJO8j3T WWzS4k7c2F3rWCbFgh8Y1tEoD6ERnH1JUC7+TiES1t3okh1IasiW8dx7GIwdKs9ORNtm ajgcHA31jyWvFjzLOFiSBtC4x8/W0WibBC99Fc0rgxrP8cApIETyLe5PYPam22guSq1e sJnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c36si1305731edb.58.2019.11.07.04.19.32; Thu, 07 Nov 2019 04:19:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388491AbfKGMSz (ORCPT + 99 others); Thu, 7 Nov 2019 07:18:55 -0500 Received: from mga06.intel.com ([134.134.136.31]:62176 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727458AbfKGMSy (ORCPT ); Thu, 7 Nov 2019 07:18:54 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Nov 2019 04:18:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,278,1569308400"; d="scan'208";a="213008221" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 07 Nov 2019 04:18:49 -0800 Received: by black.fi.intel.com (Postfix, from userid 1001) id 184A1115; Thu, 7 Nov 2019 14:18:47 +0200 (EET) From: Mika Westerberg To: Bjorn Helgaas , "Rafael J. Wysocki" Cc: Len Brown , Lukas Wunner , Keith Busch , Alex Williamson , Alexandru Gagniuc , Kai-Heng Feng , Paul Menzel , Nicholas Johnson , Mika Westerberg , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/2] PCI: Add missing link delays Date: Thu, 7 Nov 2019 15:18:45 +0300 Message-Id: <20191107121847.24781-1-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 2.24.0.rc1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, This is third version of the reworked PCIe link delay patch posted earlier here: v2: https://lore.kernel.org/linux-pci/20191004123947.11087-1-mika.westerberg@linux.intel.com/ v1: https://patchwork.kernel.org/patch/11106611/ Changes from v2: * Rebased on top of pci.git/pci/pm. * Update references to PCIe 5.0 spec. * Take d3cold_delay if child devices into account. This allows ACPI _DSM to lower the delay. * Check for pci_dev->skip_bus_pm in pci_pm_resume_noirq(). * Drop comment that mentions pciehp where pci_bridge_wait_for_secondary_bus() is called. * Use pcie_downstream_port() in pci_bridge_wait_for_secondary_bus(). Based on the discussion around v2 there is a potential issue when restoring PCI_EXP_LNKCTL2 (regardless these patches) that we may need to retrain the link. This series does not include fix for that since it is not yet clear how we solve it. I can do that as a separate patch once we agree on the solution. I'm submitting these two now in hopes that we can get them included for v5.5 because there are systems out there that need them in order to function properly. Changes from v1: * Introduce pcie_wait_for_link_delay() in a separate patch * Tidy up changelog, remove some debug output * Rename pcie_wait_downstream_accessible() to pci_bridge_wait_for_secondary_bus() and make it generic to all PCI bridges. * Handle Tpvrh + Trhfa for conventional PCI even though we don't do PM for them right now. * Use pci_dbg() instead of dev_dbg(). * Dropped check for pm_suspend_no_platform() and only check for D3cold. * Drop pcie_get_downstream_delay(), same delay applies equally to all devices (it is not entirely clear from the spec). Mika Westerberg (2): PCI: Introduce pcie_wait_for_link_delay() PCI: Add missing link delays required by the PCIe spec drivers/pci/pci-driver.c | 11 +++- drivers/pci/pci.c | 139 ++++++++++++++++++++++++++++++++++++--- drivers/pci/pci.h | 1 + 3 files changed, 141 insertions(+), 10 deletions(-) -- 2.24.0.rc1