Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965324AbcCNObP (ORCPT ); Mon, 14 Mar 2016 10:31:15 -0400 Received: from mga01.intel.com ([192.55.52.88]:33412 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965300AbcCNObI (ORCPT ); Mon, 14 Mar 2016 10:31:08 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,335,1455004800"; d="scan'208";a="909940918" Date: Mon, 14 Mar 2016 16:30:53 +0200 From: Mika Westerberg To: "Rafael J. Wysocki" Cc: Dave Airlie , "Rafael J. Wysocki" , dri-devel , "linux-pm@vger.kernel.org" , ACPI Devel Maling List , Linux PCI , Linux Kernel Mailing List Subject: Re: [PATCH 1/2] vga_switcheroo: add power support for windows 10 machines. Message-ID: <20160314143053.GJ1793@lahna.fi.intel.com> References: <1457504045-12738-1-git-send-email-airlied@gmail.com> <2736217.utxPzJExd5@vostro.rjw.lan> <20160311105815.GS1796@lahna.fi.intel.com> <2759763.dR5D0KopkA@vostro.rjw.lan> <20160314094335.GE1796@lahna.fi.intel.com> <20160314102357.GA1793@lahna.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2273 Lines: 58 On Mon, Mar 14, 2016 at 01:50:41PM +0100, Rafael J. Wysocki wrote: > On Mon, Mar 14, 2016 at 11:23 AM, Mika Westerberg > wrote: > > On Mon, Mar 14, 2016 at 07:47:39PM +1000, Dave Airlie wrote: > >> > > >> >> - if (pcie_port_runtime_suspend_allowed(dev)) > >> >> + if (pcie_port_runtime_suspend_allowed(dev)) { > >> >> + pm_runtime_allow(&dev->dev); > >> > > >> > PCI drivers typically have left this decision up to the userspace. I'm > >> > wondering whether it is good idea to deviate from that here? Of course > >> > this allows immediate power savings but could potentially cause problems > >> > as well. > >> > > >> > >> No distro has ever shipped userspace to do this, I really think this > >> is a bad design. > >> We have wasted countless watts of power on this stupid idea that people will > >> run powertop, only a few people in the world run powertop, lots of > >> people use Linux. > > > > That is a fair point. > > > > I do not have anything against calling pm_runtime_allow() here. In fact > > we already do the same in Intel LPSS drivers. I just wanted to bring > > that up. > > > > Rafael, what do you think? > > We can do that to start with. If there are no problems in the field > with it, I don't see any problems in principle. > > > If we anyway are going to add cut-off date to enable runtime PM we > > should expect that the hardware is also capable of doing so (and if not > > we can always blacklist the exceptions). > > Sounds reasonable. > > >> The kernel should power stuff down not wait for the user to run powertop, > >> At least for the GPU it's in the area of 8W of power, and I've got the > >> GPU drivers doing this themselves, > >> > >> I could have the GPU driver call runtime allow for it's host bridge I suppose, > >> if we insist on the userspace cares, but I'd prefer not doing so. > >> > >> > I think we need to add corresponding call to pm_runtime_forbid() in > >> > pcie_portdrv_remove(). > >> > >> Yes most likely. > > > > BTW, I can add both calls to the next version of PCIe runtime PM patches > > if you are OK with that, and all agree this is a good idea. > > That would be fine by me. OK thanks. I'll do these changes to the next version of the patch series then.