From: "David Wang" <00107082@163.com>
To: "Greg KH" <gregkh@linuxfoundation.org>
Cc: rafael@kernel.org, pavel@ucw.cz, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pm: sleep: do not set is_prepared when no_pm_callbacks is set
Date: Tue, 3 Sep 2024 19:26:27 +0800 (CST) [thread overview]
Message-ID: <2d012670.aff7.191b7a2d57c.Coremail.00107082@163.com> (raw)
In-Reply-To: <2024090347-latter-collide-772a@gregkh>
HI,
At 2024-09-03 18:23:55, "Greg KH" <gregkh@linuxfoundation.org> wrote:
>On Mon, Sep 02, 2024 at 08:59:33PM +0800, David Wang wrote:
>> When resume, a parent device with no pm callbacks
>> would have "is_prepared" and "direct_complete" bit
>> set, and skip the "fib" chance to unset "is_prepared"
>> in device_resume because of the direct_complete bit.
>> This will trigger a kernel warning when resume its child
>> For example, when suspend system with an USB webcam
>> opened, following warning would show up during resume:
>>
>> >usb 3-1.1: reset high-speed USB device number 4 using xhci_hcd
>> >..
>> >ep_81: PM: parent 3-1.1:1.1 should not be sleeping
>>
>> The device parenting relationships are:
>> [usb 3-1.1] << [uvcvideo 3-1.1:1.1] << [ep_81].
>> When resume, since the virtual [uvcvideo 3-1.1:1.1] device
>> has no pm callbacks, it would not clear "is_prepared"
>> once set. Then, when resume [ep_81], pm module would
>> yield a warn seeing [ep_81]'s parent [uvcvideo 3-1.1:1.1]
>> having "is_prepared".
>>
>> Do not set "is_prepared" for virtual devices having
>> no pm callbacks can clear those kernel warnings.
>>
>> Signed-off-by: David Wang <00107082@163.com>
>> ---
>> drivers/base/power/main.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>What commit id does this fix?
Well, the state management of PM devices is quite complicated to me, lots of commits make small changes
and I cannot identify a single commit that solely introduced the kernel warning when suspend an opened USB webcam.
Most obvious commit seems to be
aa8e54b559479d0cb7eb632ba443b8cacd20cd4b " "PM / sleep: Go direct_complete if driver has no callbacks"
c62ec4610c40bcc44f2d3d5ed1c312737279e2f3 "PM / core: Fix direct_complete handling for devices with no callbacks"
and I will try revert those logic and update later.
>
>thanks,
>
>greg k-h
David
next prev parent reply other threads:[~2024-09-03 11:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-02 12:59 [PATCH] pm: sleep: do not set is_prepared when no_pm_callbacks is set David Wang
2024-09-03 10:23 ` Greg KH
2024-09-03 11:26 ` David Wang [this message]
2024-09-03 12:32 ` Rafael J. Wysocki
2024-09-03 17:30 ` David Wang
2024-09-03 12:31 ` Rafael J. Wysocki
2024-09-03 17:09 ` 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=2d012670.aff7.191b7a2d57c.Coremail.00107082@163.com \
--to=00107082@163.com \
--cc=gregkh@linuxfoundation.org \
--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