From: Abel Vesa <abel.vesa@linaro.org>
To: "Rafael J . Wysocki" <rafael@kernel.org>,
Kevin Hilman <khilman@kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Saravana Kannan <saravanak@google.com>
Cc: Bjorn Andersson <andersson@kernel.org>,
linux-pm@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-arm-msm@vger.kernel.org,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Subject: [RFC PATCH v5 2/4] driver core: Add dev_is_drv_state_synced()
Date: Wed, 21 Jun 2023 17:40:17 +0300 [thread overview]
Message-ID: <20230621144019.3219858-3-abel.vesa@linaro.org> (raw)
In-Reply-To: <20230621144019.3219858-1-abel.vesa@linaro.org>
This can be used by drivers to figure out if a different device
driver has state synced or not for a specific device.
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
---
include/linux/device.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/include/linux/device.h b/include/linux/device.h
index bae11928ef7e..8f042f04b5d9 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1007,6 +1007,20 @@ static inline int dev_set_drv_sync_state(struct device *dev,
return 0;
}
+static inline bool dev_is_drv_state_synced(struct device *dev)
+{
+ bool ret = false;
+
+ if (!dev)
+ return ret;
+
+ device_lock(dev);
+ ret = dev->state_synced;
+ device_unlock(dev);
+
+ return ret;
+}
+
static inline void dev_set_removable(struct device *dev,
enum device_removable removable)
{
--
2.34.1
next prev parent reply other threads:[~2023-06-21 14:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-21 14:40 [RFC PATCH v5 0/4] PM: domain: Support skiping disabling unused domains until sync state Abel Vesa
2023-06-21 14:40 ` [RFC PATCH v5 1/4] driver core: Add dev_set_drv_sync_state() Abel Vesa
2023-06-21 14:40 ` Abel Vesa [this message]
2023-06-21 15:22 ` [RFC PATCH v5 2/4] driver core: Add dev_is_drv_state_synced() Greg Kroah-Hartman
2023-06-28 11:50 ` Abel Vesa
2023-06-21 14:40 ` [RFC PATCH v5 3/4] PM: domains: Ignore power off request for enabled unused domains Abel Vesa
2023-07-04 13:24 ` Ulf Hansson
2023-06-21 14:40 ` [RFC PATCH v5 4/4] PM: domains: Add and set generic sync state callback Abel Vesa
2023-07-04 13:54 ` Ulf Hansson
[not found] ` <2786d9ff-0579-429b-b431-a8547cbf6fb6@ti>
2025-04-07 16:13 ` [RFC PATCH v5 0/4] PM: domain: Support skiping disabling unused domains until sync state Ulf Hansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230621144019.3219858-3-abel.vesa@linaro.org \
--to=abel.vesa@linaro.org \
--cc=andersson@kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=khilman@kernel.org \
--cc=len.brown@intel.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rafael@kernel.org \
--cc=saravanak@google.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox