From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754883AbdJPWVD (ORCPT ); Mon, 16 Oct 2017 18:21:03 -0400 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:49905 "EHLO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753289AbdJPWVA (ORCPT ); Mon, 16 Oct 2017 18:21:00 -0400 From: "Rafael J. Wysocki" To: Alan Stern Cc: Linux PM , Bjorn Helgaas , Greg Kroah-Hartman , LKML , Linux ACPI , Linux PCI , Linux Documentation , Mika Westerberg , Ulf Hansson , Andy Shevchenko , Kevin Hilman , Wolfram Sang , linux-i2c@vger.kernel.org, Lee Jones Subject: Re: [PATCH 01/12] PM / core: Add NEVER_SKIP and SMART_PREPARE driver flags Date: Tue, 17 Oct 2017 00:11:23 +0200 Message-ID: <2240270.3ttWVTLO4t@aspire.rjw.lan> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, October 16, 2017 10:16:15 PM CEST Alan Stern wrote: > On Mon, 16 Oct 2017, Rafael J. Wysocki wrote: > > > From: Rafael J. Wysocki > > > > The motivation for this change is to provide a way to work around > > a problem with the direct-complete mechanism used for avoiding > > system suspend/resume handling for devices in runtime suspend. > > > > The problem is that some middle layer code (the PCI bus type and > > the ACPI PM domain in particular) returns positive values from its > > system suspend ->prepare callbacks regardless of whether the driver's > > ->prepare returns a positive value or 0, which effectively prevents > > drivers from being able to control the direct-complete feature. > > Some drivers need that control, however, and the PCI bus type has > > grown its own flag to deal with this issue, but since it is not > > limited to PCI, it is better to address it by adding driver flags at > > the core level. > > I'm curious: Why does the PCI bus type (and others) do this? Why > doesn't it do what the driver says to do? Well, the idea was that it might work for the existing drivers without the need to modify them (and they would have had to be modified had the driver's ->prepare return value been required to be taken into account). It actually does work for them in general, although with some notable exceptions. Thanks, Rafael