From patchwork Tue May 17 11:41:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 67938 Delivered-To: patches@linaro.org Received: by 10.140.92.199 with SMTP id b65csp2022098qge; Tue, 17 May 2016 04:41:48 -0700 (PDT) X-Received: by 10.112.130.71 with SMTP id oc7mr337405lbb.85.1463485308883; Tue, 17 May 2016 04:41:48 -0700 (PDT) Return-Path: Received: from mail-lb0-x22f.google.com (mail-lb0-x22f.google.com. [2a00:1450:4010:c04::22f]) by mx.google.com with ESMTPS id a7si2147135lfd.192.2016.05.17.04.41.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 May 2016 04:41:48 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c04::22f as permitted sender) client-ip=2a00:1450:4010:c04::22f; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c04::22f as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lb0-x22f.google.com with SMTP id ww9so4838623lbc.2 for ; Tue, 17 May 2016 04:41:48 -0700 (PDT) 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=1jkrJndXVFZbe3zaP8RL1ZRRFhKsronOorj5Js2JsDQ=; b=Lisd97NmS819YBVBpv35OSP6GV7yFwGggdT+cPjgcJo+yaw9GFlxBMtnvkMjV1U/IC pIe5K816yVgCdbpC1fELR6fstJNGFpxjXyGdtleOYp1HVqD9KGh4EhY/m4ohhtqocP+S Lu/BK0foz1kKUuv14oEaPB/NwaS8Tj1UtH364= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1jkrJndXVFZbe3zaP8RL1ZRRFhKsronOorj5Js2JsDQ=; b=KpFdmE1UlXYW5mTeYGrFpl7SW6T/6ANS6w0pvb4CF21Id2QM3ww6ntkvlwkc5jCkTc YjWTL/nQ3oIJe2+IQ4V+uKZR7Fsi3yLAC/W4IpC4xPWbP+YOixfkyWVdo0sLEdlW5e2t n09wKaUxjjEoNaPZ7nM2aeSxkK+x0f5U39CusBToSYY4fbZ3zDl3Sqke3UnRHec3U1JY dUdfdeZI+fIIj4dTzscwENCessC7ETXvHlcLEIiT/s0pIpnb4oArJLJObwpup+pdNOst jpwKfdX0iHj7qVyX9SWtUyDMIfa3dQ9fp4npAOrdyAJOFzrFsbeGKdJ4IMoqYIQFBLsO XHgw== X-Gm-Message-State: AOPr4FW053GWt9MY/ITruXCrmXgq8TEcRZE1M+6h9GUfBOJsOudpiY3ZHiQhOKf67sSmLNjxRF4= X-Received: by 10.112.27.233 with SMTP id w9mr351903lbg.86.1463485308603; Tue, 17 May 2016 04:41:48 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-155-4-128-67.na.cust.bahnhof.se. [155.4.128.67]) by smtp.gmail.com with ESMTPSA id e187sm448752lfg.10.2016.05.17.04.41.46 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 May 2016 04:41:47 -0700 (PDT) From: Ulf Hansson To: "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , linux-pm@vger.kernel.org Cc: Len Brown , Pavel Machek , Geert Uytterhoeven , Lina Iyer , Axel Haslam , Marek Szyprowski , Jon Hunter , Andy Gross , Laurent Pinchart Subject: [PATCH 2/4] PM / Runtime: Prevent re-resuming devices in pm_runtime_force_resume() Date: Tue, 17 May 2016 13:41:34 +0200 Message-Id: <1463485296-22742-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1463485296-22742-1-git-send-email-ulf.hansson@linaro.org> References: <1463485296-22742-1-git-send-email-ulf.hansson@linaro.org> If the device has already been resumed before pm_runtime_force_resume() is invoked, prevent calling the ->runtime_resume() callback for the device, as it's not the expected behaviour from the subsystem/driver. Signed-off-by: Ulf Hansson --- drivers/base/power/runtime.c | 3 +++ 1 file changed, 3 insertions(+) -- 1.9.1 diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index b746904..09e4eb1 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -1506,6 +1506,9 @@ int pm_runtime_force_resume(struct device *dev) goto out; } + if (!pm_runtime_status_suspended(dev)) + goto out; + ret = pm_runtime_set_active(dev); if (ret) goto out;