From patchwork Thu Feb 25 00:11:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Basehore X-Patchwork-Id: 8415251 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E57F2C0554 for ; Thu, 25 Feb 2016 00:12:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 273D6202E6 for ; Thu, 25 Feb 2016 00:12:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4E71D202EC for ; Thu, 25 Feb 2016 00:12:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757990AbcBYALi (ORCPT ); Wed, 24 Feb 2016 19:11:38 -0500 Received: from mail-pa0-f49.google.com ([209.85.220.49]:32986 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757538AbcBYALh (ORCPT ); Wed, 24 Feb 2016 19:11:37 -0500 Received: by mail-pa0-f49.google.com with SMTP id fl4so21447151pad.0 for ; Wed, 24 Feb 2016 16:11:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=SBM95ZRbKppbiR9hhAzjQwb0UvRSwSvwCfVa5xuUP3s=; b=AdSMichLddyL8vWgUw31W7cFC73cJRMJ0hBle+bfMbZHRVz+l2QcGdwOOapDeQrmBB O+QoohNeif4b0bPxEAtZ7tCix5TRS8nlDxn3qQ20dLoUy8LAGIYZLEPtOI3OZYHLKI1P +7gnJMtUWjkGKPr2NCqYEoH7jbttLCkAKV1BQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=SBM95ZRbKppbiR9hhAzjQwb0UvRSwSvwCfVa5xuUP3s=; b=O2RB2yS9d+WsUChMJFeD5tOOLVldQ0Yw4o5PjA8+sJpjgQeGxpCG3PALZi0NI7BDIn l39M6T0h38z448w+5OqcdmuRqwqyAwfcJIUdxjspahCL81Idwr23w0xs0ohOCwgK8eEn hdMKopWDG/dRKHuA//bJWS5bNtNwIcgH8yos8YQWuB+Q1m00FchDfVQ4WyaQ0DI+r8b3 rW0rxr5jD3TtAu+g7Qaz6bDNBn/RIGZepqwen+vQAjOaFnxMrAlEZjQhZ/Mq5JdUQpqd g8dzXQZlz68QzI4tNYRTD87X7mprIOdWJsMs3KesAmZMW4cegWZnYNY3196CnWPNmx8p VzQA== X-Gm-Message-State: AG10YORo4Ovxg9+7+D1BPwJPkWx7TFhe7CDC5VmXFGWAu5uNSx2pcDdiX+buNsN7xapu5w== X-Received: by 10.66.255.39 with SMTP id an7mr58780850pad.2.1456359096241; Wed, 24 Feb 2016 16:11:36 -0800 (PST) Received: from ketosis.mtv.corp.google.com ([172.22.65.104]) by smtp.gmail.com with ESMTPSA id y15sm7497671pfi.16.2016.02.24.16.11.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Feb 2016 16:11:35 -0800 (PST) From: Derek Basehore To: linux-pm@vger.kernel.org Cc: "Rafael J . Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org, Derek Basehore Subject: [PATCH v1 1/3] PM / sleep: Check legacy pm callbacks for direct complete Date: Wed, 24 Feb 2016 16:11:27 -0800 Message-Id: <1456359089-19807-1-git-send-email-dbasehore@chromium.org> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds checks for legacy pm callbacks when setting no_pm_callbacks. This fixes an issue where these suspend/resume callbacks were incorrectly ignored during suspend/resume with direct complete. Fixes: 4534d9d881f9 "PM / sleep: Go direct_complete if driver has..." Signed-off-by: Derek Basehore --- drivers/base/power/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 6e7c3cc..e0017d9 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -1764,8 +1764,10 @@ void device_pm_check_callbacks(struct device *dev) { spin_lock_irq(&dev->power.lock); dev->power.no_pm_callbacks = - (!dev->bus || pm_ops_is_empty(dev->bus->pm)) && - (!dev->class || pm_ops_is_empty(dev->class->pm)) && + (!dev->bus || (!dev->bus->resume && !dev->bus->suspend && + pm_ops_is_empty(dev->bus->pm))) && + (!dev->class || (!dev->class->resume && !dev->class->suspend && + pm_ops_is_empty(dev->class->pm))) && (!dev->type || pm_ops_is_empty(dev->type->pm)) && (!dev->pm_domain || pm_ops_is_empty(&dev->pm_domain->ops)) && (!dev->driver || pm_ops_is_empty(dev->driver->pm));