From patchwork Fri Dec 29 11:37:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 122928 Delivered-To: patches@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4574612qgn; Fri, 29 Dec 2017 03:37:21 -0800 (PST) X-Received: by 10.46.66.140 with SMTP id h12mr21737563ljf.140.1514547441812; Fri, 29 Dec 2017 03:37:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514547441; cv=none; d=google.com; s=arc-20160816; b=LVM9xWe3mtqP6GXn7n7f+Baz/aM4euOdxYO9R9XhiCA/rwmHo1BlQIGMPjsqNKyk+j Zh8yNEI9aTmQr6QiUv11JTSE5hMVLIE0W/qkUyUOdej31pdc2Y443Dz9oGYqE/ysgtqL re/iUnF+Xih4DgN5dW3X/G1iOHtES6o8SE8iWw2WFzjTFOCYT5VNZa9HidVGb2qdNrex qUuYsl6rIlHkbIxScMCwuGqzAbjWEbxNUHnaW7YQnTpCbrE5JxoQm1oWwqBA+69vwVn/ +JVMqje83yk0ruBLH/28/dheYeO1OHexwlyKtfoa5SojOlk6qGslXQJOEBGl55bUdSrl 8X5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=rdpOgODAN4wA1DRykNoVcAfIYjCPQk13D5XDO5F/Qcs=; b=tv04i0APMHaTkGbqpnSlcTZVCjDkjU70F3XbGX33sXWyIXsY532o0/ZAXstrQHpMJe ZBo1Imo6Qo+VvAWL5ufhJsptuxMIrfghdf5ap00cXn9X0avb4weIAO/hipVaMA6xpD6a +dwygL1rOeSHOf/HcME4Uoz87sqCQUw4uCunwoKL65jEDuzUgyTIOB0KuS4Jc4SqOZXU 7KI8Nms8EOaLbdvac0jeOCxjeuYD0xWb/GHIMbznMe5Zc3YX6JGElW8HvPzGKQN2iT4H JFqiTT8zvSfAFm9a91nj2oCbj/3wwyM+BLn1aEN/d/2piw8lmAVfi9q0Oh0sll/U9fXS Xo0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GjjonOkh; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id i62sor4261901lfk.93.2017.12.29.03.37.21 for (Google Transport Security); Fri, 29 Dec 2017 03:37:21 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GjjonOkh; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=rdpOgODAN4wA1DRykNoVcAfIYjCPQk13D5XDO5F/Qcs=; b=GjjonOkhCzeFqCaq3Hr0pnoyVJbtknwQFhuNTFXHuaRdrOmqbV5dgAkLfvKE4DlrsW gd67bAM6udGD3wMD45xt92Y/vn1StjWPsP1mYwOPNHBgLKbxXqaVIgKP73Wy1VWl+0ff om3E3zaztKDIZqLLDQbOrMO2TWZQfG+/QzDHw= 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=rdpOgODAN4wA1DRykNoVcAfIYjCPQk13D5XDO5F/Qcs=; b=GwECNjoqri5Lhg6d9nGFJ5tye6dgg7ji3EjxvU5As37tkqnuPwYaZdgPhUNI1/smO6 cBG8+8PWQV3X8L5rudcqShaCu9DYAx55RceMgzQ0FNcU+wzMLlo2yqwpGThKiTwdJomQ y85xvwZEoCaXTR4qGTKMd1507DO0UoZs/0Fjci4KHn0JUb0594s4gW0VMAEUpRAMl8BE zb+0Qq/A905kxinFjqWXetr783XFN6nd/CfoYfoUpydjqD5aKesaKtGPlg6rj/d1NqD+ ddUXWyDHtkB5kg3Fk53xHRG18bSKtYAHWfhx36A7IgDB7gRNzlqRSVDbQBpdEq91Adzi JvQw== X-Gm-Message-State: AKGB3mLNJxkruSrSw7ehfnom9YS9CwxarMi3eqbTkrLzjHp1mLAh4wuG fYCj2+teWLsPHJhtfCIGTBoZMY6q X-Google-Smtp-Source: ACJfBoucv+YqSnRWvDymTGhy0JBn+jblyL5WEECEXULta+vq2/wO9Js4RHx0SgGIvbKef7as/yFSww== X-Received: by 10.25.21.101 with SMTP id l98mr20294871lfi.134.1514547441464; Fri, 29 Dec 2017 03:37:21 -0800 (PST) Return-Path: Received: from localhost.localdomain (h-158-174-22-67.NA.cust.bahnhof.se. [158.174.22.67]) by smtp.gmail.com with ESMTPSA id r74sm7280469ljb.28.2017.12.29.03.37.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Dec 2017 03:37:20 -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 v2 3/4] PM / Domains: Take WAKEUP_PATH driver flag into account in genpd Date: Fri, 29 Dec 2017 12:37:02 +0100 Message-Id: <1514547423-18965-4-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514547423-18965-1-git-send-email-ulf.hansson@linaro.org> References: <1514547423-18965-1-git-send-email-ulf.hansson@linaro.org> In case the WAKEUP_PATH flag has been set in a later phase than from the ->suspend() callback, the PM core don't 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(-) -- 2.7.4 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);