Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1236410rbb; Mon, 26 Feb 2024 03:16:13 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUCsxSe29nQLRiPrbnF4maxIo3u0PXteBePn/EZ56LjGQAklMyJ1YabIhOpNetq4P9dkdd3r9fl0C4Xi6DyTzGiyfm+gWF8xcv96PYESg== X-Google-Smtp-Source: AGHT+IG1HfmoZxCbISf5CEpCGRMt2alTIVyoczez9CowoLrQ/2KElPAiGHxxCp+qByeWu78qeu/2 X-Received: by 2002:a05:6a00:1d1c:b0:6e5:3cac:c939 with SMTP id a28-20020a056a001d1c00b006e53cacc939mr584348pfx.7.1708946173332; Mon, 26 Feb 2024 03:16:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708946173; cv=pass; d=google.com; s=arc-20160816; b=zESZ5jgWoiTWXXZ1iXKyD/F8LKoNflbtquySnHRzV0Sjr+S6NiH27884+qCEkZm9F0 4T6Bk5fF0fNykdX1A+V+7UJDMm2foDl0QulN03yHYIZcGNjyI8+PiL9e94tEZbkdUZr1 o1TDaB8u7E7cB3b1JzTH/TgxXIGsAMWfpmrRVrCtkXPDdT3dTWxOF4Hsz/VJhM9/9b/4 3y7OR1ShxVSVRk4PM61hUx7rQiximM/SF2AFTuznj0bMNRohxYrrHhm5lEUl3cso/wW7 nGB5Q3tQXfnN2f9GF9f+qYSN4mP+SvQUl+nTnqjN0haml8/KyaTtHrRaKKQFxkVZxYjM B3ng== 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:dkim-signature; bh=8rfRwBowmUFktKeSXXFXGsqMq0Ukd1jU9ormvR1IvtI=; fh=zeh0PDHM8/Fwh9vRpl1vyDMuyF8f5LvCxF2TqLUMOFU=; b=ARZ7m+4iHbhnEtQaATZ6Fwzi7OWbRJGLqAWaFKM1qpZIUvvrG/Z678ZddO0xziWIHw yF2SD+GmGQkzQ5wcivyCe8LUAeyQm3525KEZ6ZkLmyRjJUEBbHvWBq0YONhkTriXBBD1 ttpIyzlbaL3gJU1mMyuzQFDthToiG00lm2nQ+eYBe/yNXtXCzUZuJfE8mjXRCDiCIQbU SzET0g7yIxcqA328osVePBl9PQngaKUHbPvL98xzkV0mMYt244BN/9wU0l0G47qhwS6/ RVnpKCp7hPIPbgCyNBiQGHgNC3lULaMFFi29zAMD4TIScG8dtlplDEMhxZN/hNdbceSj Fbqw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=cKGIz79v; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-81161-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81161-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 22-20020a631556000000b005d8bea05154si3448139pgv.619.2024.02.26.03.16.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 03:16:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81161-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=cKGIz79v; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-81161-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81161-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 DFD6BB28B01 for ; Mon, 26 Feb 2024 10:36:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 810C3524D6; Mon, 26 Feb 2024 10:28:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="cKGIz79v" Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 E5B8A51C28 for ; Mon, 26 Feb 2024 10:28:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708943307; cv=none; b=c4PyshE39Hl8vsVWpL1g/k7BsZ/vyfgcnbStVDs4tVXAdD0U7NBrpIckAHnj5z1cvxBE6kaeusXrWBMMO1ah8LKgTLaS5Y4nwnVCLh7Dqf3W7szA0tAa+iDo4Fk7NxpxrXyKDYq3NBBNssoaJKQzUYcVWdPmg4k6GGGVPJ4GHR0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708943307; c=relaxed/simple; bh=waWe7OOZqahMFAXntvNTQ2+JkvgINPphRNC6W6LEW2I=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Y47CGJX0A38KSzWJj3lk30mriKbEHmaeCNN+Fg+KZSPvZF4Hhat8MkUTlGMT5AEeBkpIcSz9WrH0B1KzYZkT9SuH8VpyKXEyfWZhXZx4TN+iRHcJLKjKNefmJcfrENXG3228E0OkKMV+ej2RQjTYoK79c5e3Qc+KPpx7BgSQzMY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=cKGIz79v; arc=none smtp.client-ip=209.85.208.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5654ef0c61fso15335a12.0 for ; Mon, 26 Feb 2024 02:28:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708943304; x=1709548104; 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=8rfRwBowmUFktKeSXXFXGsqMq0Ukd1jU9ormvR1IvtI=; b=cKGIz79vMSfWFtztdJAsvWXoJQgfKaDkcdWPbQqeF6/rVwgDj+SI1+pobg7W55ac5y Jx/xDTaV3Yi4KZKhBCpsDI0coyxt+N9e3OFLu2xbtmJTsnJO40yqM8xK6PTTlxoHjWFu dRPjMtFbEDe4Ib0+jw1eJjXlpU/T/CcQ7NT3stDE/WVvjjnp83OcHO/rOafHhNYX5C4H XQH/xcZ3LVqL2o3hsStG4Tp6Ffz7GDGzDQvvCe4CjwshtKf2RnkaJGJ81K5eoMMf47O7 gdGAYmdiG8R64Laooiw/olWQVPYGNGWi+1n/65MtahwprUyPHFh2gPPKb1aKLRc54FWx dEpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708943304; x=1709548104; 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=8rfRwBowmUFktKeSXXFXGsqMq0Ukd1jU9ormvR1IvtI=; b=p1eiERZhh8DOI1FSya43Qq1HMVy8biOhqBGbwlZ7JOaKqq6rm9Kf3XJgOkonN4FvuR FhY2rvZ7iV9zvIlyc8kqI/aYPW/J7c+f6cTKBVC0ZNnYxQZlqhx2JlnDHO27bS7FQwQO qWS3PXziiXyVYQSbtsCnzlrLt73L4z5PvBm7MN0qlQwzXTMXA5Xk1h4fKEG309YnbXYt UVpYXAZHd64przPiP4OfgSzlhZr+iGlg8D6D2GT/ZwTWPPekiJVEWBSdOgLp8YipYFv2 f1Vk2fQ2TA1qOwpo+5mUg42M8juJetlYtqyGT08vbn3KbxeU4Hcli69HbAMGBWeNixqY 0M6g== X-Forwarded-Encrypted: i=1; AJvYcCXYj1+4R4UBHD/ZoE0j46J4gWEGjdARZjoX5DoAHQjUueeiEsc4vg1+jPe8KeBnem/F2FaBztjsibeI3schKYlW1mv9p1fipZCl/JmH X-Gm-Message-State: AOJu0Yx+WrGgRDAVJAcLOusFWA/22zjAo2zqhFzqylEhfVOgK5TCIXM6 qKpvHNNpIcmYHoerG+PCY6BF54dtVow+3SOs/IFs7fTIHJRc/0mSH5TFynhBUDfDt2bCMWjfpuZ RIXY3TWfg7pj2oqd8kqrtvWdpVjs/9nOpdZpN X-Received: by 2002:a05:6402:2693:b0:565:ad42:b97d with SMTP id w19-20020a056402269300b00565ad42b97dmr204645edd.0.1708943303993; Mon, 26 Feb 2024 02:28:23 -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: Guan-Yu Lin Date: Mon, 26 Feb 2024 18:28:00 +0800 Message-ID: Subject: Re: [PATCH v3] PM / core: conditionally skip system pm in device/driver model To: Florian Fainelli Cc: rafael@kernel.org, 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 Sat, Feb 24, 2024 at 2:20=E2=80=AFAM Florian Fainelli wrote: > > On 2/23/24 06:38, 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 selectively > > 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. > > This looks like a poor way of dealing with a lack of adequate resource > tracking from Linux on behalf of the co-processor(s) and I really do not > understand how someone is supposed to use that in a way that works. > > Cannot you use a HW maintained spinlock between your host processor and > the co-processor such that they can each claim exclusive access to the > hardware and you can busy-wait until one or the other is done using the > device? How is your partitioning between host processor owned blocks and > co-processor(s) owned blocks? Is it static or is it dynamic? > -- > Florian > This patch enables devices to selectively participate in system power transitions. This is crucial when multiple processors, managed by different operating system kernels, share the same controller. One processor shouldn't enforce the same power transition procedures on the controller =E2=80=93 another processor might be using it at that moment= . While a spinlock is necessary for synchronizing controller access, we still need to add the flexibility to dynamically customize power transition behavior for each device. And that's what this patch is trying to do. In our use case, the host processor and co-processor are managed by separate operating system kernels. This arrangement is static.