Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1118966pxb; Thu, 4 Feb 2021 05:42:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJUtIdpz22OHYOtM1hjTgTGBTEoyn5us52LGmgdL2Mj7pxLzIttisEajbmXxgGFRW5bpgq X-Received: by 2002:aa7:d148:: with SMTP id r8mr7942049edo.127.1612446138110; Thu, 04 Feb 2021 05:42:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612446138; cv=none; d=google.com; s=arc-20160816; b=l1GE7ZXSAeSWGvxq/qnbfO5bHGhH32bFv9Yil8eU/8+c0SkRDRL3c8sHQpjaqq6W2d /vDFqkVJbdLJ2xXIk4SKFhBCUJslFoUvp7FUqsU71IG61NhZBB+Lpbf9zaRLir6TBy7K ef3ZIr6E0maRlqcxMXFnSMfBvUq5SG6hsfsYWaN5Oh47kQvnAplpsnHP5ZKiKT/PwzLV 3wmlZosdrJoICQGtFZxMqhLfNeCPWiFjmaRCZ8WahWWZ2AiVtqDFkUW0Iyflj26d1Iat iBlb1mDHIx8mj5AXKla8if8GJ7AgVMEY8ESWNKYJHH2H8nBtOQlGgED0T+QXFEA/HG4K koGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=QBknTg36+U65Nxhsfe1vJX6DSx0tWeG96ke4kExv3Qs=; b=knAJcQM+CmSKSvBFFYznZVeUK9LG9/eqHRpIkdmZEMRBk2m8oTDGOOU/22ju6ZB/lR +tqEP1xSwq/lYuUoQC0rxtjtN4mOErqu3hkEqeibuZV/Wu7au1qFax/cBS7zuyjtwLRE toM66z/fIccSmwYKcrQLthV0HMEcU8lyH83ZIXpauw8mYwxZUr+gbp8JB25bfGm8/mP7 owcuPnI47XE9REKDHplagoWQKofyr+2NF05Lk/M9UNhC29xKDJJjnMFeUDW5UpzZkMld gu8pPGxqyMHwGw+yYKr+TLkLgopcVcjt6OliFccbdziLLHlQ83/RzPChEhRKhw8nQw1Z 7/ZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f19si3373275ejb.315.2021.02.04.05.41.52; Thu, 04 Feb 2021 05:42:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236376AbhBDNj4 convert rfc822-to-8bit (ORCPT + 99 others); Thu, 4 Feb 2021 08:39:56 -0500 Received: from mail-oi1-f174.google.com ([209.85.167.174]:41901 "EHLO mail-oi1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236301AbhBDNj2 (ORCPT ); Thu, 4 Feb 2021 08:39:28 -0500 Received: by mail-oi1-f174.google.com with SMTP id m13so3692699oig.8 for ; Thu, 04 Feb 2021 05:39:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=6rRzb9E40rKbHmGBhgEXeJjPyHLlcHJuAPRHuZzcDfs=; b=Y5/5heaeNgDGlvUg/LWhr3QhiAK7i1ai+qWD15A2N7mv3vnVRKYF8DDFLsoKeKGJdj xYpygnd/vSg3uCsYuK6PJij2osJnIKi/DI0qFicNsv/f9pAtWU1pxYsvzNW3YGbSxJz+ 5ezkEYuNKw+YQxKu3t06wauwWweIKKjiceSCLpBxLd0zpdFkZhCLZF/LinfPMjm11jJI ksV3pJ+SPKZ7hbJN8ybjp40ZCrnVOawWqQcghXgHySCnk7rmiJdiIkJNzUYiZg3tEOZj BTBkeAd+AA0a13pPtw6g30+SLIyPI3C6G1Fwu5YukduDRQ8vSK3PnDI9qI7YOJX1BUNV bmOg== X-Gm-Message-State: AOAM533NxkLkv25GjQ7HlP4dSSl2h16x2H2qoJkjQsrsHAiAuQbXpHDM 0k56kIXRDMXW5NB3jFKYOimxontpVIfviJU3Ypt9eevY X-Received: by 2002:aca:fc84:: with SMTP id a126mr5275526oii.71.1612445924194; Thu, 04 Feb 2021 05:38:44 -0800 (PST) MIME-Version: 1.0 References: <20210129082726.19406-1-ruifeng.zhang0110@gmail.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Thu, 4 Feb 2021 14:38:32 +0100 Message-ID: Subject: Re: [PATCH] RFC syscore: add suspend type to syscore To: Ruifeng Zhang Cc: Greg KH , "Rafael J. Wysocki" , ruifeng.zhang1@unisoc.com, Linux Kernel Mailing List , Chunyan Zhang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 4, 2021 at 10:07 AM Ruifeng Zhang wrote: > > Greg KH 于2021年1月29日周五 下午4:53写道: > > > > On Fri, Jan 29, 2021 at 04:27:26PM +0800, Ruifeng Zhang wrote: > > > From: Ruifeng Zhang > > > > > > 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. > The GKI requires that no modification of the kernel source is allowed, > so an syscore_s2idle is added for use. The GKI rules are not a mainline kernel concern. > 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 > 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. No, this absolutely is a bad idea. > Signed-off-by: Ruifeng Zhang > --- > 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 > #include > #include > +#include > #include > #include > #include > @@ -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 于2021年1月29日周五 下午4:53写道: > > > > On Fri, Jan 29, 2021 at 04:27:26PM +0800, Ruifeng Zhang wrote: > > > From: Ruifeng Zhang > > > > > > 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