[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAE9iGojMgYKxReeartpXKWORdAfsj4t7Zo0pVb--+SLVGq4=cA@mail.gmail.com>
Date: Mon, 31 Jan 2022 02:15:05 +0800
From: Zichar Zhang <zichar.zhang@...aro.org>
To: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Kelly Rossmoyer <krossmo@...gle.com>,
Lee Jones <lee.jones@...aro.org>,
Len Brown <len.brown@...el.com>, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org, Vijay Nayak <nayakvij@...gle.com>,
Pavel Machek <pavel@....cz>
Subject: Re: [RFC] PM: suspend: Upstreaming wakeup reason capture support
Hi Rafael, Kelly
hello Rafael, it is a little bit late for me to reply to you. I was
finding the way to
reply to you, cause I'm not in the "cc list". So, thanks Kelly in that way. :)
I'm totally agree with you that we should split the work into smaller
pieces and do it step by step.
Hi Kelly,
I got the strong signal from you that you insist on your requirement.
It's reasonable, and I want that if I am the user too. :)
But it's could be some problem for me to do all of that. And I am calling help
here. Yes! I need some help!
I want to seperate this task into 4 part:
1. user interface: like sysfs file /sys/power/last_wakeup_reason.
2. report interface: call by "wakeup sources" to report "wakeup reason".
3. report operation in kernel: like "interrupt subsystem". (a common interface)
4. report operation in device: like WDT driver, GIC driver or other
device driver.
I think we should do the first 3 parts, but not the last one, cause it is device
specific things. Device and BSP should do that, I insist that.
Part 1 and 2 are easily to do, and I can rework again and agian until it is all
right for everyone.
So it is clear that we have problem with the third part. And yes! it is very
hard.
Kernel desn't know how the "machine" wakeup, kernel just offer the interface
that user can mark the "wakeup source", like IRQD_WAKEUP_STATE flag
and "ws"(wakeup source) interface (acturally they are fake wakeup sources).
These works well and we can easily to report these which Android patch and
mine already do that.
But the left things is hard.Cause kernel or "subsystem" in kernel desn't has
any mechanism to do that. Then we are facing these three things:
1. "misconfigured" and "unmapped" IRQs reporting.
Android patch just add a "wakeup report" interface here once it was occurred,
even it's not in a "suspend" state, and even one of them was in GIC driver.
if I was the maintainer I won't take this, but the question is what should I do
for that?
(Maybe I shoud give a task to "interrupt subsystem people" and ask them to
do that? :) )
2. errors in suspend/resume process.
That means if there is a error occurs in suspend/resume process I need to
report it as "wakeup reason".Which is just "abort wakeup reason" as Kelly
said. But it is lots of errors may occurs here, and which one I should report,
and is that enough?
And as Kelly said the code is "messy", that does hit the point.
3. threaded inerrupt
Sorry, I don't find the properly place in kernel to report there "wakeup
reason". Maybe that's my lack of knowalige. :)
It's seem like some interrupt chip driver should do that? I don't know. Maybe
I should offer a interface and just let "user" to use it?
So, that all the things I got.
And again kelly, I got your mind, and I will try to think this over again to see
if I can find a way to do that.
besides, thanks Jone and John, I will rework the patch after this discusion.
And any advice could help! :)
Or you have a better idea, I can help you to do yours!
Best
Zichar
Powered by blists - more mailing lists