From patchwork Tue Oct 26 22:26:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 516224 Delivered-To: patches@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp823440imj; Tue, 26 Oct 2021 15:26:57 -0700 (PDT) X-Received: by 2002:a2e:a717:: with SMTP id s23mr29880848lje.265.1635287216971; Tue, 26 Oct 2021 15:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635287216; cv=none; d=google.com; s=arc-20160816; b=svWKCHzcUKJeE22HfzRRWeilwTqdOqKrzpjiftGhDSKJWCu6lRLWKZRLUduRWUblaa axB7FBVsP5qr6lUWwdS0CCU8lwQE109DPdI7X+1+ABQrXBNHVTUxPjN8cua72/L5bdNW d80V4RQEtHfODo3hVIxCgVsq7Tz2jmFZbdHm4KLqGsnZLTS7u5nET6qifm9GNfd/vZfg 8pmmAOQe1JG1UTOhY8QFyWA0k4CB4+wtLsaEuJ2cGmYQePr/xFGji/KF9c9BVO11ul3f IwGbxU1rDLc702KlcAUO5G7bZaF3YL8Btr4aH7TGLQEZHl/9/6YlbzEz7wIZXN/N425R id1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=4v28znH3ilP2dY+qktW1gaanvklLYwkJDiEGKPadfko=; b=tNQclAZEk9svp+Vkkg+JpZ9nhc3Q2/Vu9A/ewUaJB7q1uES4x+TZ4KTbCKp1TX+OuA Yxde13t/W/y4J23A4MjgACVuzyi5R+4aZcvDBun2EcBeH4DZgWhSP2eo47E+oiXd6acs soASc8O2HLO3AoEyDrNke3RY7HvxHxNmp8oqqWQLgt8XnZ8hn7LoH9gpD+1BqWksJLsZ ys0NRMP1RxJt6auBYMELZumtsMaLX6XPdnbyfK4XFoYwqiR/73VySeLhgAAYlJFg47kX 3zJ9+NlXBUjU6hFcDi3tiW7BfQw5L383piB38iO3uJkvPzMgcVqitdr7zFswP/fL+03H rl5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g83eg0nD; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.41 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-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id u8sor5209614lff.188.2021.10.26.15.26.56 for (Google Transport Security); Tue, 26 Oct 2021 15:26:56 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g83eg0nD; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.41 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:mime-version :content-transfer-encoding; bh=4v28znH3ilP2dY+qktW1gaanvklLYwkJDiEGKPadfko=; b=g83eg0nDZaoDqbwau4PfYXiKLyApLtNQQZjgkFI2uJT4wRoBdiBcPsQWJrwHRtBqw/ U72PT+Lsa5nbGS1RgRlfoMNVeUEw1poXMnFXI+llKwbD6jRD0AvzN3LlUUlic2VHqNJM wwSLDLHxj8mz6iu2Q0ojGZUtLrRfG2jX7McF9grT9aJG6UUDer1p2mnevW7mtM6Cdvon t9WcCNTe0mJmwqRHHVSuYG9QlH/w0RAXwmwS1Xg5QekVOzFQtgJzXWQbrOnyUZktxjgy DzRXGIpIcQb6rw1dXdNinj+6faePaRQhrtlYpGfKsjwOaMdVUzgUrA8cvnOlc27GOXB2 XDvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4v28znH3ilP2dY+qktW1gaanvklLYwkJDiEGKPadfko=; b=H/BcG0eOl7OWRp7UTyId8X2s4zDxsmnHo1dnOL3VCL8l6LvSBuvfgf5iZ51xPcq8Ij s9uaUD5kLxtEoehxSa8sVNim7TN+Av2bOR9CAq0nHIwjXhEdAlE0hEajdgwa4hZX1Ez0 DGj03ZO5gnXVdy4eAhD1ykusZv5S080EHFFd24L77XIcMYnAkgHlrAA5A5CPYbyLUjUL T5e71YDvdiA80Q2if25Hz5hvLJl7EpD/fyGu71i8A3cr6+bNoJ1Q2F9ldMHDDYnZj+Zk 46KHWmzCfJwYUsWz5tq85iFe0pZe3+JaA7uhTK1pw7OS1SAa9wyN+dTnM/xPd9uZeiiP bA8w== X-Gm-Message-State: AOAM533wu5sYKEHku3jKIvwNkPwqa0glJUEvGBzIBHRcjAlOA2yK2MKs Q1Pm98eNUmKazul1qF1/OJdLeT9z X-Google-Smtp-Source: ABdhPJwzvk4FW4H7re68fFiY28R3LYk0CfvwdIfxKZJste2wqi2lNxLbAoljso4qwy0hmcnrtLLhoQ== X-Received: by 2002:ac2:4bc1:: with SMTP id o1mr25286148lfq.553.1635287216613; Tue, 26 Oct 2021 15:26:56 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-155-4-129-146.NA.cust.bahnhof.se. [155.4.129.146]) by smtp.gmail.com with ESMTPSA id bp13sm790352lfb.100.2021.10.26.15.26.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 15:26:55 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , "Rafael J . Wysocki" , linux-pm@vger.kernel.org Cc: Ulf Hansson , Alan Stern , Kevin Hilman , Maulik Shah , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] PM: runtime: Allow rpm_resume() to succeed when runtime PM is disabled Date: Wed, 27 Oct 2021 00:26:26 +0200 Message-Id: <20211026222626.39222-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 During system suspend, the PM core sets dev->power.is_suspended for the device that is being suspended. This flag is also being used in rpm_resume(), to allow it to succeed by returning 1, assuming that runtime PM has been disabled and the runtime PM status is RPM_ACTIVE, for the device. To make this behaviour a bit more useful, let's drop the check for the dev->power.is_suspended flag in rpm_resume(), as it doesn't really need to be limited to this anyway. Signed-off-by: Ulf Hansson --- drivers/base/power/runtime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index ec94049442b9..fadc278e3a66 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -742,8 +742,8 @@ static int rpm_resume(struct device *dev, int rpmflags) repeat: if (dev->power.runtime_error) retval = -EINVAL; - else if (dev->power.disable_depth == 1 && dev->power.is_suspended - && dev->power.runtime_status == RPM_ACTIVE) + else if (dev->power.disable_depth > 0 && + dev->power.runtime_status == RPM_ACTIVE) retval = 1; else if (dev->power.disable_depth > 0) retval = -EACCES;