Re: [PATCH] RFC syscore: add suspend type to syscore

From: Rafael J. Wysocki
Date: Fri Feb 05 2021 - 06:43:59 EST


On Fri, Feb 5, 2021 at 11:28 AM Ruifeng Zhang
<ruifeng.zhang0110@xxxxxxxxx> wrote:
>
> Rafael J. Wysocki <rafael@xxxxxxxxxx> 于2021年2月4日周四 下午9:38写道:
> >
> > On Thu, Feb 4, 2021 at 10:07 AM Ruifeng Zhang
> > <ruifeng.zhang0110@xxxxxxxxx> wrote:
> > >
> > > Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> 于2021年1月29日周五 下午4:53写道:
> > > >
> > > > On Fri, Jan 29, 2021 at 04:27:26PM +0800, Ruifeng Zhang wrote:
> > > > > From: Ruifeng Zhang <ruifeng.zhang1@xxxxxxxxxx>
> > > > >
> > > > > Suspend type contains s2ram and s2idle, but syscore is only
> > > > > available for S2RAM.
> > > >
> > > > Who else needs this?
> > > In the s2idle suspend and resume, some vendors want to do some
> > > things, for example the vendor implemented the watchdog driver.
> >
> > Do that in the platform operations then.
> >
> > Adding the syscore stuff to the suspend-to-idle flow is not an option, sorry.
> Excause me, I really still want to know the reason.

The conditions to run syscore operations are: with one CPU online and
with disabled interrupts on that CPU. They are not satisfied in the
suspend-to-idle flow. Moreover, none of the existing syscore
operations need to be executed for suspend-to-idle except for the
timekeeping suspend, but this is done for a special reason.

> My requirement is that the watchdog need disable when the system s2idle.
> If don't, the watchdog will bark when system resume.

So disabled it from s2idle_ops->prepare() or
suspend_ops->prepare_late() if device suspend is too early for you.