From: "Rafael J. Wysocki" Subject: Re: [PATCH v3 1/2] PCI / PM: Add needs_resume flag to avoid suspend complete optimization Date: Tue, 02 May 2017 22:57:16 +0200 Message-ID: <6276442.dSpUQGW708@aspire.rjw.lan> References: <1493388963-5278-1-git-send-email-imre.deak@intel.com> <1719094.muzv4MLyNX@aspire.rjw.lan> <20170502090538.GA21917@ideak-desk.fi.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: In-Reply-To: <20170502090538.GA21917@ideak-desk.fi.intel.com> Sender: linux-pci-owner@vger.kernel.org To: imre.deak@intel.com Cc: Bjorn Helgaas , intel-gfx@lists.freedesktop.org, Jani Nikula , "Rafael J. Wysocki" , linux-pci@vger.kernel.org, stable@vger.kernel.org List-Id: intel-gfx@lists.freedesktop.org On Tuesday, May 02, 2017 12:05:38 PM Imre Deak wrote: > On Mon, May 01, 2017 at 10:36:13PM +0200, Rafael J. Wysocki wrote: > > On Sunday, April 30, 2017 03:57:13 PM Imre Deak wrote: > > > On Sat, Apr 29, 2017 at 12:21:57PM +0200, Rafael J. Wysocki wrote: > > > > On Friday, April 28, 2017 11:33:02 PM Rafael J. Wysocki wrote: > > > > > On Friday, April 28, 2017 05:16:02 PM Imre Deak wrote: > > > > > > Some drivers - like i915 - may not support the system suspend direct > > > > > > complete optimization due to differences in their runtime and system > > > > > > suspend sequence. Add a flag that when set resumes the device before > > > > > > calling the driver's system suspend handlers which effectively disables > > > > > > the optimization. > > > > > > > > > > > > Needed by the next patch fixing suspend/resume on i915. > > > > > > > > > > > > Suggested by Rafael. > > > > > > > > > > > > Cc: Rafael J. Wysocki > > > > > > Cc: Bjorn Helgaas > > > > > > Cc: linux-pci@vger.kernel.org > > > > > > Cc: stable@vger.kernel.org > > > > > > Signed-off-by: Imre Deak > > > > > > > > > > Acked-by: Rafael J. Wysocki > > > > > > > > > > The reason why the opt-out flag was not added on day one was because we were > > > > > not sure whether or not it would be necessary at all. > > > > > > > > > > Quite evidently, it is needed. > > > > > > > > But that said, it actually can be implemented as a flag in dev_flags too, say > > > > PCI_DEV_FLAGS_NEEDS_RESUME, in analogy with PCI_DEV_FLAGS_NO_D3 that's > > > > already there. > > > > > > > > The struct size would not need to grow then which I guess would be better? > > > > > > Hm, both the bit field and the flag would need to increase if running > > > out of bits, so what's the difference? (Atm, the struct size wouldn't > > > change either way.) > > > > In the bit field case this depends on what the compiler thinks is better to be > > entirely precise, so they are not 100% equivalent. > > > > Plus, since there already are things related to PM in dev_flags, why to depart > > from that pattern? > > There are a few PM related flags in the bit field too. > > The need for moving it is still not clear to me, but I don't see any > problem with it either, so will move it there. Well, we are not too consistent in that respect overall. Either way works, so I guess it's Bjorn's call at this point. :-) Thanks, Rafael