From: "David Wang" <00107082@163.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: len.brown@intel.com, pavel@ucw.cz, gregkh@linuxfoundation.org,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PM: add: move warn message out of mutex lock.
Date: Wed, 4 Sep 2024 00:16:09 +0800 (CST) [thread overview]
Message-ID: <408f4579.bfd0.191b8ac0e66.Coremail.00107082@163.com> (raw)
In-Reply-To: <CAJZ5v0itLuorOY-4PyDL5eFkWTf2s9JX++oBkzqi1cYcaHYdmA@mail.gmail.com>
Hi,
At 2024-09-03 22:10:16, "Rafael J. Wysocki" <rafael@kernel.org> wrote:
>On Tue, Sep 3, 2024 at 3:01 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>>
>> On Mon, Sep 2, 2024 at 7:50 AM David Wang <00107082@163.com> wrote:
>> >
>> > dpm_list_mtx does not protect any data used by
>> > dev_warn for checking parent's power, move
>> > dev_warn out of mutex lock block make the
>> > lock more efficient, especially when the warn
>> > is triggered.
>>
>> It does protect the power.is_prepared flag of the parent.
>
>In fact, the update of it in device_resume() is racy with respect to
>the check in device_pm_add(), but the purpose of it is mostly to allow
>the device driver's resume callback to add children without triggering
>the warning.
Kind of confused by this... if dpm_list_mtx could protect power.is_prepared,
then codes that change power.is_prepared should also hold this lock, but normally
they only use device_lock(dev);
David
next prev parent reply other threads:[~2024-09-03 16:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-02 5:49 [PATCH] PM: add: move warn message out of mutex lock David Wang
2024-09-02 6:31 ` Greg KH
2024-09-02 6:47 ` David Wang
2024-09-03 13:01 ` Rafael J. Wysocki
2024-09-03 14:10 ` Rafael J. Wysocki
2024-09-03 16:16 ` David Wang [this message]
2024-09-03 16:23 ` Rafael J. Wysocki
2024-09-03 16:42 ` David Wang
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=408f4579.bfd0.191b8ac0e66.Coremail.00107082@163.com \
--to=00107082@163.com \
--cc=gregkh@linuxfoundation.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rafael@kernel.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