From patchwork Mon May 30 09:33:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 68831 Delivered-To: patches@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1308780qge; Mon, 30 May 2016 02:33:26 -0700 (PDT) X-Received: by 10.112.150.98 with SMTP id uh2mr8039864lbb.21.1464600806481; Mon, 30 May 2016 02:33:26 -0700 (PDT) Return-Path: Received: from mail-lf0-x22a.google.com (mail-lf0-x22a.google.com. [2a00:1450:4010:c07::22a]) by mx.google.com with ESMTPS id q20si17155973lfq.174.2016.05.30.02.33.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 May 2016 02:33:26 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22a as permitted sender) client-ip=2a00:1450:4010:c07::22a; 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:c07::22a as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x22a.google.com with SMTP id k98so69927353lfi.1 for ; Mon, 30 May 2016 02:33:26 -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=11/X6f7Q6U6Gng5tbo9LRBef+de2nYWZfQHEnL7XAYA=; b=H5Vp54oQuJwmbN/nlLIpw2jNvKV6mViTtXM71dlTNreIt1vVop5Vpgg4hbeY+O5RU7 ngjwAoe7oz8jtuQHWm7VKILSvkwqqX4SADhrncOZQ2ipwkYFoFylGrPuNlclRJKnqqwO CKpv5BSmN7M6e/Gdg6AkwMdHg1NAMjb4xBrIQ= 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=11/X6f7Q6U6Gng5tbo9LRBef+de2nYWZfQHEnL7XAYA=; b=ZJWjVl2g/GYkTD5y9Vfyi86pE7v9+tDsSu+8LQ8EF4lM3oQSsMndeYbHushUEHXlQf PNotB9LOuKqya5TdcZgPMQZekBYGhtsoxlg5Xr8LKdMxKhK+4f4mxg3cGEz0T/StMzrc rT5CocYQlzcLgVSu7ouzX0EeZX69MawEFRyg8aGZQkK0qKPLgcI/qvRntABM9DWbgWLj JQ0vZ0WZWetHwOytRqXgFbzD4fXXhp8mcRV4CRg3RmjwmLCNCsZk5Np5OLi+w7U7hrZg RfnJYn39JmYuLYTDeA8gQ5ULateJMDvGh7813+NWZSjL9kr3IAPeFmepc5IzKcE2FGSj /bnQ== X-Gm-Message-State: ALyK8tLwNlJzwW1nWUUlCRgQG4z7MmZ4AGfhDHnTGUvHrIFy5Rkfm6fylxdDauhuUOOMWfgMPNY= X-Received: by 10.25.19.223 with SMTP id 92mr7376566lft.147.1464600806172; Mon, 30 May 2016 02:33:26 -0700 (PDT) Return-Path: Received: from uffe-Latitude-E6430s.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 75sm4596853lfw.25.2016.05.30.02.33.24 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 May 2016 02:33:25 -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 v2 2/5] PM / Runtime: Prevent re-resuming devices in pm_runtime_force_resume() Date: Mon, 30 May 2016 11:33:12 +0200 Message-Id: <1464600795-26307-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1464600795-26307-1-git-send-email-ulf.hansson@linaro.org> References: <1464600795-26307-1-git-send-email-ulf.hansson@linaro.org> If the runtime PM status of the device isn't RPM_SUSPENDED, prevent the pm_runtime_force_resume() to call the ->runtime_resume() callback for the device, as it's not the expected behaviour from the subsystem/driver. Signed-off-by: Ulf Hansson --- Changes in v2: - Updated changelog. --- 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;