From patchwork Fri Dec 15 15:56:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 122115 Delivered-To: patches@linaro.org Received: by 10.140.22.227 with SMTP id 90csp648069qgn; Fri, 15 Dec 2017 07:56:45 -0800 (PST) X-Received: by 10.25.78.214 with SMTP id u83mr5700232lfk.74.1513353405260; Fri, 15 Dec 2017 07:56:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513353405; cv=none; d=google.com; s=arc-20160816; b=NDcfAISJt5stMxvlOetRm55wEJ90xhRKxE1fZ1W5dGbCbrWF819wWkzZJkFu4Ntzet tZrDe57INJf6pV+Alq8z0PyBmMy7gwaTTU/qV3l+lJoo9eO1EA94eB+oIccZ4RAQtdR3 oaISuZjWCpUuyB9czhc0CnjSV4ooCKXKSvXohzQl8h541fjaLQU/YEqTbtaprqgcoCA9 hVuePCwMizUfCYcVB52b/oDHCx240f5Bl6lc6RJjZ0ftLlAOcGkNu9plCGdM919fOgs5 3jFBNgDPtv0pJ/Ww6ZNcOJqRxni5NdSoOPSLuOJbfqPpr7o24tDDENJmBG/n4tcndN6Y c9qg== 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=Zc71+Bu5PUWIa8bITeKtvmFDBRUtUqPswjTAf1jpAL0=; b=cQ8nQ15+uOcFFsFQJvWuUuflNdlFZJQQkTmsDzMnwBtTQr8d5sCVcW/1hVpYDmZ9NH 8o0CKqPvEC+Qzet9yFGzNz7GhR9FBFWZdNp5rYlTuzR1IHDeJ+KsMdGNfqhmhhYCO+QR eqAOM2ebGtFOcJjaLVGvcsA2ludCsM7iafTuXi+ahdeUcK+NVwW7lpLLh3LEfRZ5POP6 yFW93SiZwhiKrNpca7viZ0cCPawqpm3AJ/uGp28FwXUs9juE9h/RsHnIcMIzaXHBgY16 +vQMlModnbJHqhfdrNHCDGbst4NzOXZ3lGgVe4HKepMZ+5UOZCTu23ArwY2lSMCmqVsL VB/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LP/ZXvOe; 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 b195sor1257518lfe.63.2017.12.15.07.56.45 for (Google Transport Security); Fri, 15 Dec 2017 07:56:45 -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=LP/ZXvOe; 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=Zc71+Bu5PUWIa8bITeKtvmFDBRUtUqPswjTAf1jpAL0=; b=LP/ZXvOeENL3omL2X3P1ybCk8yhhMWM4WWkR9ntv6d/MA9+RycdP2J7/6VbOPIOg2g /qC0RrRxZMU4RLts4UOieopPeLmuYdr9vnz4p2rpWElEEZ/xEL0y2ZlZf76NGAjH+bm6 vKNaNa2UO5IJ5hpvB+9pituBPmN4adirF2Pro= 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=Zc71+Bu5PUWIa8bITeKtvmFDBRUtUqPswjTAf1jpAL0=; b=mBNn0nrhg9meULvmAqjoeeqR9tA2jFruseGAnKqZNWIBp7ruBOfLVz3bUt7sbU/q9s 8zfOjzP32ybRZuF2TGVfPJDDJnyBglMNNibai31U/IUfUsKanbAfTyz06NBowsUalUA+ ESrD719CQz196001AVBU0dmc+vtMKWqr/yz+CDDRCsLlbrmYdjXAq90ZAKUSOXlV7wkH Gjl2HvLjWUa9dCkSPt5Pc0WzkmrQBnCk4lrjcrNZMdK+08qdvN9qYuNmzDrUYIJDEpho GiMJMvkj6grUSGEg28wH49L8Si7gXNdJYMe1EGwgQHOOmKaY8nWMaWR4eid2udNinC++ AiBA== X-Gm-Message-State: AKGB3mJdcybaAOKCsF8iM5kk9W3LWMuF1sod/LRffGNprSD12t1zKv0h 0wstTbLZlQ73lxhU5n68iwu/B7x4 X-Google-Smtp-Source: ACJfBotgZYBQ35xJIBJfYHHUr6hieJKnNqkDh/aOolFa9kS+KxAtIPnsqsgF4729QYPZXdh0E7sSfg== X-Received: by 10.25.143.77 with SMTP id r74mr6634902lfd.86.1513353404776; Fri, 15 Dec 2017 07:56:44 -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 y15sm1294216lje.10.2017.12.15.07.56.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Dec 2017 07:56:44 -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 1/3] PM / core: Assign the wakeup_path status flag in __device_prepare() Date: Fri, 15 Dec 2017 16:56:29 +0100 Message-Id: <1513353391-30806-2-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> The PM core in the device_prepare() phase, resets the wakeup_path status flag to the value of device_may_wakeup(). This means if a ->prepare() or a ->suspend() callback for the device would update the device's wakeup setting, this doesn't become reflected in the wakeup_path status flag. In general this isn't a problem, because wakeup settings isn't supposed to be changed during those system suspend phases. Nevertheless, there are a cases not conforming to that behaviour, as device_set_wakeup_enable() is indeed called from ->suspend() callbacks. To address this, let's move the assignment of the wakeup_path status flag to the __device_suspend() phase and more precisely, after the ->suspend() callback has been invoked. Signed-off-by: Ulf Hansson --- drivers/base/power/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 6e8cc5d..810e5fb 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -1620,6 +1620,8 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async) End: if (!error) { dev->power.is_suspended = true; + if (device_may_wakeup(dev)) + dev->power.wakeup_path = true; dpm_propagate_to_parent(dev); dpm_clear_suppliers_direct_complete(dev); } @@ -1744,7 +1746,7 @@ static int device_prepare(struct device *dev, pm_message_t state) device_lock(dev); - dev->power.wakeup_path = device_may_wakeup(dev); + dev->power.wakeup_path = false; if (dev->power.no_pm_callbacks) { ret = 1; /* Let device go direct_complete */ From patchwork Fri Dec 15 15:56:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 122116 Delivered-To: patches@linaro.org Received: by 10.140.22.227 with SMTP id 90csp648103qgn; Fri, 15 Dec 2017 07:56:46 -0800 (PST) X-Received: by 10.25.154.205 with SMTP id c196mr6351907lfe.116.1513353406747; Fri, 15 Dec 2017 07:56:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513353406; cv=none; d=google.com; s=arc-20160816; b=KkSGo8RfqeR5RgzuV0YwhoFmdBqpB6npkIivGKNEc1zcTHtCMXWiB96Hz1LMgQN+ou fkS/o0r9tcaqS7Rd2LHyQjox8miZGfI08Nd1say8HMt0/3nYLjKv09D+AAnCs/5t3B6h NBc2rNpsuKaJ/KcAVuCfI6GLhVf7f6MkfcZITJ+1FcJHcEvT3Ltm9EwMp9tZH2sKAw9p ob3HTRJoru1nb5TO6XfU82HAdU/TkJ5BSoKLS7RXtdfq5tyGMKJgPjNxPTzGm9pd14xa xIbIeck97DHQIxXHtBr+xcxFwLFUYu5O4isEou/Z3Hfi0yHokMCZIZrUvsejMt2Dqtls eV+Q== 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=OXVTbBVyb8As8Yrqn/1KiYPJKsdq9JJvs6Uwj5w0K14=; b=Z2ZLrwdr3SaPohzGsnMjFcjHh36RyHb3BAA2WRx8X/F3Fd+XtEe6zi0WGHpZTHJNQn 3n7Kc/NjO8sHETMVcpcYDOHiEE/56z06SuQ5X/17YhRC1deZmkwPpRrN5Tp/vqE0Hhuf EgbtWLmMoVCuBgT1gBNm434C6Rci6negCFu29fijLlOAiCPxsvXFxTn0cadfvUQzoOuq hLedFgpbFqg54mJfuODmCXtEVK7iYLWOzHtppfeLZ5wDYu/r0H8ugPi22PsJkx6+SVT7 PDYzAw7RJl+qWkFZCvIk7ni1vBhp9gHDEEAceEDbHf27/x0Xiflbnm9ecAxSJlMg85sX INuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VS04eRJB; 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 g14sor1436513ljg.36.2017.12.15.07.56.46 for (Google Transport Security); Fri, 15 Dec 2017 07:56:46 -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=VS04eRJB; 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=OXVTbBVyb8As8Yrqn/1KiYPJKsdq9JJvs6Uwj5w0K14=; b=VS04eRJBW0tF2J2SQvw2Et8mZE7AswIJ2eqcS5Ot5PU+3VdzkLXjFgn9yTqfgqiuz/ HTzXbLgROL7FP7kKA0U+jEl6UGhjezOXHf+wGb7HXlqoF7zC0SeqcszIFVcd/W7BtgH5 8L/KYd6knfg/EoiU1FshE5av0FfeAP8v4yeVg= 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=OXVTbBVyb8As8Yrqn/1KiYPJKsdq9JJvs6Uwj5w0K14=; b=cpcnwYDNtJoVIth7p1EVSLkoG3jwhr7N3puNWtIqroLhd0i55VTWEQcSJ1GvNUlV6f 9Tt66mP8wGDqFrbDVnULWQT9GQGDYsp0I7sc5NpHJvjmSXnGtOnOZb9aHrJpldF8U19u PYzWSv7w57rXtCKaHTEcBKXMcxw9pNZJQR2bzzqfouUZun3z7vzlo1lqcwu8A+TqHk9e tby1y1QXwH1s6Ox9Qc54QpqGi3ZbWVOC+spXPV5R2QcnsQwCdUYKALnhQmJjEXX07lij YFoEdr9iqla2TwNU3LOtkgiGogRghbkv5iZMbMUHxypTu9wEQc4IN1wdF7LUQKO0RPp+ ZAEw== X-Gm-Message-State: AKGB3mJu3fgOmvIgmqZoX+ZEfTJgV93lslO4BvIQnP4OvVmFOcZ486PX LCsn3byIEzmc7r7wOV+ab0ezucoM X-Google-Smtp-Source: ACJfBovBOC6OCdFGXSMMNM2M6wQ+vV2sVSA3KK4lo+esHlHbP2lfzL64+5pAkKEHZkQderNBOrkufg== X-Received: by 10.46.34.196 with SMTP id i187mr6727659lji.106.1513353406285; Fri, 15 Dec 2017 07:56:46 -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 y15sm1294216lje.10.2017.12.15.07.56.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Dec 2017 07:56:45 -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 2/3] PM / core: Add WAKEUP_PATH driver flag Date: Fri, 15 Dec 2017 16:56:30 +0100 Message-Id: <1513353391-30806-3-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> During system suspend, a driver may find that the wakeup setting is enabled for its device and therefore configures it to deliver system wakeup signals. Additionally, sometimes the driver and its device, relies on some further consumed resource, like an irqchip or a phy for example, to stay powered on, as to be able to deliver system wakeup signals. In general the driver deals with this, via raising an "enable count" of the consumed resource or via a subsystem specific API, like irq_set_irq_wake() or enable|disable_irq_wake() for an irqchip. However, this information about the wakeup path for resources, is currently not available to a PM domain (unless it has some HW-logic that knows this), which means that it may decide to power off a device and its PM domain. In other words, it may prevent the wakeup signal from being delivered. For this reason, let's introduce a new WAKEUP_PATH driver flag, to allow a driver to indicate that it controls a resource needed in the wakeup path. Make the PM core to check the WAKEUP_PATH flag immediately after the ->suspend() callback has been invoked and set the wakeup_path status flag accordingly. In this way the wakeup_path flag also becomes propagated to the parent device, which may be useful for some cases. For a PM domain that needs the information about the wakeup path, it should check the wakeup_path status flag for its attached devices in a later suspend phase, but perhaps also the WAKEUP_PATH driver flag explicitly, in case it has been set after the ->suspend() callback has been invoked for the device. Signed-off-by: Ulf Hansson --- drivers/base/power/main.c | 3 ++- include/linux/pm.h | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 810e5fb..1327726 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -1620,7 +1620,8 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async) End: if (!error) { dev->power.is_suspended = true; - if (device_may_wakeup(dev)) + if (device_may_wakeup(dev) || + dev_pm_test_driver_flags(dev, DPM_FLAG_WAKEUP_PATH)) dev->power.wakeup_path = true; dpm_propagate_to_parent(dev); dpm_clear_suppliers_direct_complete(dev); diff --git a/include/linux/pm.h b/include/linux/pm.h index e723b78..ebc6ef8 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -560,6 +560,7 @@ struct pm_subsys_data { * SMART_PREPARE: Check the return value of the driver's ->prepare callback. * SMART_SUSPEND: No need to resume the device from runtime suspend. * LEAVE_SUSPENDED: Avoid resuming the device during system resume if possible. + * WAKEUP_PATH: The device is used in the wakeup path from system suspend. * * Setting SMART_PREPARE instructs bus types and PM domains which may want * system suspend/resume callbacks to be skipped for the device to return 0 from @@ -576,11 +577,17 @@ struct pm_subsys_data { * * Setting LEAVE_SUSPENDED informs the PM core and middle-layer code that the * driver prefers the device to be left in suspend after system resume. + * + * Setting WAKEUP_PATH informs the PM core and the PM domain, that the device is + * a part of the wakeup path at system suspend. The PM core detects this flag + * and sets the wakeup_path status flag immeditaley after the ->suspend() + * callback has been invoked for the the device. */ #define DPM_FLAG_NEVER_SKIP BIT(0) #define DPM_FLAG_SMART_PREPARE BIT(1) #define DPM_FLAG_SMART_SUSPEND BIT(2) #define DPM_FLAG_LEAVE_SUSPENDED BIT(3) +#define DPM_FLAG_WAKEUP_PATH BIT(4) struct dev_pm_info { pm_message_t power_state; 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: 122117 Delivered-To: patches@linaro.org Received: by 10.140.22.227 with SMTP id 90csp648140qgn; Fri, 15 Dec 2017 07:56:48 -0800 (PST) X-Received: by 10.46.4.13 with SMTP id 13mr6151956lje.82.1513353408085; Fri, 15 Dec 2017 07:56:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513353408; cv=none; d=google.com; s=arc-20160816; b=obslcg1V0PjEFqDUFXpGadJotW0amTxHrEJfqDOK/pRlu2LpuG5qZgyqiGmV/SJT8i M3u7yfgd9zGwJmQNBdvwz5qcqg+SViguk4X6k69JIRwrPZ1n9Tz/dkEfg/6sMbxoNmml XeBet3GmcyxqlXw9vYSbymiZbACoBtTfYFDYcFemEm+fwQGgH0F5+Pti8UoVas1HV1E8 J+CmTmq8Dc1utSaN7T8dqtmDGk/sCa9bcgi/CkYPNfcFNLwqzkBDRQkIDvz9D0yczNpj kT5Svot7YlUYIrOlDfvNLqD4D211jeqoDcZFWQCxkCbNJeBjK2u0abCsTQ9uMQOZmDcn I9QQ== 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=jCY8bz7/xQ5L0RsBznCtaUtqbUhDUVEVK60+e6PwQos=; b=L4cZDav92bAuE/KeisVUIIIlqY5LvfbYdGU2WztFEgLNnzfmK3fHY/8grUhhua3kTk VbTSkgwtFpcowD8whqk64wsen1uH5FyetLGM6+MF5K4bI7+d8zIz3QQqZP+UCd8RhKP0 Qtj3pvRNg419qhn1D0QLMNpiI0y3XvWDtJY455TWH00avSMd1LK4rzhDY7wsA7XTJllg VnE39vUm0r2HSCZrUNAcAnotQXeo5YOHdy0sZ/J4ZW6tNX19s0HUrxIHdzBC5wKGl0Ib cuw1L9x2X6hCPByzldGWURWPCLKdjfDqDPAh3B2kfxhWb40CswKJCfSt7uSeqsSQt402 w/RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b1HYL5Ak; 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 x30sor1452067ljd.22.2017.12.15.07.56.47 for (Google Transport Security); Fri, 15 Dec 2017 07:56:48 -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=b1HYL5Ak; 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=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=kPWfnc1x+dJDywVzxoOEqJ81rBhY3nxsAF1hpfYBqoyTOr+DloRudkjZUD1tGnUQeq N8AIiGKbaE4H86njHGf31LZq4sZpuQA7Jw6n2A2MC5NOPEq4q+BcxV7LWSgTjoKJlk3v AtTOfVBXziiJYcbtNucFtkPNKMJF6+u1azjm3b3W6HxGDMD/06zePMFvj1NGJg8GLr5s Je5bHoqkyP0pv+b4VWPNug8IQiva4xUR3x/R/DoRXa8HlDhxvmwY80A9bttNJbaJklRY iKH2Ng5bzFhqGyznt/K9WImwaipu8jXBZYCIjmRFDuHWZKV+ckyKt3T/cOlTZ70uCMvj k3ng== X-Gm-Message-State: AKGB3mLs53Wz+OHmf2r+Iy7gPwU7ozv44oDdZt4llA8/FeCzxUXY0XE7 u4iZWLt8XgDZGjquM9hxq8PDlow/ 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) 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 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> 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(-) -- 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);