From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Abel Vesa <abel.vesa@linaro.org>
Cc: "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>,
Saravana Kannan <saravanak@google.com>,
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: Re: [RFC PATCH v5 2/4] driver core: Add dev_is_drv_state_synced()
Date: Wed, 21 Jun 2023 17:22:54 +0200 [thread overview]
Message-ID: <2023062103-chevron-sabotage-bf26@gregkh> (raw)
In-Reply-To: <20230621144019.3219858-3-abel.vesa@linaro.org>
On Wed, Jun 21, 2023 at 05:40:17PM +0300, Abel Vesa wrote:
> 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);
This lock is "protecting" nothing, given that the value can instantly
change after it is read.
Because it can change, how will this function actually show anything
relevant?
thanks,
greg k-h
next prev parent reply other threads:[~2023-06-21 15:24 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 ` [RFC PATCH v5 2/4] driver core: Add dev_is_drv_state_synced() Abel Vesa
2023-06-21 15:22 ` Greg Kroah-Hartman [this message]
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=2023062103-chevron-sabotage-bf26@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=abel.vesa@linaro.org \
--cc=andersson@kernel.org \
--cc=dmitry.baryshkov@linaro.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