Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3465084ybc; Thu, 21 Nov 2019 08:43:20 -0800 (PST) X-Google-Smtp-Source: APXvYqzNAlV9a3n7w8mv3G0SsAmR8pzPdlJCG6yw1uX16uQXQoGZGNH2pL301zmO9feGAoU4cSli X-Received: by 2002:ac2:428d:: with SMTP id m13mr2571644lfh.64.1574354600291; Thu, 21 Nov 2019 08:43:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574354600; cv=none; d=google.com; s=arc-20160816; b=utwicEzktnYoqHz2MgkG49lr+PNYgYLNwFwhBr7C2521hLvAEZNDN0ZF3y03ZkVI0F I297k+H7HOuAC9rnv60AonEWvfDwxG8HzKzMu5K1vISiVF/aZtkEk3Yeifo+sEZaToWa M5TkuI08AbWVSXoe7UK8nn3jp8YWVz+ZWd66A5DhU5uni+I5V/WbUb3hR2FRl4QFbg/l ys2sEBd7ARBB8VtymwYQaI8K3UjsvDd83ucDy62QeBNirK/VN1/WOdwZaFIPBZ4g5icJ KU2l5q4bMgj9cQkyDpLWhwsve4/73rfDLxrjDHP9PzpOSWU31DQ6PjeI4YmdpB3RjZWJ fEcQ== 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 :in-reply-to:references:mime-version; bh=4IrWX6mmJ7b0mwXpxOSU05DSHjWhwtw3uJnCs1X0/To=; b=EkQQ9EqbyJyznQ4oQenp8m2P9taxY4O2rGl5GEMsW2xtJEX+7N9q1k4l8Zk7Njv1UP 0kNv/a+lTB1zbBlKMxB9qRyZm6C492Euh51Xz23uMeTiE3T5nxxts6hWP75Tlenxu2ll K5XBO+EJrnfNzDkgs5dnlGV1Kh9+tRtQC/jUPOGrb/MzlCwv/VnyJ8vkEkSHRuROfJ5h qaMAsWQTHXZuHPLlxm5c1+iDWReatvCzsuPvGCebqwscQmaWRog+zQbrXafJPNOzA9Eb FlAGaOYqQT9RJqHkT90JOaom0rZAg4LP7fnZ2Zr09CHi+M/efJ2nlXSgCGqdN4Axo2k7 xOlQ== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12si2543214eda.406.2019.11.21.08.42.54; Thu, 21 Nov 2019 08:43:20 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726905AbfKUQje (ORCPT + 99 others); Thu, 21 Nov 2019 11:39:34 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:34978 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726293AbfKUQje (ORCPT ); Thu, 21 Nov 2019 11:39:34 -0500 Received: by mail-ot1-f65.google.com with SMTP id 23so1715747otf.2; Thu, 21 Nov 2019 08:39:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4IrWX6mmJ7b0mwXpxOSU05DSHjWhwtw3uJnCs1X0/To=; b=uORh8vgE7pSPRWkrAVlqDgJE7rMnWh5fze8TQgNclvMHwRJr+mgkUgIAwWtvufsYsk w04/NVlJbGcwDVIg3fqMVTTm8W1y3Ji54GQ1sgpx1fLkthoWcqPOOua4whGlFXF5ps9D v2pk7cUnd6cKCeUUJP3MUnRARSva+xGMHaMr+gWMDbJiirCFeY3VFtxx1dhTUxLDyzJV 2GwjHxsynEUTAXcpd4V0oxY2sKwBar7/hD+Cmif8P+3vp1h3blPGHAMS3LYTZIHzX3U6 qQ5jYSniKIsjH7wPsxNgh/2VPH+ugB05XFbsMyBCUOtYldq/X386S+wTanBrTL6Fd7CD fdxw== X-Gm-Message-State: APjAAAW8GvZsHkNf4YMaqmpqmYLLOWZcjXt7PbUyn3E7nFy4Og0z/iWL K9IFzDfEmYsvzAggMZYb58yjbUBJYm/PDHwIrKM= X-Received: by 2002:a9d:7d01:: with SMTP id v1mr6911159otn.167.1574354372881; Thu, 21 Nov 2019 08:39:32 -0800 (PST) MIME-Version: 1.0 References: <20191120120913.GE11621@lahna.fi.intel.com> <20191120151542.GH11621@lahna.fi.intel.com> <20191120155301.GL11621@lahna.fi.intel.com> <20191121112821.GU11621@lahna.fi.intel.com> <20191121114610.GW11621@lahna.fi.intel.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Thu, 21 Nov 2019 17:39:21 +0100 Message-ID: Subject: Re: [PATCH v4] pci: prevent putting nvidia GPUs into lower device states on certain intel bridges To: Karol Herbst Cc: "Rafael J. Wysocki" , Mika Westerberg , Bjorn Helgaas , LKML , Lyude Paul , "Rafael J . Wysocki" , Linux PCI , Linux PM , dri-devel , nouveau , Dave Airlie , Mario Limonciello 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, Nov 21, 2019 at 5:06 PM Karol Herbst wrote: > > On Thu, Nov 21, 2019 at 4:47 PM Rafael J. Wysocki wrote: > > > > On Thu, Nov 21, 2019 at 1:53 PM Karol Herbst wrote: > > > > > > On Thu, Nov 21, 2019 at 12:46 PM Mika Westerberg > > > wrote: > > > > > > > > On Thu, Nov 21, 2019 at 12:34:22PM +0100, Rafael J. Wysocki wrote: > > > > > On Thu, Nov 21, 2019 at 12:28 PM Mika Westerberg > > > > > wrote: > > > > > > > > > > > > On Wed, Nov 20, 2019 at 11:29:33PM +0100, Rafael J. Wysocki wrote: > > > > > > > > last week or so I found systems where the GPU was under the "PCI > > > > > > > > Express Root Port" (name from lspci) and on those systems all of that > > > > > > > > seems to work. So I am wondering if it's indeed just the 0x1901 one, > > > > > > > > which also explains Mikas case that Thunderbolt stuff works as devices > > > > > > > > never get populated under this particular bridge controller, but under > > > > > > > > those "Root Port"s > > > > > > > > > > > > > > It always is a PCIe port, but its location within the SoC may matter. > > > > > > > > > > > > Exactly. Intel hardware has PCIe ports on CPU side (these are called > > > > > > PEG, PCI Express Graphics, ports), and the PCH side. I think the IP is > > > > > > still the same. > > > > > > > > > > > > yeah, I meant the bridge controller with the ID 0x1901 is on the CPU > > > side. And if the Nvidia GPU is on a port on the PCH side it all seems > > > to work just fine. > > > > But that may involve different AML too, may it not? > > > > > > > > > Also some custom AML-based power management is involved and that may > > > > > > > be making specific assumptions on the configuration of the SoC and the > > > > > > > GPU at the time of its invocation which unfortunately are not known to > > > > > > > us. > > > > > > > > > > > > > > However, it looks like the AML invoked to power down the GPU from > > > > > > > acpi_pci_set_power_state() gets confused if it is not in PCI D0 at > > > > > > > that point, so it looks like that AML tries to access device memory on > > > > > > > the GPU (beyond the PCI config space) or similar which is not > > > > > > > accessible in PCI power states below D0. > > > > > > > > > > > > Or the PCI config space of the GPU when the parent root port is in D3hot > > > > > > (as it is the case here). Also then the GPU config space is not > > > > > > accessible. > > > > > > > > > > Why would the parent port be in D3hot at that point? Wouldn't that be > > > > > a suspend ordering violation? > > > > > > > > No. We put the GPU into D3hot first, then the root port and then turn > > > > off the power resource (which is attached to the root port) resulting > > > > the topology entering D3cold. > > > > > > > > > > If the kernel does a D0 -> D3hot -> D0 cycle this works as well, but > > > the power savings are way lower, so I kind of prefer skipping D3hot > > > instead of D3cold. Skipping D3hot doesn't seem to make any difference > > > in power savings in my testing. > > > > OK > > > > What exactly did you do to skip D3cold in your testing? > > > > For that I poked into the PCI registers directly and skipped doing the > ACPI calls and simply checked for the idle power consumption on my > laptop. That doesn't involve the PCIe port PM, however. > But I guess I should retest with calling pci_d3cold_disable > from nouveau instead? Or is there a different preferable way of > testing this? There is a sysfs attribute called "d3cold_allowed" which can be used for "blocking" D3cold, so can you please retest using that?