Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp229670rdb; Fri, 5 Jan 2024 08:02:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IEhX5YuxM49UlolZXglURTZwTIKczv4MC+fFvdrCfEgICsTmO1Mm9Tn5o9CkAzEZC32rwoo X-Received: by 2002:a05:6214:1c4e:b0:67e:d89f:e392 with SMTP id if14-20020a0562141c4e00b0067ed89fe392mr2702753qvb.11.1704470544401; Fri, 05 Jan 2024 08:02:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704470544; cv=none; d=google.com; s=arc-20160816; b=0qXvSVy64vtuW+swziUKgSl+plyiKKGWclG155e20BfIYixNbqK9CP7bMCNaApYDaS V0+sT2gQsGv0nXS33rWdl4aA0sXS8YEqjKjpArfqXsDzTgO3ilIVtBPTj8H5Z6Qav5/g mdwFZoHVQ7BcYiw0cZPeLhc4CDTrpI8IMnmMbYlmwwy9s/06sht8cSgmYyi1qWG6iUlP ASkg7sW2CiHnrsRuuzF/UfjDud+bR9e81ecz1h01g1m1lAKUjpkQuofYoWvshx2D5zfK ++bh7GldxKjJtvj21k2X3ueoLsUx2jEhXOXH8Osn30u+rC671DGKUrtvub+uglN6O3jF T/nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=38V7OcbMS6BvfR/Kfa+Il7csYOikckmVIMPsPO2mrzc=; fh=4JOzqA2oEXpn9TNycEGFSXJdkZkrOrBHCApwJqYS1zo=; b=z7u7M004H5PA28cGYKzuIq445wkXpcAtZ6CNuSy7EBg/3cqw0LopIO1qu6ajEvk2Ei sUoXh+Sl47+SWNFQjgYepYAO1gB8X2jc+zB+qFeD+pnMRG3knIZMbS3fhFYU6FjCmazy Q0DnUbfmAVySVDUPVCu7tM6v0ddxJhzEIYnOhYpuVyVTsgnD4U4JBhUmBu8wlBhhUqpY RGYPFSjhCFEOu0Un1O09w/r2tpW8AMONcFj9pPNdWmkrZvIG2g5s7AaX55t/ccOXpL0R qPbbO4TDbohR1C72iqJISF6Os0Qo7vZudMioSjbQ47nRyLZJfYG8n+fpbVWwgg0L4FQa hKig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fJlfLXum; spf=pass (google.com: domain of linux-kernel+bounces-18031-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18031-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q2-20020a0c9a42000000b0067f17eac150si2047476qvd.108.2024.01.05.08.02.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 08:02:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18031-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fJlfLXum; spf=pass (google.com: domain of linux-kernel+bounces-18031-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18031-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 1751C1C2308F for ; Fri, 5 Jan 2024 16:02:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5CD17328BC; Fri, 5 Jan 2024 16:01:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="fJlfLXum" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (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 116A1321B8 for ; Fri, 5 Jan 2024 16:01:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-50e5a9bcec9so2191178e87.3 for ; Fri, 05 Jan 2024 08:01:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704470469; x=1705075269; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=38V7OcbMS6BvfR/Kfa+Il7csYOikckmVIMPsPO2mrzc=; b=fJlfLXumnbjgA414C++MQNqKxdkH44NbYoSiS9Z5CAyw+quyTvGAetTALDY9ma58At 1fLn6ZTPqKpmW3NC8CqORI1Lm2kw86STv6u2xFQNLw/lRzLn3a6v1TB3DFGv3rcKN+cL 4psuVWg4ouN3acZzD0E5Z77Dkx0AHZpmXa27ek4+P2zxCH2MnTH1QeGUbvCH0PnMeZb+ DSgbGO+57vpTY6KdAkYHLVt9mvLJq6rnXPzH2LLGh3xlyeygmGCZeXOODFdkVV8iH8w9 ptwjvbqfU5Qux2qbobg/KQoBZ9/ZsFJAAT7mdesYEfUIxEeL9CkQdyqYr7JPv5uoIt5G PLIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704470469; x=1705075269; 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=38V7OcbMS6BvfR/Kfa+Il7csYOikckmVIMPsPO2mrzc=; b=p1rDE45Qzu9C0sC2p34+jRSdrv92SiQZttg4YR5hRvM2TGyTJ8Vd+NZcCqN0Ux31yX h8cFstNhdyuMxQoD+q+lq21VCzbyOSiQG+kJEwjqbcw4Y6i+2ucWZteLQhLeesmTY0zS GBHrbUd0Bp+62ZvCSKQLPd4Y3+wyC0rYNTeLKxPFylTgnicRVf/+oZaxvz5HfE5NozFu KJFoPuYjIzvc269OQFcQEcInwa0SvNgsppOCYrYWcZue1oMFopOaoXqU1PhdS40Hc3De oGRe5tC0u2q5cw6wZ8NZOAWXXmJSaviHr3m5V7B3EgnVCh/RJMwQ0Cgrf+/wiOrS4V4T StmQ== X-Gm-Message-State: AOJu0YzDOzFc2jqqQ5b3cfEvV4h8cqgb2rve2iIIP/EVHusu41GTJTpl eYUzLdnu7zfIGe4JP5EXBj9y/JB7Wb+Zxg== X-Received: by 2002:a05:6512:2315:b0:50e:6ec3:6a42 with SMTP id o21-20020a056512231500b0050e6ec36a42mr1573154lfu.126.1704470469081; Fri, 05 Jan 2024 08:01:09 -0800 (PST) Received: from uffe-tuxpro14.. (h-178-174-189-39.A498.priv.bahnhof.se. [178.174.189.39]) by smtp.gmail.com with ESMTPSA id n5-20020a056512310500b0050e76978861sm262094lfb.277.2024.01.05.08.01.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 08:01:08 -0800 (PST) From: Ulf Hansson To: "Rafael J . Wysocki" , Greg Kroah-Hartman , Viresh Kumar , linux-pm@vger.kernel.org Cc: Ulf Hansson , Sudeep Holla , Kevin Hilman , Konrad Dybcio , Bjorn Andersson , Nikunj Kela , Prasad Sodagudi , Stephan Gerhold , Ben Horgan , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-remoteproc@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v2 0/5] PM: domains: Add helpers for multi PM domains to avoid open-coding Date: Fri, 5 Jan 2024 17:00:58 +0100 Message-Id: <20240105160103.183092-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Updates in v2: - Ccing Daniel Baluta and Iuliana Prodan the NXP remoteproc patches to requests help with testing. - Fixed NULL pointer bug in patch1, pointed out by Nikunj. - Added some tested/reviewed-by tags. Attaching/detaching of a device to multiple PM domains has started to become a common operation for many drivers, typically during ->probe() and ->remove(). In most cases, this has lead to lots of boilerplate code in the drivers. This series adds a pair of helper functions to manage the attach/detach of a device to its multiple PM domains. Moreover, a couple of drivers have been converted to use the new helpers as a proof of concept. Note 1) The changes in the drivers have only been compile tested, while the helpers have been tested along with a couple of local dummy drivers that I have hacked up to model both genpd providers and genpd consumers. Note 2) I was struggling to make up mind if we should have a separate helper to attach all available power-domains described in DT, rather than providing "NULL" to the dev_pm_domain_attach_list(). I decided not to, but please let me know if you prefer the other option. Note 3) For OPP integration, as a follow up I am striving to make the dev_pm_opp_attach_genpd() redundant. Instead I think we should move towards using dev_pm_opp_set_config()->_opp_set_required_devs(), which would allow us to use the helpers that $subject series is adding. Kind regards Ulf Hansson Ulf Hansson (5): PM: domains: Add helper functions to attach/detach multiple PM domains remoteproc: imx_dsp_rproc: Convert to dev_pm_domain_attach|detach_list() remoteproc: imx_rproc: Convert to dev_pm_domain_attach|detach_list() remoteproc: qcom_q6v5_adsp: Convert to dev_pm_domain_attach|detach_list() media: venus: Convert to dev_pm_domain_attach|detach_list() for vcodec drivers/base/power/common.c | 134 +++++++++++++++ drivers/media/platform/qcom/venus/core.c | 12 +- drivers/media/platform/qcom/venus/core.h | 7 +- .../media/platform/qcom/venus/pm_helpers.c | 48 ++---- drivers/remoteproc/imx_dsp_rproc.c | 82 +-------- drivers/remoteproc/imx_rproc.c | 73 +------- drivers/remoteproc/qcom_q6v5_adsp.c | 160 ++++++++---------- include/linux/pm_domain.h | 38 +++++ 8 files changed, 289 insertions(+), 265 deletions(-) -- 2.34.1