lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <352ad1a.c130.191b8c44b51.Coremail.00107082@163.com>
Date: Wed, 4 Sep 2024 00:42:37 +0800 (CST)
From: "David Wang" <00107082@....com>
To: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: len.brown@...el.com, pavel@....cz, gregkh@...uxfoundation.org, 
	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] PM: add: move warn message out of mutex lock.


At 2024-09-04 00:23:57, "Rafael J. Wysocki" <rafael@...nel.org> wrote:
>On Tue, Sep 3, 2024 at 6:16 PM David Wang <00107082@....com> wrote:
>>
>> Hi,
>>
>> At 2024-09-03 22:10:16, "Rafael J. Wysocki" <rafael@...nel.org> wrote:
>> >On Tue, Sep 3, 2024 at 3:01 PM Rafael J. Wysocki <rafael@...nel.org> wrote:
>> >>
>> >> On Mon, Sep 2, 2024 at 7:50 AM David Wang <00107082@....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);
>
>It is confusing, sorry about that.
>
>The bottom line though is that you want to get rid of the spurious
>warning in device_pm_add() AFAICS.
>
>To that end, can you please try the patch I sent in the other thread:
>

>https://lore.kernel.org/linux-pm/CAJZ5v0hMnnDjKJLMgcT_p1nnejyyAyaqaA_AF5t+_=PsSMfceQ@mail.gmail.com/



Sure,  I will try it and update later.
But this patch is just about code-refactor, not about the warn itself.....


David
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ