From patchwork Tue Jun 8 09:02:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 455764 Delivered-To: patches@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp3492023jae; Tue, 8 Jun 2021 02:03:05 -0700 (PDT) X-Received: by 2002:a19:4810:: with SMTP id v16mr14546734lfa.254.1623142985375; Tue, 08 Jun 2021 02:03:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623142985; cv=none; d=google.com; s=arc-20160816; b=nbMoDg1KqcSU8n2cLwBCEpX86zWPCJwFIU3zyeztcSXRNKCHf0UwjuWLLBrepm2Zpn uFsnMYcsvrSOkMGB/TY2gqB6S3sXpq08XhQw5bHG4ThG6M+2TFOnXe4XVvYnfTCVi0xU iTylkvTZDUK/5LzTGfEbZTHWb3uW3yiRULmjJCNDLU54xgDRwObKAOKUOSaPd7zBS5c9 rnPCKG4N3PNdW0U1xnHYrD4mafxg2rjlZ3Ig3jFz93xWECL6CS4VtSw6UzCz1R3GYbNo fWZ1C4qI9Wsaj84fna8nbwtSbPIbremSgv3wdAgtTB29/e3wm/0JVzQn5lYAqLBWpyym 9s7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=WHAUVw9IK/B21jxzKRMs6//VXx/YmyYDw1kGjq54fl8=; b=A/pmaIg+roib5N9KdDfs/RfkdQ/bTYHs4FJABkzJmk4HO4yThFusGtP8MRkzVCSGG0 502w7xuJ9BCzizUbQ5w4aKmrBzzMYqTFvtdE9m8aEwlxBgQzg+ibCULIVMigdR1xO8Km GTYNq/zhqx+PpR9DQ6676Sj/AucmyJ8yxr4LuxoTSZo5Na6JmNry84nq6Dg3DBKIVeEW w5fpF2vQQmtiNY66MgxPMcqVsHnCm227s3OjW/w8E0Z+4JRBQbMMtbB/ygAMcRXzF9Vl mTuGDLWskk3USgAo22TsxEhDIdNFBMB+KMU9VnEXCIebcqwoEquZhMHOrapgIEUzacSN MwQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="x/pah5O+"; 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 i16sor5397378ljj.3.2021.06.08.02.03.05 for (Google Transport Security); Tue, 08 Jun 2021 02:03:05 -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="x/pah5O+"; 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:in-reply-to:references :mime-version:content-transfer-encoding; bh=WHAUVw9IK/B21jxzKRMs6//VXx/YmyYDw1kGjq54fl8=; b=x/pah5O+Sx0Z4lOP+fg3cHpCidQHkwi2heJOoPI5fIm1clzrgyKI13b4uwfi3BlBxP /S0N0zrCeQF9cx46GmExNiFLG+CoAZiQ9GVZo2PlPEB0/jmkVVLsB7HvQP/V3jil1/UN AAThDTp13HUJNpENh5WHIuZJVSy7KqKn5DRraGh9A+xEhxVBph7DhYVp3pvehkNdD+Km Vc0HMkMTuTfbQoYseFrw1C/WLH7QowToT7c4D9JEu+oNpdcW12gmuW6+trM/ZLKHhb8Q QpZ0y3KNzPDE0fRDOEk7jC1pl3ge11zUYo/JbuVzufsttqqEY7TeE4xc4K4HhoCKw9/G IYeQ== 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:mime-version:content-transfer-encoding; bh=WHAUVw9IK/B21jxzKRMs6//VXx/YmyYDw1kGjq54fl8=; b=g5LoN7DFlHDixWgRV5ETW41V7vwmIJvxv8FT2I7iypdeRlw1Vu9LDdxKxTnjODfLx1 akvOqFW+0Z+D7UKuZG+jQdVVcKhBjkxAOgllGfSNBYhfVlQd3sR2RXkxG09C/6Jx91tk 1HyVBBx7Z1Ceo6b6iX5XA87sNIRL3h6WTREb9iooHoZrRxjwCAtRtZq73N41DNh0Mv+I QLIpe1qbXWVeF2dbreKAluLCCapm50IV6kI3Pcetxd9yQxFfRhgMLytazKqjAP5q4v9f OD4MDBj4yfBmKRAR08R7Fyx33xQPUDE8GjjHCiFpv5HqPVApxMNktZ3hno0O3fWwKKM2 LQKg== X-Gm-Message-State: AOAM533CUOFpr/t5vYMar9wa0pdtuh5G/rQPhxRNY4Guf9W15KLGkRfW 5A95iLP5M6/9NWt0Tbhx6DybphGTJbld1eOadzM= X-Google-Smtp-Source: ABdhPJxhC0tQCmxGqeuhNNx51utAaeSuu/R6EEKrqA/ZMKUME6+3IFqg+FSKkB3lncYPy8y9mbgomg== X-Received: by 2002:a2e:7011:: with SMTP id l17mr17753121ljc.372.1623142984661; Tue, 08 Jun 2021 02:03:04 -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 n17sm1295197lfq.118.2021.06.08.02.03.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 02:03:03 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , linux-pm@vger.kernel.org Cc: Ulf Hansson , Saravana Kannan , Alan Stern , Adrian Hunter , Tony Lindgren , Kevin Hilman , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] PM: runtime: Improve path in rpm_idle() when no callback Date: Tue, 8 Jun 2021 11:02:48 +0200 Message-Id: <20210608090250.85256-2-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210608090250.85256-1-ulf.hansson@linaro.org> References: <20210608090250.85256-1-ulf.hansson@linaro.org> MIME-Version: 1.0 When pm_runtime_no_callbacks() has been called for a struct device to set the dev->power.no_callbacks flag for it, it enables rpm_idle() to take a slightly quicker path by assuming that a ->runtime_idle() callback would have returned 0 to indicate success. A device that does not have the dev->power.no_callbacks flag set for it, may still be missing a corresponding ->runtime_idle() callback, in which case the slower path in rpm_idle() is taken. Let's improve the behaviour for this case, by aligning code to the quicker path. Signed-off-by: Ulf Hansson --- Changes in v2: - None. --- drivers/base/power/runtime.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.25.1 diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index b570848d23e0..68bebbf81347 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -446,7 +446,10 @@ static int rpm_idle(struct device *dev, int rpmflags) /* Pending requests need to be canceled. */ dev->power.request = RPM_REQ_NONE; - if (dev->power.no_callbacks) + callback = RPM_GET_CALLBACK(dev, runtime_idle); + + /* If no callback assume success. */ + if (!callback || dev->power.no_callbacks) goto out; /* Carry out an asynchronous or a synchronous idle notification. */ @@ -462,10 +465,7 @@ static int rpm_idle(struct device *dev, int rpmflags) dev->power.idle_notification = true; - callback = RPM_GET_CALLBACK(dev, runtime_idle); - - if (callback) - retval = __rpm_callback(callback, dev); + retval = __rpm_callback(callback, dev); dev->power.idle_notification = false; wake_up_all(&dev->power.wait_queue); From patchwork Tue Jun 8 09:02:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 455766 Delivered-To: patches@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp3492127jae; Tue, 8 Jun 2021 02:03:08 -0700 (PDT) X-Received: by 2002:a05:651c:169b:: with SMTP id bd27mr12161832ljb.219.1623142987635; Tue, 08 Jun 2021 02:03:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623142987; cv=none; d=google.com; s=arc-20160816; b=liL2xGS1KTqkEZgsNlvZe1fkCqy/6kPJ1V8IOsPOXjN3k56fqx4w2pvsFhXFjQjM+r K6o1J+kVr03MtMmm9MmrPjq0nA2gqvB25W6LZA9Z6w2zy9bJNQ7d9Wdu2Dmxk7QVEwvv eI9gJdvq8OpCdFmEXNnfUGPlNO8D4WxWD1TpGqQc1ht1axZ8vHLsCeu13PAtZ21Av+Ec +NJlB85kDVfTI7uF1mGo5+jcTrdigUgCRCrL0/uXxgR+GyyBv2Whlj+Jd+XDHgU0lqmO OLBy6OJp2zId16wDGs3PD0cDcJE3o9ymtuAwxwOOWTZBCBMx7tQ+s7vu2myeNeBsmk2d NPrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=cnFHa21pMNW2jSUA5XLazyeCEAKZE26JFLYB4VhYyNQ=; b=Ve4Zj6Cg//LhImwXmJlUNa5Xhv7cebI/uukH4ARCH+iNJ2W8Rs0ZCSOF7hkqzQsgIj hG46qo/NiOQcFmT9MqA5TRICyM7OWrJm0ODh/T8grKKLdk/m6NECghAg/LnXFrsAKcoE TjaC5Xk4CmSzXlYn4j+3nzl3ff0Q2xpY7PkYqt2SaBgE93PnUoGzSteVT2SI+6VZ7Eti htZK10cIc7H1gGE9vB3S7sQSUNY4MsQ0UwZu7nRZfl613fQPB/z3IoEyPve4lego19HT +3FCueQwK19WjU2mC0HLW62D8dR741TZibHDNQUEuFNg7NgxLz45X2MsadMtssXkjwkG eALw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IgmBj3uQ; 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 i18sor6993985ljn.14.2021.06.08.02.03.07 for (Google Transport Security); Tue, 08 Jun 2021 02:03:07 -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=IgmBj3uQ; 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:in-reply-to:references :mime-version:content-transfer-encoding; bh=cnFHa21pMNW2jSUA5XLazyeCEAKZE26JFLYB4VhYyNQ=; b=IgmBj3uQF/Drcu204B+VWTFpSeocdqBPPSoxqws7142jumL25Uh5R6+dPP3v0J9iDm j5QqH9Ueia7WhFVQ1v7KZarY1H2h/Eq3xB25ZWAf+ABK2kLFWm3LoepZMmcAk1dj7kPJ 46dqfwubP/ws+WPzvXo9LK6LFtc5lpDs+TabH+uCeUi+C5A0gGRZiLboqtFAWmVkmGVw w40ygOPUcdE2e6jgopsgKqAi6jk8FzXRZF/WwTCijJ1nYRib8SmANKg8IVxH+bHIs6Zb AGWWja740laEZ6wEwACI96rsf2teqI61gIyrMTRpymTewlClTj3Jq/AD5nJS9cz1cIos BYGQ== 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:mime-version:content-transfer-encoding; bh=cnFHa21pMNW2jSUA5XLazyeCEAKZE26JFLYB4VhYyNQ=; b=ozytzaCE14gk6ZTXtwya1xkcGX9M5wq3Ned+aP8gfUmmkXym9C+Ml0CV2ek6zkN+vk u00YHH3WJi8mWTbKVJZiX5fz/V4bE6EM5PI9ZWS2oTJ6q05wDmb+diLQaHdR1fRfQAl/ Tiqz+sgy3RktsLdcXRWF3KnnmkfhdU/WyDTjnaQCw3C4XxOhyrC3BFoRZ1Zu1wHqKCQe 5zB1yitZ0St7o5o+PKhCale6lNtRzuKI/m2LZI/GP3KjwKIhrPf2Nw7xlxnV0hlGMEgy o3vnkYvpNtKlvtV0jDQVn0FSGezxE9qWZDBBTQ5Lb3nm7hVCHmkaqMxvl5ONSaiDPi5b to3w== X-Gm-Message-State: AOAM533CzBCybjqZIkql5KX1tfbFoIqUhGd1M5lv9TgGg/D5WPoiJuYO 5GIpP62mC1c5bjNmEjyMSLgsCHsi X-Google-Smtp-Source: ABdhPJwI7y00opt25k6XFPvLGoi/PJ+2CRkZfM2+49l59Hp/hIZD5O6F5RgnDnBcP7p2eJIkt8skQg== X-Received: by 2002:a05:651c:1138:: with SMTP id e24mr17675880ljo.403.1623142986144; Tue, 08 Jun 2021 02:03:06 -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 n17sm1295197lfq.118.2021.06.08.02.03.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 02:03:05 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , linux-pm@vger.kernel.org Cc: Ulf Hansson , Saravana Kannan , Alan Stern , Adrian Hunter , Tony Lindgren , Kevin Hilman , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] PM: runtime: Allow unassigned ->runtime_suspend|resume callbacks Date: Tue, 8 Jun 2021 11:02:49 +0200 Message-Id: <20210608090250.85256-3-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210608090250.85256-1-ulf.hansson@linaro.org> References: <20210608090250.85256-1-ulf.hansson@linaro.org> MIME-Version: 1.0 We are currently allowing ->runtime_idle() callbacks to be unassigned without returning an error code from rpm_idle(). This has been useful to avoid boilerplate code in drivers. Let's take this approach a step further, by allowing also unassigned ->runtime_suspend|resume() callbacks. In this way, a consumer/supplier device link can be used to let a consumer device be power managed through its supplier device, without requiring assigned ->runtime_suspend|resume() callbacks for the consumer device, for example. Signed-off-by: Ulf Hansson --- Changes in v2: - Small updates to commit message. --- drivers/base/power/runtime.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) -- 2.25.1 diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 68bebbf81347..8a66eaf731e4 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -345,7 +345,7 @@ static void rpm_suspend_suppliers(struct device *dev) static int __rpm_callback(int (*cb)(struct device *), struct device *dev) __releases(&dev->power.lock) __acquires(&dev->power.lock) { - int retval, idx; + int retval = 0, idx; bool use_links = dev->power.links_count > 0; if (dev->power.irq_safe) { @@ -373,7 +373,8 @@ static int __rpm_callback(int (*cb)(struct device *), struct device *dev) } } - retval = cb(dev); + if (cb) + retval = cb(dev); if (dev->power.irq_safe) { spin_lock(&dev->power.lock); @@ -484,9 +485,6 @@ static int rpm_callback(int (*cb)(struct device *), struct device *dev) { int retval; - if (!cb) - return -ENOSYS; - if (dev->power.memalloc_noio) { unsigned int noio_flag; From patchwork Tue Jun 8 09:02:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 455765 Delivered-To: patches@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp3492120jae; Tue, 8 Jun 2021 02:03:07 -0700 (PDT) X-Received: by 2002:a2e:3311:: with SMTP id d17mr17894834ljc.382.1623142987814; Tue, 08 Jun 2021 02:03:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623142987; cv=none; d=google.com; s=arc-20160816; b=NdY1r7ZhyCwEdPZXLO90XnR2pgsneEz8M/PqDnKsxKIgTnTW9eOZTDXIXD7dW8rrqC ZGfFHUmXViWThnlzb7oyNFqoD0dHYYLd78ssxlM2VCADFaSkI5PKr4xodRE7EQbkWJXK 9MfBvE0YM97tSBukxhvS9rBb3sokHRtoZN3Q7PXNPT1dEOxYWJC+0oUaB/xHkM8KCi4m tO/uRY6GRG7v7XjEynrOzZUb2eOCzjiwsUnHrbjd+YiCfjqWTHK6iR+yQ8sUlMR5awXZ OdFAYxSgXBLH7V9dYRPZ1wFmCLNogra4tfwzt/UeyH7Xw3GFRdXmtxn41jxBxVnjY7rp 3Yhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=ehN5ksOKPDeXaQtxFuYUYGE2SbISLeBDzZHvbFwjLMU=; b=u9ep22MxATlKvMCJ8Jyc4M48d8bRy+x51GkJJ7eCROz0bEWiq8M+5ir3fkN7vpeiaJ wAP7EnPP9uTp99Rso4lD0YpiR2LgClc5MOhF54DJksd4W9FAYW+6nGdMl+0WT4VsFmoo vljR7voBgeC6h5Q1piXkIxQbeQO1a4q8nvK+if69nOxp3tng5fVnHe5j+TI/lqt5+cei Dz0IyEB5y4tP892JfJStiJ74b2VTRxOJffWwbrRVoP0I4AXLLLPhd0hqvFC7zi/nvRTQ jJFVXSdv94o3YLx5RutIu+MX0cPt3/RzIVcZM52ExWWhcAIe/F+81EYuK4SCvSVfmcUg A6Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YXZJiLTX; 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 v25sor5078036ljj.43.2021.06.08.02.03.07 for (Google Transport Security); Tue, 08 Jun 2021 02:03:07 -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=YXZJiLTX; 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:in-reply-to:references :mime-version:content-transfer-encoding; bh=ehN5ksOKPDeXaQtxFuYUYGE2SbISLeBDzZHvbFwjLMU=; b=YXZJiLTXuA3ySx4PD3wFxfxV+h5X01WFA/yCzSnXtG/SROViS31q2Xpf7c6R6T2uXn /QeDgMD14hOG36l9z4wdggSIniQ0PWuRpuOs6HNWGlfvUy4BZp4+z1wm8G8818dfoF13 Rwyen/We5cQJntTe4/vHwQG9ZrKl+eEwgrYwNso5O/dSf6iTkIHUIlEEyRGc4SY8BiWo 1VMRoJIHaYmSJ/ocMiVmEPvfFc2Af7tNKsRLJ3+gH8OzIxbVgXOIRGjNxDDmO2duNy4t A+b4Fv/FLcq+ITMNhQrGRmPh6NVEUQdJ3BupS+5llrFBcnvUG+7cIrsTXp4ZFQw/Exmh WNIQ== 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:mime-version:content-transfer-encoding; bh=ehN5ksOKPDeXaQtxFuYUYGE2SbISLeBDzZHvbFwjLMU=; b=Zynrce/Ga2/SilD+KD9h6ZnFp2CSOCYNK4LnxCu/6HZUBGijXLqa2Le5s/Yx22cdaW CdnypGFiwET+1J3lqlhzroWA5LXtKYzKGJTHbYbV5TF3KzYKcsJPRAdWnwxH56v1dpXH GZEraoNt6LdonVg46XdSMMW1tpCwV/63p99gJftPoLnbxsFK3/DHVgS08uExdWpGGaGU ARhPW0SyR5jrWPQqDT71IcTB9cvdl2/X2RXvJDLTk7p7citE3KhvIQS5oRAGbOEBX5jE /cywUiedCQYvDee4VaNGabr74eDYHF3YbGkhHKH/Byhe92MmPPXyXo3cC5CIplWQKTub +GPQ== X-Gm-Message-State: AOAM531WFeMZNhrGYl9WFByY29fTzXe2QYPzNYt/tGJ8FNfMO3RBPxSA rBPAz7iv4aKVtO8drd1oIV5vtO85 X-Google-Smtp-Source: ABdhPJz3SwQ9T24mG2HslSdPG6wDOlx6diMgH43qf1V0qfrzdC4lFXrnIIfuLG0XzfSUioSrputIGQ== X-Received: by 2002:a2e:a603:: with SMTP id v3mr18072187ljp.175.1623142987476; Tue, 08 Jun 2021 02:03:07 -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 n17sm1295197lfq.118.2021.06.08.02.03.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 02:03:06 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , linux-pm@vger.kernel.org Cc: Ulf Hansson , Saravana Kannan , Alan Stern , Adrian Hunter , Tony Lindgren , Kevin Hilman , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] PM: runtime: Clarify documentation when callbacks are unassigned Date: Tue, 8 Jun 2021 11:02:50 +0200 Message-Id: <20210608090250.85256-4-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210608090250.85256-1-ulf.hansson@linaro.org> References: <20210608090250.85256-1-ulf.hansson@linaro.org> MIME-Version: 1.0 Recent changes to the PM core allows ->runtime_suspend|resume callbacks to be unassigned. In the earlier behaviour the PM core would return -ENOSYS, when trying to runtime resume a device, for example. Let's update the documentation to clarify this. Signed-off-by: Ulf Hansson --- Changes in v2: - Added a new patch for the updating the docs, as pointed out by Alan. --- Documentation/power/runtime_pm.rst | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.25.1 diff --git a/Documentation/power/runtime_pm.rst b/Documentation/power/runtime_pm.rst index 18ae21bf7f92..3d09c9fd450d 100644 --- a/Documentation/power/runtime_pm.rst +++ b/Documentation/power/runtime_pm.rst @@ -827,6 +827,14 @@ or driver about runtime power changes. Instead, the driver for the device's parent must take responsibility for telling the device's driver when the parent's power state changes. +Note that, in some cases it may not be desirable for subsystems/drivers to call +pm_runtime_no_callbacks() for their devices. This could be because a subset of +the runtime PM callbacks needs to be implemented, a platform dependent PM +domain could get attached to the device or that the device is power manged +through a supplier device link. For these reasons and to avoid boilerplate code +in subsystems/drivers, the PM core allows runtime PM callbacks to be +unassigned. + 9. Autosuspend, or automatically-delayed suspends =================================================