Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3422977ybc; Thu, 21 Nov 2019 08:08:30 -0800 (PST) X-Google-Smtp-Source: APXvYqxh7wmisSOyJh0eaT63lgwlZWkiMcqqAemXzG2VYFVX1CqQrS9nZEX/wVz35bb5e7EMDaxi X-Received: by 2002:a17:906:5f81:: with SMTP id a1mr14640716eju.54.1574352510353; Thu, 21 Nov 2019 08:08:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574352510; cv=none; d=google.com; s=arc-20160816; b=LZBm0iLAG/3Ae0hB6FZMVB+NP0Hr5gA19GQUlIsGFQ2sd5qC8XPtZWbw6UcjechSZL wap6l9DucWJcYVFJ4zvZbGbsBTKGERlEoZRS91YSj4zUwoQv+AHr4MooWxQ79GUjnK3A GCf0ikQtK6VdEpiwRlD+l4b7/XmjmJIXmXAADdOM7LGHTnJg/dLgC9xuLjnuxNqnfXNz ML493ER6fJbi8aGPQKQeuEaUfm2C//3n50fH/iTJzjR/vl1N2/0AFdxyqPv+RxQ2WHRW +AibXTTtQG517orzPKigAz7SF5fuMX7OoAGCACL2ttCNKuaeq82MaeJMqiuQXZ2RbDmk nI8g== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=2bUmJw5NVvVVplfFLTrj0DWj0K1ssd2HaG6I0BvVfDc=; b=leaCg9uOzKDzRHrrBiYwCArBVlgXCJ48teI8nWTcYbHaQyr23PCEjrZwOF28Bq2irW Ytr5dHx7BEOPFcT92Ub8XsqW6dS2TZ5kWygFjn3TARmtJrU2VazYECRXbdBaLOh5AWgL DPkHYNTPwPND5/NT1RZzvAhXLZKiod66O4/2Cz+V+sQRYLN3YhRcUs7SfNCZg7C9+uTL XCGRgJr51V/iwJgKa8s6KFwRF+vblCmDBUWJ4NFq8KLFgylEHQ8zjU4uEiEgsKsJPgwU dLitUbjfkUMpVc4I1sqaS1oJvdMZwoZERvgLe3jde2hQPGiHYb6C/nH/l05c4X2L2oIY Iaqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VZ1qDEao; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l13si2071955eja.13.2019.11.21.08.08.05; Thu, 21 Nov 2019 08:08:30 -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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VZ1qDEao; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726690AbfKUQG0 (ORCPT + 99 others); Thu, 21 Nov 2019 11:06:26 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:53809 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726541AbfKUQG0 (ORCPT ); Thu, 21 Nov 2019 11:06:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574352384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2bUmJw5NVvVVplfFLTrj0DWj0K1ssd2HaG6I0BvVfDc=; b=VZ1qDEaodViSDGiu4IZVwLGVcllu2AfAZB+V93m01oQXuRKKKIf2VDrTdABtnRkWNqFO2B D8xfusEjXTUE5auPvNxoZlwXR7N+LwtnYivg3K/SkoeYmrjRwv8ZNB+FqyjkawrHliZiu6 q4RgSxsRs4U9LXzkPoYo79eZP6/utUc= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-304-ALnY89q1P2yoRVFqlkTrbg-1; Thu, 21 Nov 2019 11:06:23 -0500 Received: by mail-qt1-f198.google.com with SMTP id v92so2557796qtd.18 for ; Thu, 21 Nov 2019 08:06:23 -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=4u5SaUcnCKvjh6UsP+VC2r3Fd3UTQ4sI8vEm9p9IspQ=; b=PQHEAlOiZcELUCpNACov6bpr0NEc+uMIZEqiFgSqOultVB0fSz7uylsBodf+v7AA+J Zgnzu7ZdlIb232m9ij6L11mirVzPr+25TcgjynXc0hpcUF7NjuAlKwQQzB8algImZxBP uEqlK8gEr03LQGANWpq2F0JHkABNMCuBqhcD5po2tKQBbT3g7od8afIr/Rj7ZYoO993/ L5daACdhETk+XUlT4WEwtK+m0qVapei4Ud2YBv61rZXX8GeJHQEhRYH/fxIiffydOvca DPgTT3RHNu1wWDw+PhBKRCB9CsIsAdZhl8vJ09mHLsUq4OQILvY9XPUe93UsRo/RD/AC O7wg== X-Gm-Message-State: APjAAAXN7gRXbDhREYXNZK8am9yROY//RMqPnI6S7uS7xL2K7xAt0Oal j/WuiiX/HaCAFbuJXW1aZ7bMHI78ySH2peKBiYQCPqZIIr6cq8JAgDN+10wGZpJp4/r0IH5C4gB Xv3XmMk2fh6aQ3WUSpgmVy3RHq2M+kko3QOODQJWw X-Received: by 2002:ac8:73c6:: with SMTP id v6mr9366599qtp.137.1574352381603; Thu, 21 Nov 2019 08:06:21 -0800 (PST) X-Received: by 2002:ac8:73c6:: with SMTP id v6mr9366479qtp.137.1574352380570; Thu, 21 Nov 2019 08:06:20 -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: Karol Herbst Date: Thu, 21 Nov 2019 17:06:09 +0100 Message-ID: Subject: Re: [PATCH v4] pci: prevent putting nvidia GPUs into lower device states on certain intel bridges To: "Rafael J. Wysocki" Cc: Mika Westerberg , Bjorn Helgaas , LKML , Lyude Paul , "Rafael J . Wysocki" , Linux PCI , Linux PM , dri-devel , nouveau , Dave Airlie , Mario Limonciello X-MC-Unique: ALnY89q1P2yoRVFqlkTrbg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 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 0x19= 01 one, > > > > > > > which also explains Mikas case that Thunderbolt stuff works a= s 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 m= atter. > > > > > > > > > > Exactly. Intel hardware has PCIe ports on CPU side (these are cal= led > > > > > 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 tha= t may > > > > > > be making specific assumptions on the configuration of the SoC = and the > > > > > > GPU at the time of its invocation which unfortunately are not k= nown to > > > > > > us. > > > > > > > > > > > > However, it looks like the AML invoked to power down the GPU fr= om > > > > > > 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 me= mory 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 i= n 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. But I guess I should retest with calling pci_d3cold_disable from nouveau instead? Or is there a different preferable way of testing this?