From patchwork Wed Jun 21 14:40:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 13287421 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01484EB64D7 for ; Wed, 21 Jun 2023 14:40:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230369AbjFUOk1 (ORCPT ); Wed, 21 Jun 2023 10:40:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229903AbjFUOk0 (ORCPT ); Wed, 21 Jun 2023 10:40:26 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5EC71706 for ; Wed, 21 Jun 2023 07:40:24 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f866a3d8e4so6277943e87.0 for ; Wed, 21 Jun 2023 07:40:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687358423; x=1689950423; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=f2ZxKH/zYUyI3Fsx259m0wKdghaf8v8UuN2CsSCojAY=; b=XjrdzfFkuf4HVso51RDn3gGgScuQaf3nHVrfPPpb8Xveh/wYdDQliziltCfOK5yw9I vQQ4Ww4xfPaROY9UmCwZmikI6IXEbx6O9mQ1WDXD/ZseF+yZH5acwzxFoo0r2+Llmu4n mzg5O9TjnZUz6eLWAczaeEkW8fA6mVRObeuNOBzY9MqWDBYeg6HCUzb7/t43xFtUQ5ja ffa9/lOntyadCiPCa/J+yA1UFq8q8cXZHGsW26KX2CmCzX9wvoFhLAxVLiIvvFSXpKBs DDtD4ofIsKAAIv+Q9ibULUbRNiNI7qW66ihY3JauN9BFJvfI5rpJoeMi95/N+ILWi0gL zV9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687358423; x=1689950423; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=f2ZxKH/zYUyI3Fsx259m0wKdghaf8v8UuN2CsSCojAY=; b=GleaEOk30d99slnsDSFiJ9LIW7/yMb9k6ctIJvuJDSqrVthQqOEwOYPjQJ6pSJ+Bz9 pThSyJsmiL6K3rhTB3iDilr/pC5rLMnINnpVqqZPpMseaGlAu89TEBNeby48ankuSve8 xbjvBx0lGOf6Q35GtQNdmpgRk+HgdfwwJJbq05o0ZONz3nhr6NJBXpmFPowrgGBj2ysf rXSQtcCTeXHZRxI86ukQ34wOLVbEOmwAw5yT4muySCcRp8F/FMxGdRhNYf7RP+2sTlqp McLWmRc4Rzt+d6D6qwcRiRyRuU/XGGDoLrLz6QxGM1FyumOC/n1icrw/kR288zgatbsj IKpA== X-Gm-Message-State: AC+VfDzZUg0GTJ3rMz8p4blVYlKpT0Eo+JAzqKf4TbET/LVcYPQyjQuo YzvxcyfrJlHAkg2EK9DgbEaP+A== X-Google-Smtp-Source: ACHHUZ55sQz7tTRRQTIxG8rd38eQ5i49fPDzAYmbaSloiQvAWYhkbcIQm8DDi3G6dFFc5XocywuLtw== X-Received: by 2002:a19:5619:0:b0:4f8:6b7f:c6d6 with SMTP id k25-20020a195619000000b004f86b7fc6d6mr6434056lfb.48.1687358422922; Wed, 21 Jun 2023 07:40:22 -0700 (PDT) Received: from hackbox.lan ([82.79.124.17]) by smtp.gmail.com with ESMTPSA id l13-20020a056402344d00b0051879c4f598sm2689505edc.66.2023.06.21.07.40.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 07:40:22 -0700 (PDT) From: Abel Vesa To: "Rafael J . Wysocki" , Kevin Hilman , Ulf Hansson , Len Brown , Pavel Machek , Greg Kroah-Hartman , Saravana Kannan Cc: Bjorn Andersson , linux-pm@vger.kernel.org, Linux Kernel Mailing List , linux-arm-msm@vger.kernel.org, Dmitry Baryshkov Subject: [RFC PATCH v5 0/4] PM: domain: Support skiping disabling unused domains until sync state Date: Wed, 21 Jun 2023 17:40:15 +0300 Message-Id: <20230621144019.3219858-1-abel.vesa@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This new approach drops the is_off change that was part of v4. That was kind of beyond the scope of this patchset. This new approach changes the boot_keep_on in such a way that we won't need any kind of new locking for a PD. This involves using the patch [1] for adding dev_set_drv_sync_state from Saravana for allowing the genpd core to set a default sync state callback for a provider that doesn't register one by itself. While at it, we can add another such API but this time to query a device's sync state. Then, we filter out each power off request in such a way that if a boot powered on power domain is not attached to its consumer device and the provider has not state synced yet, the power off request is skipped. [1] https://lore.kernel.org/all/20210407034456.516204-2-saravanak@google.com/ No worth mentioning what changed since v4 as this version is almost entirely reworked. Abel Vesa (3): driver core: Add dev_is_drv_state_synced() PM: domains: Ignore power off request for enabled unused domains PM: domains: Add and set generic sync state callback Saravana Kannan (1): driver core: Add dev_set_drv_sync_state() drivers/base/power/domain.c | 72 +++++++++++++++++++++++++++++++++++++ include/linux/device.h | 26 ++++++++++++++ include/linux/pm_domain.h | 4 +++ 3 files changed, 102 insertions(+)