From patchwork Fri Dec 15 15:56:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 10115441 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 6E2CA60231 for ; Fri, 15 Dec 2017 15:56:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C75029E60 for ; Fri, 15 Dec 2017 15:56:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50F4229EBB; Fri, 15 Dec 2017 15:56:52 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI 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 E609629E60 for ; Fri, 15 Dec 2017 15:56:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932393AbdLOP4v (ORCPT ); Fri, 15 Dec 2017 10:56:51 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:41919 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932437AbdLOP4t (ORCPT ); Fri, 15 Dec 2017 10:56:49 -0500 Received: by mail-lf0-f65.google.com with SMTP id f18so10948373lfg.8 for ; Fri, 15 Dec 2017 07:56:48 -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=jCY8bz7/xQ5L0RsBznCtaUtqbUhDUVEVK60+e6PwQos=; b=b1HYL5Akpsckb3u1FEyu3Yw3qc7KA25imC8hSa3TIr3FcHfCtkXJ+L61AFqv3fmdma 5LmNYnYxsJXNai9q/8JRKMsQph0rg0Whr5rZuT9dkBxFRk98GP/UKvQR6iqRDbsxN2vz SjHuHKuaddOrZnCp0M/Mz4z2CFHMr+i97n5dM= 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=jCY8bz7/xQ5L0RsBznCtaUtqbUhDUVEVK60+e6PwQos=; b=F99HRRyMoUxbY2Z3vM2T42pgLRcAjY+ExfJ/IqMyMUIrg7fc1RL3/49Qxm3LGpHi5Y Ee7HlXEVj2w1M16zTThJi/ibTeM+8HZlyOoc8uS5VF8plq9JUP0xydSug69RpHKqutst Kz/mfxGmHCtUEa48+ta0Fwv//Nqv39Gc/cVHgMD50m0dsU/KeVYjzy3g3gdmBvyHt00n fDjGvZHdkFw+oF8yGLTbWST0BCB3G5upxkIBa0/fynx5+gAFvZBhAdG7jeeMiAx6PkYF 5nHLPYjCJJd5dOGXQdHu7cM7nLdAjveNheomeh1a0IrGjd2Cp1txKjYfrE7vaEl19tKc zycw== X-Gm-Message-State: AKGB3mJicl7nHQYptoLQwbRI1l5ycrW0LOcpQr8L5g6+aGgD29ctNLO6 +uIXa10wp2eKG4p2Rl0AkttPmg== X-Google-Smtp-Source: ACJfBotq41Ux29TXSbHVZJhdahqwTdd93aHUYokfEd/c8Jo1S6OtB+HCaqi9H7l/JOMuPiahairImw== X-Received: by 10.46.43.86 with SMTP id q83mr6490412lje.104.1513353407693; Fri, 15 Dec 2017 07:56:47 -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 y15sm1294216lje.10.2017.12.15.07.56.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Dec 2017 07:56:46 -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 , Vincent Guittot , linux-renesas-soc@vger.kernel.org, Ulf Hansson Subject: [PATCH 3/3] PM / Domains: Take WAKEUP_PATH driver flag into account in genpd Date: Fri, 15 Dec 2017 16:56:31 +0100 Message-Id: <1513353391-30806-4-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513353391-30806-1-git-send-email-ulf.hansson@linaro.org> References: <1513353391-30806-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 In case the WAKEUP_PATH flag has been set in a later phase than from the ->suspend() callback, the PM core want set the ->power.wakeup_path status flag for the device. Therefore, let's be safe and check it explicitly. Signed-off-by: Ulf Hansson --- drivers/base/power/domain.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index f9dcc98..32b4ba7 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1038,7 +1038,9 @@ 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_pm_test_driver_flags(dev, DPM_FLAG_WAKEUP_PATH)) && + genpd_is_active_wakeup(genpd)) return 0; if (poweroff) @@ -1093,7 +1095,9 @@ 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_pm_test_driver_flags(dev, DPM_FLAG_WAKEUP_PATH)) && + genpd_is_active_wakeup(genpd)) return 0; genpd_lock(genpd);