Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp416860pxb; Wed, 27 Oct 2021 05:31:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzw/KqH95npHbWZD/hwDgue8oZlm/ev9GNsnPg057MKu5wkW2iiCdcxH4mGX5vEKhvZvBWQ X-Received: by 2002:a17:906:1957:: with SMTP id b23mr24383600eje.516.1635337877101; Wed, 27 Oct 2021 05:31:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635337877; cv=none; d=google.com; s=arc-20160816; b=BuEOy5T+Yojm5JwtgezlcUWbZ5NbrLOayiPTPHE6D6aYlaLfhIrWoQO/3P2QVQSXDR 2tauMd+U5nG+/kMupN5I36rR6xD8rGIHkVLqq62GtLG5rUKD2fjHabw5/A0JAf8huVDK Jd1u/8RBrM1dvFReYNUIk4nFz3fWlasfCjrFKYh0gd4bjSROL74Gb/ZgRtnPGTokbwFN y7lns33uNTClUi0yR/tYtupSiFoYNNzTBfLImBx807GC+4EXaJbq0BgFR9fOcymzgUt9 eWtoj7EzEB6Q91lkYCTr4JwF+g+1z7dMcsWZNejjC4+RSZ2dlmfnh7VPrDeQRzbLXPEz dvMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=4v28znH3ilP2dY+qktW1gaanvklLYwkJDiEGKPadfko=; b=wblDdB4xMsCm8XskrGyunUhxAIRt1ct+8HwslkqZpxZQyBH4AcS8vQIHddt7AcZmMO YnHu8FlZT2wSiNqMNLUujTYQ3Ln4HFNu237ywo3NF+k87vecD+tAh14nA0r0nAeDS0mx EgYAxOhoXDS2QrsqnEkQXan80RSCKaRcbyWB2FIDyhVcbRl+Acy0plH2F/1ujOeKsaZi OiMm/o7w5qHQuGrDUBp6BYsxBcM6YVbMldMImC3fCrqQFS5XAPZ/vqVw0Acl43Wk8ezh w17jOFPN6GlEhPzLLlBS/PNMmYPOLNhOegAInjkYLAGWpFwKtIBBHBla/qaPD8FM3IiE 5HBA== 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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b69si851362edf.143.2021.10.27.05.30.06; Wed, 27 Oct 2021 05:31:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g83eg0nD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240027AbhJZW32 (ORCPT + 99 others); Tue, 26 Oct 2021 18:29:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239993AbhJZW3X (ORCPT ); Tue, 26 Oct 2021 18:29:23 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43BB9C061745 for ; Tue, 26 Oct 2021 15:26:58 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id bq11so1874987lfb.10 for ; Tue, 26 Oct 2021 15:26:58 -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: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=PhSQ47jPMLtoSTi1aqX6WUkrvPLwJglkKJoYiObcSpg+GiAAq+rSvpNqKqwj9W3o8g PU+PFLT1I82X1rthFWCMHsK95r7CPeZuPvY9uIfNBwWN6SYj3a19fSVLLJ6IQRNzQupt ezAla6aIee7KsjrwwXb7A7jjtCM4tjenoZ65YS07adkO2lBk1a/0Q8COTvnMQqEZZj37 FXgneHqMV9vioB0Ugz3gHDJJoFl0qcHEJcZoyhiULtspwqZv1rIEnxkOwLGyoM9bOnNe hmPWxB3JlHMCN9PfmusGHaa0a4bL4k54aPkCcbBbCbyjoIie/t1fF88ZNarbXQp/NFoD FaZQ== X-Gm-Message-State: AOAM5339PHLsJE4Q/Tp7pMGHFiRTZ2Zitzy9W4mhttUAFDgDntErYQX9 B+MFIJsPQnVXKXanXpWINvrZKA== X-Received: by 2002:ac2:4bc1:: with SMTP id o1mr25286148lfq.553.1635287216613; Tue, 26 Oct 2021 15:26:56 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) 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; -- 2.25.1