Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2415667rdb; Tue, 14 Nov 2023 23:08:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IHWMJZx1lbSK526EtjXeuJHiHCglKlONt2jAX1TfeChj2spRRoicgss+GJaTbZqei9tgoHB X-Received: by 2002:a05:6a00:e14:b0:690:9a5a:e34e with SMTP id bq20-20020a056a000e1400b006909a5ae34emr7571458pfb.12.1700032104625; Tue, 14 Nov 2023 23:08:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700032104; cv=none; d=google.com; s=arc-20160816; b=hg8/ItjVYg5BuqjK1gdyqldrT2QjJGt0OLv6vsGLpY9iVlOKGX5syFDxg5FcE7uMtu Q2mFFWCv7R5Y2v0FzUC2pD0sWCWJTTEP6fJyO27l79FyAwnEvlUI0N2KHvFYdhbu5zFr ytDHSTo++ALxZK4IdnA7oo8xjBQZVBzDtylHciz8WWhHxCWNDR6qbjXamj8RPNqleNXm K3Jj4Tr1Vyc8LMjP8CAC2I4bcq4TIj3EF+n9FWjmo9WEAQUptXnx8djEPbWmmrinG3gu 6hXzhkndNfff7XIBEyauPw8UBKmhUWOKPlXChHSfgq5tRSrlNrWV7eTugSLu66bHYPD2 6PTQ== 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 :dkim-signature; bh=sjgDYCiVZoQHvB83kALIeM9OtG/SOdaCJiN+nH0BdL0=; fh=TN+xdw717/a7rF8tQqr9UFSH/dwMNUB1bCBQCgxd1gY=; b=GWVhITROtR9codxHrIVrBE/lXnRAAc4tacBjUEAr0gC3/xDFiOwz+tOE+dvZPGb2aC EK8BmlylLYPtsjtfCb2p73yJ0IbKqQ0W1QWQGYx4e1nAQrbDkWX1uiyEJqxs1oROO+6U nVXX8zDZVLy0WFQLfehXkWQZVp/4xAw7nUzMfqXYQ3gKA+amifyhvxnlxB68n1icwRRc HAmo1kZbwL/iM5gf+uiTym/yC5BCMtCnT+N6PSLLnmiLHFIjkety1u+htEGJdSVInBpt DQLOydwl2/FUFxvobobIUPdvg/LdmFoQz1iyLMgWQo5jhonEOSlkMbCXkpEcDpIMm0Ta skpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=PWFchHxO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id fb38-20020a056a002da600b0069342cee042si9777831pfb.51.2023.11.14.23.08.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 23:08:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=PWFchHxO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 58EFB80D7E40; Tue, 14 Nov 2023 23:08:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229600AbjKOHIU (ORCPT + 99 others); Wed, 15 Nov 2023 02:08:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbjKOHIT (ORCPT ); Wed, 15 Nov 2023 02:08:19 -0500 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34E08F1 for ; Tue, 14 Nov 2023 23:08:14 -0800 (PST) Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-54744e66d27so9996a12.0 for ; Tue, 14 Nov 2023 23:08:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1700032092; x=1700636892; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=sjgDYCiVZoQHvB83kALIeM9OtG/SOdaCJiN+nH0BdL0=; b=PWFchHxOLnIDxyxQOW7xkwrUL4GrQYkU7STtHNvjjtK24qbbpOBVd6RqWcdQeOXWmk b/XrC2McPwJpyuC2lH0eDdK/NSd2Tx5lpY51GgWlNwZDIevaZADJp7saj2I3noNTkE/N bEczc7939AoxqKnpzqTF4wyrVrBX8z5OJ8wQZMYzc/ZyV75tX1WIdZ0f1URKw3v4XyF1 73MZaarDAWBW2PWioeAB7lWGNSxB0r6d2rWvJKZZRBe/RbWk0h6RBbKPEv35qFPTccoR RM4HhthEvGjHhwnebUjwuSAuoOGAJNqOkRkaKkOK5HV7IZdlLtfuAoGg/dLexRdgIWMP 11iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700032092; x=1700636892; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sjgDYCiVZoQHvB83kALIeM9OtG/SOdaCJiN+nH0BdL0=; b=FKlRyHgvaOY8JktWiIEwpHm1QyguShA7f2pNp0WzAIAa9cBUKZa2NKzFesjSzSTCpj MM8BemvXhkaN6zkVFwLw4FXu0tNE5B8O2GhRzwoYR1bjBQlSRwwt85u1Z8AHJ42knqyE rS3OFUVgxznYAvOAxhNcE/nb3r6PDlIPJG3UDncwnnGJNsg8HwH3yXpHnYaWUyBXVDwP k3BNBORBZZLBNAmVGK/uQW7MLAANppz7S0+dxXP9zWuvveWQGY3nqMVCCJ0HK74cNCMn y438muRArvDYt7S6SiQFboBUTEtLljWo1LyJ9bozdX/D/UZvmeORUIpnhHu8qh18gGCK r8dA== X-Gm-Message-State: AOJu0Yx6sszhhgy2WERNvX/rF/JOMsMcTBAZHqkVw2W3m8LYlEMfxniM 5L2ugJXomIfbpNktm1fZjRKoVL0XPmYb+e41RHrkZw== X-Received: by 2002:a05:6402:1948:b0:546:d479:9c90 with SMTP id f8-20020a056402194800b00546d4799c90mr69953edz.5.1700032092427; Tue, 14 Nov 2023 23:08:12 -0800 (PST) MIME-Version: 1.0 References: <20231031093921.755204-1-guanyulin@google.com> <3fe5414a-570f-4bfa-aa2f-909d7799551b@rowland.harvard.edu> In-Reply-To: <3fe5414a-570f-4bfa-aa2f-909d7799551b@rowland.harvard.edu> From: Guan-Yu Lin Date: Wed, 15 Nov 2023 15:08:01 +0800 Message-ID: Subject: Re: [PATCH] rpm: pm: enable PM_RPM_EXCEPTION config flag To: Alan Stern Cc: "Rafael J. Wysocki" , gregkh@linuxfoundation.org, len.brown@intel.com, pavel@ucw.cz, heikki.krogerus@linux.intel.com, mkl@pengutronix.de, hadess@hadess.net, mailhol.vincent@wanadoo.fr, ivan.orlov0322@gmail.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, pumahsu@google.com, raychi@google.com, albertccwang@google.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 14 Nov 2023 23:08:23 -0800 (PST) On Wed, Nov 8, 2023 at 11:56=E2=80=AFPM Alan Stern wrote: > > On Wed, Nov 08, 2023 at 04:45:43PM +0800, Guan-Yu Lin wrote: > > Thanks for the questions. Let me first introduce my motivation for > > proposing this feature. We can discuss the implementation details later= . > > > > Motivation: > > Currently, system PM operations always override runtime PM operations. > > As runtime PM reflects the power status of devices, there is a > > possibility that runtime PM states that a device is in use, but system > > PM decides to suspend it. Up to now, we have assumed that a device can'= t > > function without resources from the system, so the device should acquir= e > > a wakelock to prevent this from happening. However, what if the device > > [From the fact that you mention wakelocks, I assume that you're trying > to implement something for Android systems rather than Linux systems > in general.] > > > does not need the system's support to function? Or only needs limited > > resources (e.g., only limited power source or clock) to function? In th= is > > situation, we would like to keep the device on but allow the system to > > suspend. This is an example where we would like devices to follow runti= me > > PM rather than system PM. > > To put it more simply, you want a way to leave some devices in an active > state while the rest of the system is suspended. It's not clear why you > have dragged runtime PM into the discussion (apart from the obvious fact > that you won't want to keep a device active if it isn't active already). > The determination of which device should remain active when the system suspends can be based on various factors. One straightforward approach is to consider the device's runtime pm state. Alternatively, we could explore more elaborate techniques that consider additional criteria. > This sounds like a major change, not something to be done with a simple > override. You should discuss it with Rafael Wysocki and the linux-pm > mailing list before trying to implement anything. > > > Feature Supported: > > 1. Devices could control the priority of system PM and runtime PM durin= g > > runtime. > > This seems like a totally unnecessary side issue. Forget about runtime > PM for the time being and concentrate instead on which devices you want > to keep active. > > > 2. The control should be at the device level, meaning that different > > devices should control their own priorities. > > > > Goal of This Patch: > > 1. Design a framework to support features above. > > 2. Apply it into usb for demonstration. > > You may find that it is easier (and less work in the long run) to design > the general framework and get it working than to concentrate on one > particular subsystem. > > Alan Stern The big picture is "a way to leave some devices in an active state while the rest of the system is suspended", I think it could be separated into: (1) Each system should be able to choose which device(s) is included in this feature. (2) For devices chosen in (1), each of them should have the flexibility to determine when it will not suspend with the system, not just always being active when the system suspends. Regards, Guan-Yu