From patchwork Wed Mar 25 15:27:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 6093301 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 8E8DCBF90F for ; Wed, 25 Mar 2015 15:28:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A8AC120381 for ; Wed, 25 Mar 2015 15:28:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F3D520379 for ; Wed, 25 Mar 2015 15:28:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753520AbbCYP2Y (ORCPT ); Wed, 25 Mar 2015 11:28:24 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:37695 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752530AbbCYP2Y (ORCPT ); Wed, 25 Mar 2015 11:28:24 -0400 Received: by wixw10 with SMTP id w10so43820967wix.0; Wed, 25 Mar 2015 08:28:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=Hm7jg60cf4MZKsF5qB1Wa9ncpLzEZ++8DnpXFokSbyo=; b=ELOa1UuKanYb/v4HjN3BBpCgQS7CLdk32m7ztV0loWkfzXSaY+uWd/KdmqMeTKrFMT b3BCl9+vVywJWFXZSDPMI6QjtLpEih0uKVlybw9GIJWPsu6W/GKepUYnP3PWxkWu46Pb QPLPIJhfhXCI1P+8JRtW4EUCyWYlkiVQapA4mf4rlxEF4Z4oPbEjMypM/1O18dTCF6ni BDK4kvID3lQ9AEJiyvA7xX2jIGGPOVKDdB+WaXimEfKbzjVAAdcOjOAJF4AtxAREIude 86HIvq50NIhi3UWuPRNt7unVcyMNhEkz5clG+AjMXrBJlHv2MLb690xOz4tymvMyNVMj wk8g== X-Received: by 10.180.8.98 with SMTP id q2mr37889665wia.80.1427297302501; Wed, 25 Mar 2015 08:28:22 -0700 (PDT) Received: from cizrna.lan ([109.72.12.28]) by mx.google.com with ESMTPSA id k6sm21130415wia.6.2015.03.25.08.28.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Mar 2015 08:28:21 -0700 (PDT) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Cc: Tomeu Vizoso , "Rafael J. Wysocki" , Pavel Machek , Len Brown , Greg Kroah-Hartman , linux-pm@vger.kernel.org Subject: [PATCH] PM / sleep: Don't unset parent's direct_complete Date: Wed, 25 Mar 2015 16:27:55 +0100 Message-Id: <1427297276-6370-1-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.1.0 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,T_DKIM_INVALID,T_RP_MATCHES_RCVD,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 If a device isn't going to be fully-suspended because there isn't an implementation of the suspend callback, there's no need to make sure that its parent is going to be fully-suspended as well. Without this change, USB interface devices will always prevent the proper USB device to stay in runtime suspension when the system suspends. Signed-off-by: Tomeu Vizoso --- Hi, I'm not sure if this is the right fix, because I don't see why the USB interface devices are in the dpm_list in the first place, so any comments will be welcome. Thanks, Tomeu --- drivers/base/power/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 3d874ec..6bac53f 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -1438,7 +1438,9 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async) if (parent) { spin_lock_irq(&parent->power.lock); - dev->parent->power.direct_complete = false; + if (callback) + parent->power.direct_complete = false; + if (dev->power.wakeup_path && !dev->parent->power.ignore_children) dev->parent->power.wakeup_path = true;