linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ruifeng Zhang <ruifeng.zhang0110@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	ruifeng.zhang1@unisoc.com, linux-kernel@vger.kernel.org,
	chunyan.zhang@unisoc.com
Subject: Re: [PATCH] RFC syscore: add suspend type to syscore
Date: Thu, 4 Feb 2021 17:06:25 +0800	[thread overview]
Message-ID: <CAG7+-3NGUgryomKB=_W=p9nADPJVnns_x9oWpAFCEei7RiyrOA@mail.gmail.com> (raw)
In-Reply-To: <YBPNAoitmgnTxiqQ@kroah.com>

Greg KH <gregkh@linuxfoundation.org> 于2021年1月29日周五 下午4:53写道:
>
> On Fri, Jan 29, 2021 at 04:27:26PM +0800, Ruifeng Zhang wrote:
> > From: Ruifeng Zhang <ruifeng.zhang1@unisoc.com>
> >
> > 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.

The GKI requires that no modification of the kernel source is allowed,
so an syscore_s2idle is added for use.

The reason device_suspend was not chosen was that I wanted it to
monitor for longer periods, such as between device_suspend and
syscore_suspend.
>
> > S2idle requires a similar feature, so a new parameter
> > "enum suspend_type" is added to distinguish it.
>
> Who requires this export?
>
> I don't see a user of this new code/api in this patch, so why would it
> be accepted?
>
> Also, you are doing many different things in the same patch, please
> break this up into a patch series where you only do one logical change
> at a time.
I think it's only one things in patch
0001-RFC-syscore-add-suspend-type-to-syscore.patch,
add a new s2ildle type for syscore.
>
> thanks,
>
> greg k-h

From 1abd09045639dafdbf713514d4f1323b572dd2ec Mon Sep 17 00:00:00 2001
From: Ruifeng Zhang <ruifeng.zhang1@unisoc.com>
Date: Thu, 4 Feb 2021 13:29:56 +0800
Subject: [PATCH 2/2] RFC time: add syscore suspend ops to s2idle

Some vendors need do more things when s2idle.

The required GKI does not allow modification of the
kernel source code, so provide the syscore operation
interface.

Signed-off-by: Ruifeng Zhang <ruifeng.zhang1@unisoc.com>
---
 kernel/time/tick-common.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index 9d3a22510bab..8c4509250456 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -11,6 +11,7 @@
 #include <linux/err.h>
 #include <linux/hrtimer.h>
 #include <linux/interrupt.h>
+#include <linux/list.h>
 #include <linux/nmi.h>
 #include <linux/percpu.h>
 #include <linux/profile.h>
@@ -528,6 +529,7 @@ void tick_freeze(void)
        trace_suspend_resume(TPS("timekeeping_freeze"),
                     smp_processor_id(), true);
        system_state = SYSTEM_SUSPEND;
+       syscore_suspend(SUSPEND_S2IDLE);
        sched_clock_suspend();
        timekeeping_suspend();
    } else {
@@ -553,6 +555,7 @@ void tick_unfreeze(void)
    if (tick_freeze_depth == num_online_cpus()) {
        timekeeping_resume();
        sched_clock_resume();
+       syscore_resume(SUSPEND_S2IDLE);
        system_state = SYSTEM_RUNNING;
        trace_suspend_resume(TPS("timekeeping_freeze"),
                     smp_processor_id(), false);
--
2.17.1

Greg KH <gregkh@linuxfoundation.org> 于2021年1月29日周五 下午4:53写道:
>
> On Fri, Jan 29, 2021 at 04:27:26PM +0800, Ruifeng Zhang wrote:
> > From: Ruifeng Zhang <ruifeng.zhang1@unisoc.com>
> >
> > Suspend type contains s2ram and s2idle, but syscore is only
> > available for S2RAM.
>
> Who else needs this?
>
> > S2idle requires a similar feature, so a new parameter
> > "enum suspend_type" is added to distinguish it.
>
> Who requires this export?
>
> I don't see a user of this new code/api in this patch, so why would it
> be accepted?
>
> Also, you are doing many different things in the same patch, please
> break this up into a patch series where you only do one logical change
> at a time.
>
> thanks,
>
> greg k-h

       reply	other threads:[~2021-02-04  9:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210129082726.19406-1-ruifeng.zhang0110@gmail.com>
     [not found] ` <YBPNAoitmgnTxiqQ@kroah.com>
2021-02-04  9:06   ` Ruifeng Zhang [this message]
2021-02-04 10:32     ` [PATCH] RFC syscore: add suspend type to syscore Greg KH
2021-02-04 13:38     ` Rafael J. Wysocki
2021-02-05 10:27       ` Ruifeng Zhang
2021-02-05 11:39         ` Rafael J. Wysocki
2021-02-05 20:03           ` Ruifeng Zhang
     [not found] ` <CAJZ5v0iS92CN5MKHu8tOpQR6mOWu=4=PLqN84qXG+v+64Ro99Q@mail.gmail.com>
2021-02-04  9:09   ` Ruifeng Zhang

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='CAG7+-3NGUgryomKB=_W=p9nADPJVnns_x9oWpAFCEei7RiyrOA@mail.gmail.com' \
    --to=ruifeng.zhang0110@gmail.com \
    --cc=chunyan.zhang@unisoc.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=ruifeng.zhang1@unisoc.com \
    /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;
as well as URLs for NNTP newsgroup(s).