Received: by 10.223.185.116 with SMTP id b49csp2186548wrg; Thu, 22 Feb 2018 09:26:37 -0800 (PST) X-Google-Smtp-Source: AH8x226P1LWrOkMJbLhWVpgB0dlgncS34BM4FMg5wJ9Zj4yd4S/NtUyESSU6GQqj6Npxo2Smi9QT X-Received: by 10.98.5.129 with SMTP id 123mr7578276pff.75.1519320397445; Thu, 22 Feb 2018 09:26:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519320397; cv=none; d=google.com; s=arc-20160816; b=TBHwe33JgbnmYZ/RpgI2iBUvb5dugeP6pCw5LZ+nNl/a/kh4jzgljA9fy7xxJHYJkQ NhzpGJyI8gNM9437g9PkeI54gLVb+HcsHk8dVHhxDDu4TIxgUEmmixJfqR+DLis276aJ y/EWEB93vwKYlAvTfZVamU3quQ/3YSavqz9YAiz2jKQWkQyju53NnP6PLLZnuirSKRMq 3ruYSCoFtPPpc0U37R04cQGOowM+FEzJN9HUzboiZtmMUPjZuB+Rg/JT2NM2H/JHx/GQ zjwFjQxfVYdyxbjTgyqyHp9wEjFeACFKj9lJ8CzRquKtSiQGZNbMT0B4rjhXuPNMTnKX fbDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=H4nlkKSvgH6/ZnNgXdXhxkgutKXxNf1u+DP0z7j/Nys=; b=xQZR1er7mLfNmzFO68De5g92QA2RVx2y4ihk5U/xnZ3eFe7ifnPDcJi7ks4cPluYnY xf2oXeB6KVm1Ut8NFB7cGmr5I0oJ10WH0FB2IR0hmbGD3gc1TE9s8AvVPq25Se0P1xLb 6MYoBO4ZSsdATrU/lvx7BZbm4wgiQ6CD6IGpEH5QHFQja4cgRbVhxMPyeEv/tSbk0URR mmtJeRanF1kIMSiqeJc3JEdmU1TBZlVVfcQMI0WsBiV+Lc/rrfGfipH0y40zGLefh6UV izqDKTrmLUbBcZ+Y4MCWYosIoRsK2gz9OzYP3BuQgSnY166uU/O0D6g3va7WsJ2aT5HK rb2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=TA8XJUeO; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k9-v6si337520plt.293.2018.02.22.09.26.22; Thu, 22 Feb 2018 09:26:37 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=TA8XJUeO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933476AbeBVRYP (ORCPT + 99 others); Thu, 22 Feb 2018 12:24:15 -0500 Received: from mail-oi0-f45.google.com ([209.85.218.45]:41976 "EHLO mail-oi0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933210AbeBVRYN (ORCPT ); Thu, 22 Feb 2018 12:24:13 -0500 Received: by mail-oi0-f45.google.com with SMTP id e10so4253833oiy.8; Thu, 22 Feb 2018 09:24:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=H4nlkKSvgH6/ZnNgXdXhxkgutKXxNf1u+DP0z7j/Nys=; b=TA8XJUeO58FDOCmhFbmG5pJQdR2HMEHc6z37nV/nkSqpw0RiSPxbhZnGIACSirhBrf 4qHP6OEI+Lnz6BrG0RN12ZMFwOfDrKiWRDcKhhfrqMR6RQsbb8n6Nw7vLPuvkIIURViO WEejz2oFDMmhNFt1QAQExxsUB9kbkAzSpHAfKERm6zIeDvrTnV9blYj+E4TS+WPDox8U UR0Os3z+WEALLqHUU3f+aIrskzjAydRVwMgEocWiLRuXXm9EimovlmxlCMN903gnwveQ QixVziNFuSe3JZxBSJNlG38p95Du+Suwa3abYiyk3OrM06bVnR45Hm1T7J7beoU6bfMu lMgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=H4nlkKSvgH6/ZnNgXdXhxkgutKXxNf1u+DP0z7j/Nys=; b=ZR84p6BVsJYAUoUbDAH2MptaD8PHwKQMCQ+kEqkcb3EU140rH7ML6ETC51a4wj4CZ+ S3UYFtICOKu2Olh/BOJLOH8SnmalmkLYKNVDdaiGqkDiHhYkGz8l9s6+kas2Ck7i2hy9 UaWTupFrW73r/E8/0ljwZyugYp3yqKpMcASzpNiiwwOD17c0UJKpvHs73xYXvoZzK0ut KmawNWrC6nFx8mZeEDaTRvG+YVtrDxxj0HKQHVaUSdb2IBB1v3Xis1F5ww9uI/sCGXy0 jviLjGXzYOYecmGcYq05Jtcc6HSJHT3AVnTCsEX57q5qvSZWcRn81ua1QEnihHQHkvBL +UrQ== X-Gm-Message-State: APf1xPCVKCrYT3VGWqGlbql4l5EHpuCnoymMQRCIUBbQX7rDbBfxi+Df 8JiBcwKO4DofdsSV6UORwrHLGzwruA6waCxAuTY= X-Received: by 10.202.231.196 with SMTP id e187mr4896548oih.358.1519320252430; Thu, 22 Feb 2018 09:24:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.44.146 with HTTP; Thu, 22 Feb 2018 09:24:12 -0800 (PST) In-Reply-To: <93faaf7b-5f9a-72e7-7816-47b83887740d@intel.com> References: <151908155159.37696.9710083237704994886.stgit@bhelgaas-glaptop.roam.corp.google.com> <151908204614.37696.12828004282495415825.stgit@bhelgaas-glaptop.roam.corp.google.com> <20180220181554.GA32228@bhelgaas-glaptop.roam.corp.google.com> <20180222131834.GA5527@wunner.de> <93faaf7b-5f9a-72e7-7816-47b83887740d@intel.com> From: "Rafael J. Wysocki" Date: Thu, 22 Feb 2018 18:24:12 +0100 X-Google-Sender-Auth: Y1rlqqt1hRxhMeDkxnjCJGb1DH8 Message-ID: Subject: Re: [PATCH v1 2/2] PCI: Allow user to request power management of conventional and hotplug bridges To: Lukas Wunner , Bjorn Helgaas Cc: Linux PCI , Valdis Kletnieks , Mathias Nyman , Linux PM , Mika Westerberg , Linux Kernel Mailing List , Peter Wu , Qipeng Zha , Greg Kroah-Hartman , Andreas Noever , Dave Airlie , Qi Zheng , "Rafael J. Wysocki" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 22, 2018 at 2:31 PM, Rafael J. Wysocki wrote: > On 2/22/2018 2:18 PM, Lukas Wunner wrote: >> >> On Tue, Feb 20, 2018 at 12:15:54PM -0600, Bjorn Helgaas wrote: >>> >>> Basically I was hoping to partially rectify what I think was a mistake >>> on my part when we merged this. 9d26d3a8f1b0 ("PCI: Put PCIe ports >>> into D3 during suspend") is somewhat misleading because it suggests >>> that PCI bridge power management can only be supported on non-hotplug >>> PCIe ports, when in fact this was mostly a question of testing and "we >>> know this works on the systems we care about so we're going to >>> minimize our risk by excluding others". These constraints seem pretty >>> Intel-centric and it's not clear how or whether they apply to other >>> architectures. >>> >>> Adding the comments will help with that some, but in general I don't >>> like to artificially limit feature support because it reduces testing >>> exposure and makes future maintenance more difficult. >>> >>> For example, we disallow D3 for hotplug bridges. I don't think the >>> spec requires that, so the fact that we put that limitation in >>> suggests that there was some issue we didn't fully understand, and now >>> it will be hard to go back and figure that out if and when we *do* >>> want to support D3 for hotplug bridges. >> >> Some x86 machines which handle hotplug in firmware, rather than natively >> by the OS, require that the OS doesn't transition them to D3hot behind >> the firmware's back. That's the reason why Mika excluded them from >> runtime PM: >> https://bugzilla.kernel.org/show_bug.cgi?id=53811 >> >> If the OS handles hotplug natively, transitioning the ports to D3hot >> should be fine in theory. I submitted this series last May to extend >> runtime PM to those: >> https://www.spinics.net/lists/linux-pci/msg60962.html >> >> However Ashok Raj tested them on a Xeon-SP system and got Hardware Errors: >> https://lkml.org/lkml/2017/5/3/480 >> >> I'm not sure if I've done anything wrong in that series or if we're >> dealing with an incompatibility of this particular platform with D3hot >> on hotplug ports. > > > Thanks for mentioning that, and for the pointers! > >> We do need runtime PM on hotplug ports to power off Thunderbolt >> controllers when nothing is plugged in. That saves 1.5 W, so a >> noticeable amount of power. I was going to respin the series one >> of these days, I think the best I can do is continue to forbid >> runtime PM on hotplug ports by default, but whitelist it for >> Thunderbolt and allow manually enabling it on other platforms via >> the command line. That way, vendors are put in a position to >> validate their platforms for runtime PM of hotplug ports, and >> perhaps someday we can enable it for all platforms by default, >> but with a BIOS cut-off date. >> >> As for the existing 2015 cut-off for non-hotplug ports, I remember >> Rafael writing that we may try to slowly push the cut-off further >> back into the past and stop as soon as problems are reported. >> That hasn't happened yet because noone had a need for it. > > > Right. > > There's more background related to this particular thing worth mentioning > IMO. I'll write about it later today. It is generally advisable to realize that in many cases platform validation is relative to the specific software stack the given platform is going to ship with. If there are hardware (firmware, similar) features in the platform that aren't exercised by that software stack, they may receive limited testing coverage and they may not be reliable in practice even though the formal specification of the hardware etc may require them to be functional. Now, I'm not aware of any OS doing PCI-to-PCI bridge power management in a serious way. It is formally there in the PCI PM spec, but it is optional and that spec itself was separate from the PCI proper in the past. AFAICS, PM is mandatory in PCIe only. For this reason, there is a huge risk related to enabling PM on PCI-to-PCI bridges which is why we don't do that. Also nobody hadn't really done runtime PM even on PCIe in practice before 2009 and power management of ports started to be done in the Windows 8 time frame, presumably because of Connected Standby. It generally is risky to assume it to work in hardware that shipped earlier and that's the reason for the cut-off date: we knew that there had to be a cut-off, but there's no reliable science on how far in the past to put it, so we chose a date relatively close to "now" with an option to move it back if need be. Thanks, Rafael