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: 118814 Delivered-To: patches@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1944147qgn; Mon, 13 Nov 2017 07:46:54 -0800 (PST) X-Received: by 10.25.149.202 with SMTP id x193mr747516lfd.243.1510588014732; Mon, 13 Nov 2017 07:46:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510588014; cv=none; d=google.com; s=arc-20160816; b=0T9ZSp6d36A+AjQC8NYkgUEW6VXy2cSwwN9HeqFRe9UtUPE5ohEZ/Nu7dtmDDm9OK0 /LuGGAKSdBtVrACUgHoxTEvAtgIBptHjomfnaFii3mDZ0cUrFBrnXwMwU9ol/XxhwQoo XFyGbFIh88gogXiprDItC7u8Rq1VMur83sykzIEzbYPtd0Kk/rlMIiESFVv7V8XnRv0b TFjGWaw1S26Cu+81KZ/hGqqrMKnVFERCoCyX5F2RzVHxkJ1wS7mJZn3SNPrekvq+k+fL 3B8OTJin15tgJJIZI6kME0l2S9fSHnYSaHzW9wKbN5TiWC6G16FaMjtBy49TC+WqNQVM 1bSg== 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=dzsk+uAGHBDIgFyq2Vp1dWycPTetmRMTEjZ2ER9jzqU=; b=NqxVy9u3gwfIH3cFJ/wK/dbOiCYyub+r8ZVU0mM6wj/oTV7SM+1u5WWLPSOqo6w1EC wr1vC93hceE9lUWj/yV9u/hU6EBLCN3nR0fyHvKBYNHfswBV+vO4ohUNGRu0Y+481J1d NWpXrJAZyq4sTX453Uq+fdX6hYSIqopKBPKP1Mi4vOnHVGhDHUhM3HlHsg/HLemh9QCc 0hqvg5/oqipxluz6/7FESsmLLxzjkLR8XoLWcKncorCvjnrgyADv0seHDq9ht7njB45d w7TaDK8sKeiLdbINTMnsNBNNF5/iuyg2fyetjZLLyzo52RWAZA5HSBiAENkwhtYIXCDW eHuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Cu6a7lsX; 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 f27sor639779lfi.112.2017.11.13.07.46.54 for (Google Transport Security); Mon, 13 Nov 2017 07:46:54 -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=Cu6a7lsX; 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=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=ro6pXi1oyebAidTvv7nt3GZj4KikNazHMEcS8Mbw93nwU8z6FXtRLNRZuB8YCs+jnO bajn4ewkXYS4uuZ8QdDTbfh6SyMhIvvTDPSTmnU8fiRq6NIr4Oa6eODoypjCI4An8GFR VHK7sbhlmlEHN8GBlGlB3kDdsBkgEXww1txzUKzsEXrF8U/zsvmj1E0IQoyQls56oOfx ngI6LcDycMqeZyU+NHo3FoRXijeXiiwcFM++EVGnw/U2uK+vOJpzoIoScQABUUm2aHa8 m2imNvUiKAWHaeg+f17hMlBsb4RDL8WmFeCghrECtwvvd1v8uDgt6DeUFZyBuMUEKHJk nUIw== X-Gm-Message-State: AJaThX4YWLG8Kbxi0aGMNKpd05lwtxFrdc/fYatg45bfRST9WYkTKMnr vFNIriqgOVaMdKN/TTYkuENjc8Pd 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) 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 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> 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(-) -- 2.7.4 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);