From patchwork Mon Nov 13 15:46:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 10056325 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5CF6D60365 for ; Mon, 13 Nov 2017 15:46:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EA8129419 for ; Mon, 13 Nov 2017 15:46:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 43BED29450; Mon, 13 Nov 2017 15:46:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM, TVD_PH_BODY_ACCOUNTS_PRE autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 769F029419 for ; Mon, 13 Nov 2017 15:46:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753390AbdKMPq5 (ORCPT ); Mon, 13 Nov 2017 10:46:57 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:53751 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753296AbdKMPqz (ORCPT ); Mon, 13 Nov 2017 10:46:55 -0500 Received: by mail-lf0-f66.google.com with SMTP id 73so4532730lfu.10 for ; Mon, 13 Nov 2017 07:46:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dzsk+uAGHBDIgFyq2Vp1dWycPTetmRMTEjZ2ER9jzqU=; b=Cu6a7lsXfmV1r2CrbaUWvU9s7PDJaiR29lMFVG/pIw+Uj5srhP54D/MU2dU1BsY3pm ru8QoLRT2Wijmdh4SCYWOEJURv3sR1gg0tK6evweH7qQ9ViXeeKvYBnrK53Wberkyqa/ fn4qpOCyzKHfmdHdKLl/WrWwkhs5yzNg+R8i4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dzsk+uAGHBDIgFyq2Vp1dWycPTetmRMTEjZ2ER9jzqU=; b=OaiG9hGiRpK8zSGKHnpddaKBi+WMyif+ImISKXxEXTDxNWFO1ziVj1PIKRMS0sOJ4F +9nYN8bYCjc041EcoJ1G+kVLNa0ms4T0MFxhVSFn4kzLd1LY4doDvhXGe19xq+w5gjTu jxkNJ7KzKa7uqVmNle1m2Oe8bJTjgWvRXytcUqW8/n8YNHDb7CRHB5wzLsyCi4zgifHT rmDPZKoswgUFhDN8QWjIscR+D2yliP85SUx7HtHuWoT0KxtgM/E7CfmTxkMMuzuyZ0ar R+jhvUFk4iU0fVolIsTjySfhcNZMLZBmM9VUCskDSVuf22Fy7C6Ets9iEuR1Rj0vJ1c4 hIzw== X-Gm-Message-State: AJaThX6cGrHXF4Jy0KNW9JSMyUacSJwDyxIzLHbuUcFqnvnvvCF8gXy/ z724TFOB9I7bXAotj6jLJKaLLQ7MaWE= X-Google-Smtp-Source: AGs4zMa6iv2/r1pWqCGu8lT2qIgZoMwX3iMruCGsqVnQA3QP0SUFcHsmWfzfCtvbL54nR3vk8Gno0A== X-Received: by 10.25.17.170 with SMTP id 42mr2011724lfr.184.1510588014257; Mon, 13 Nov 2017 07:46:54 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-67.NA.cust.bahnhof.se. [158.174.22.67]) by smtp.gmail.com with ESMTPSA id m26sm177841ljb.61.2017.11.13.07.46.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Nov 2017 07:46:53 -0800 (PST) From: Ulf Hansson To: "Rafael J . Wysocki" , linux-pm@vger.kernel.org Cc: Kevin Hilman , Viresh Kumar , Geert Uytterhoeven , Simon Horman , Niklas Soderlund , linux-renesas-soc@vger.kernel.org, Ulf Hansson Subject: [PATCH v2 3/3] PM / Domains: Take wakeup_path_in_band status flag into account Date: Mon, 13 Nov 2017 16:46:43 +0100 Message-Id: <1510588003-16650-4-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510588003-16650-1-git-send-email-ulf.hansson@linaro.org> References: <1510588003-16650-1-git-send-email-ulf.hansson@linaro.org> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make genpd to take the wakeup_path_in_band status flag into account during system suspend/resume. More precisely, in case the flag has been set by the PM core, let's leave the device in full power state and prevent the PM domain from being powered off. Signed-off-by: Ulf Hansson Reviewed-by: Geert Uytterhoeven --- Changes in v2: - Added Geert's Reviewed-by tag. - Changed to look at status flag instead of driver flag. --- drivers/base/power/domain.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 24e39ce..21cbea0 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1037,7 +1037,8 @@ static int genpd_finish_suspend(struct device *dev, bool poweroff) if (IS_ERR(genpd)) return -EINVAL; - if (dev->power.wakeup_path && genpd_is_active_wakeup(genpd)) + if (dev->power.wakeup_path && + (dev->power.wakeup_path_in_band || genpd_is_active_wakeup(genpd))) return 0; if (poweroff) @@ -1092,7 +1093,8 @@ static int genpd_resume_noirq(struct device *dev) if (IS_ERR(genpd)) return -EINVAL; - if (dev->power.wakeup_path && genpd_is_active_wakeup(genpd)) + if (dev->power.wakeup_path && + (dev->power.wakeup_path_in_band || genpd_is_active_wakeup(genpd))) return 0; genpd_lock(genpd);