Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1859738rbb; Tue, 27 Feb 2024 03:42:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUu8UnJ3nxX+sOMzesQWmaeKKrk3f/1UkYc6pnm05KbZDT1um2KhJfyuLz4WIE5PJN2DnibESSwvyECy+dR+L3gLLnqOb6QtamLeYVXMA== X-Google-Smtp-Source: AGHT+IGi1z9Mbgb8Ish2SNwB9+3qDQM31hQCEF1pGJQ+I6IVwe+0L84D7Bz8YyqcgU9PIZxnjTxS X-Received: by 2002:a05:6a00:1388:b0:6e5:3b85:d025 with SMTP id t8-20020a056a00138800b006e53b85d025mr2095248pfg.19.1709034129148; Tue, 27 Feb 2024 03:42:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709034129; cv=pass; d=google.com; s=arc-20160816; b=c2d64OLuYK+O2cdySE4ZSPH+qyrHzOCZPtxy9UnsWtuibHDfd9qwV8yDHZ1b546GUj aZ6yl459xMOfc3N4+Km9oC59VkqV7FMA8lPmVtO23rjC6dBZpAhcWYYqrHFS/jXJKzXf nhmKIpoeDMZS7YPslSrzlBj1K1aa1YT89wmKzQq1ZEivGmZeamjb2KpOEoLqO+s85L1s M4Mz9c6Muj2RyyK2gvXeBiAXBadrdU9jJqDvAmwp31sZ/nAoZKZG8IoooQgSbwm8J29f ueUIf7G4Q88uKJMcWdhHjfULYS8LCX4cMser/maCCSFMMlQoCfOTO3zlmkxY7hd7K/vI +1pQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=+5EZQgvYzf+Di85HQE8BTviHNfeUCSHk+RcP+d55ags=; fh=SExjuHwzGbazk4RKZR9RY2+sBwVM1fdScuII0U1BypY=; b=D71N9DqtXNksYhEkxAoCBojLtyxwl4t0kRjmorNobgcTdk1mD93AyqTFPzKb9XCVT4 IYpgdQLp8pIJD5TjHrZE4Xn5+Ftgv25YfCyIN8AoEjYH8bv3nCmi4bx6MyRfwh4uXGq0 vg4XSeszjK60ILUECz0iU3gGsqQy0W0Dz38H0h9DTwsjB39t0I8yW4jMHWSIaQqDitgw zChDnUQn+Rb186vrwXrtDfawjD6NuyOEthBEljwMHFd2G3UheFHgtObyCFJSAq6mO44n RKcwy3tczkt3vCrlk5OvBHxPgEquI7svB5TbQM+zyi2qoRhueRH2F+05NQllOUzZEHZ9 9jlg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-83125-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83125-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id u65-20020a637944000000b005dc81a16015si5301930pgc.118.2024.02.27.03.42.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 03:42:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83125-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-83125-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83125-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7D9FDB25010 for ; Tue, 27 Feb 2024 11:29:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A357213A266; Tue, 27 Feb 2024 11:28:47 +0000 (UTC) Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A75EB13A255; Tue, 27 Feb 2024 11:28:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709033327; cv=none; b=O2uNABVrjorLN7Iv+QqOgaabWmi1eOZ8O+BaokSsIZetVEvLX/5A4BPfEFuyu0OQZLLF5c5NEyTZPN//bVqH2pzG31x0Rgso/tmgzhs1tMPTbUAAeGAo91aOE6dS3XVyoz50VZ0tr22z6roCRDN01Yq2bq3/FZbId1GYwuTfM8Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709033327; c=relaxed/simple; bh=olawrkIf763TyDJBSdS+BMEVTPSM6dh0cJaug71x7i8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=kC7EUs2VMkSA2eY4CKzotyZfEDLnzLHJYA8OPDY10vsgs5S75uv3HCGJKHKTS7VRD+OXm/pgvry6cboVb512B65dn5WgvRsgorhVOL/M1CpcZySrVf4A+THNrWL/K7BWOaGTKeF+MdwtN7ZYp8yRiD7++eIrKJwqUMMnN1CuHAo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.210.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-f53.google.com with SMTP id 46e09a7af769-6e45f7c63f4so380083a34.1; Tue, 27 Feb 2024 03:28:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709033325; x=1709638125; 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=+5EZQgvYzf+Di85HQE8BTviHNfeUCSHk+RcP+d55ags=; b=EgccJp2U8MEvUZuWMPKGpkkJH7aWu2fYDZArnCRYmQfkMk8wAv278rGIr7vwfwSR1U Cm76DLezNeX/ibuxw3OPUDeHHowpuoQaknUNxCyOPRzMGUa6hhPoWq3Eqscb5+xnitGg jTXaq5WsYS0pqKBKBNQtVEHNuPo7DxcK3brhitS/Bz66PwE1kxOixMebPSiKQZGpkF0O yiFZxV352cBC1fQB6ht3PBX1Eo8/JrzrmisyHXhARGMAcROM/N1qlWuRni5hnLYVuLfk 6EAf0BlqLjvANsLh7K7Vj+mn5I9AXfAbc7SNRejxiM3BqJjOdH7noMbl/L3rBm8r3bPS 2hFw== X-Forwarded-Encrypted: i=1; AJvYcCXzzpnMLauIr92x9/qDCTcAw9oPSOxnZ7lgcknflgQ5zqTKoo7Xi679BdtV+yHlTpWU62svbSgDhnFzccxTBuhU1lcW37pvF+ABlKw79DsKAZlinSLpHwRsTJPqp4jV0IdjZm9FDeA= X-Gm-Message-State: AOJu0Yw6ES5Q71Q/97knQ4sY/ANyfOPAkno4l7wgwwOpWb+zVxWif27s WnnoiLi2Dxksb8s6uuguiZAFzaQGwAS739qRcpcUjiaPeNlwXxBArD6K5uOWSqYFC1gTb2UmDfJ kPEHD+tQGEeQe/aMDvpnbpygh2mdw3lLb X-Received: by 2002:a05:6820:2b15:b0:5a0:396d:2489 with SMTP id dt21-20020a0568202b1500b005a0396d2489mr9336880oob.1.1709033324837; Tue, 27 Feb 2024 03:28:44 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240223143833.1509961-1-guanyulin@google.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Tue, 27 Feb 2024 12:28:33 +0100 Message-ID: Subject: Re: [PATCH v3] PM / core: conditionally skip system pm in device/driver model To: Guan-Yu Lin Cc: "Rafael J. Wysocki" , pavel@ucw.cz, len.brown@intel.com, gregkh@linuxfoundation.org, andriy.shevchenko@linux.intel.com, petr.tesarik.ext@huawei.com, rdunlap@infradead.org, james@equiv.tech, broonie@kernel.org, james.clark@arm.com, masahiroy@kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 26, 2024 at 10:45=E2=80=AFAM Guan-Yu Lin = wrote: > > On Sat, Feb 24, 2024 at 1:44=E2=80=AFAM Rafael J. Wysocki wrote: > > > > On Fri, Feb 23, 2024 at 3:38=E2=80=AFPM Guan-Yu Lin wrote: > > > > > > In systems with a main processor and a co-processor, asynchronous > > > controller management can lead to conflicts. One example is the main > > > processor attempting to suspend a device while the co-processor is > > > actively using it. To address this, we introduce a new sysfs entry > > > called "conditional_skip". This entry allows the system to selectivel= y > > > skip certain device power management state transitions. To use this > > > feature, set the value in "conditional_skip" to indicate the type of > > > state transition you want to avoid. Please review /Documentation/ABI= / > > > testing/sysfs-devices-power for more detailed information. > > > > > > Signed-off-by: Guan-Yu Lin > > > > Please explain how this is intended to work. That is, what exactly > > you expect to happen when the new attribute is set. > > The sysfs entry 'conditional_skip' for a device indicates which power > transitions (e.g. PM_EVENT_SUSPEND) are omitted within the system > power management flow. During the processing of an identified power > transition, the device's power.entry will not be added to the > dpm_prepared_list, preventing the device from undergoing that > transition. As 'conditional_skip' is modifiable at runtime, a device's > participation in system power management can be dynamically enabled or > disabled. So this idea is completely misguided AFAICS. First off, why would a device be skipped in system-wide suspend and not in hibernation? Or the other way around? Or why would it be skipped in one phase of hibernation and not in the other? Second, but not less important, why is skipping a device in system-wide transitions a good idea at all? What about dependencies between that device and the other devices in the system? Generally speaking, system-wide PM is designed to cover the entire system and there are good reasons for that. If you don't want it to cover the entire system, you cannot use it at all.