From patchwork Thu Jul 18 23:43:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 13736788 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1105BC3DA49 for ; Thu, 18 Jul 2024 23:45:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=X41EpoGFTr7V+lfPhB4bKmmLvKDngcfGjNQze8E5PAc=; b=c08ROwy+hLO78tqo+d1hwa8yHR 9mb1vZkmphWO3uai7Yzq/ECMcufOhHHWqkJV0ZVij5N2O+ydXWv614ZJXmSaCOBiBJjoiB54ZDxPC pB5hOdOo5VroFLIekvrqx+Qe5P5e8IWeSdL07Yj4XxrpvHDGik8IwonhNxtSqwZVhdzLO4+Dx9w5H zWLVnrMYymxIgWxLsGd6MnSwxNr8WQv0C6Pu+nAQusxG15RIVm36UJoSCllGVc7KyHQOoCyI5Z6la W6tzPO5kUFjX4wk1qc9IKH4In2r8xYv4XDrmX5+6Y8Kao8lYzv/BUE9qwlHgeenPpe2jkGpVpmhZm flXNtt4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sUaok-000000011sh-0XGg; Thu, 18 Jul 2024 23:45:46 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sUamb-00000001165-3NiA for linux-arm-kernel@lists.infradead.org; Thu, 18 Jul 2024 23:43:35 +0000 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-52e97e5a84bso1431674e87.2 for ; Thu, 18 Jul 2024 16:43:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721346212; x=1721951012; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=X41EpoGFTr7V+lfPhB4bKmmLvKDngcfGjNQze8E5PAc=; b=rREnCAriwiv9zru64OHoq4tt5ZNyoJqFxDH6i4Keq8zIFE3ABB9vf13Ar2lX7rYcpD bzFnPzVq2TihecFdGFiPwA4p3jbqlWqG9OrpmLYihP1AacV+Md4wUkYogNrawk8gROO2 njIlSiCJLqBcUhdABwkbWQjwfktpwPPLbipaqlLR+y40LLond788JeSpEcdvMkIZXTg3 ZTUg/L/iRGy9trpz71n7rpHaoG1A4yYLHThltHt0ndGMLf8CzVWFBx79/OFOYg7DJRon 2MhLjUMsb8wr47wVXuqWcLZZYFdibVgThpufzW0Mw0ak9b6V7QLyrVZvShg0YUZ6TZiw O7/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721346212; x=1721951012; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X41EpoGFTr7V+lfPhB4bKmmLvKDngcfGjNQze8E5PAc=; b=QU+l1E9J2WY2ftj5+9ni8pD4jvvi16GaDK70KPNoXW7r2mI006/TFFWscsnHK39IzR 91beWmrgWxQgS+F6Wi4Bp+mD76pcrU/ME438J8xEHSefDqqQTZ9aq11c67jCwWUmYUFE 6+UjuAqKHnX05UY8jqXtTGbXvG/ZbUkwe87PSZcmQQHTkh5VyilWmqg9UVILy8IJvtYJ U1HycPFRgieFbWYxLnPV5GeTalXDpb8ZkAnarWM9NM2Wfipj+ubT6qebz4GY7LIkhV4H fay/LMyJYPbybvJDWloiqEn9tee9q5Ipu7z0Yyw4CpQOOr9d0wC7rSCpyD/Mf5FddtVm advQ== X-Forwarded-Encrypted: i=1; AJvYcCXxOLWgUV6DQzYXarhUEweKJxo6vR97yOEpqegIZx8oc1iRcjW0rSgPyTwybB6BYzHLZVKdmiG3xPe57LDvjsbCluJZdTG7kpuqWHsVjBUxIGh/jno= X-Gm-Message-State: AOJu0Yym6ft2ayXiVvdeP0piu264e51W3Q4N5krOD19vT6boEokuMn9y HJQdThNyKog9AKo37Wq0zJYa8cowwalPb11gHTeYrVTd9qBUBQmJxSNQ8XepH9c= X-Google-Smtp-Source: AGHT+IE9TgIAs0CUhULlnfsv1TaESmkfsLC57MT/HQS4rq5Rt9A4FzXWOTcdoX2vwlTRiyP6cV3eIQ== X-Received: by 2002:a05:6512:3a87:b0:52c:dd94:bda9 with SMTP id 2adb3069b0e04-52ee5452793mr5704184e87.56.1721346212081; Thu, 18 Jul 2024 16:43:32 -0700 (PDT) Received: from uffe-tuxpro14.. (h-178-174-189-39.A498.priv.bahnhof.se. [178.174.189.39]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52ef556b4fbsm22491e87.139.2024.07.18.16.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 16:43:31 -0700 (PDT) From: Ulf Hansson To: Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Bjorn Andersson , Konrad Dybcio , Nikunj Kela , Prasad Sodagudi , Thierry Reding , Jonathan Hunter , Ulf Hansson , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/6] OPP: Drop redundant code in _link_required_opps() Date: Fri, 19 Jul 2024 01:43:19 +0200 Message-Id: <20240718234319.356451-7-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240718234319.356451-1-ulf.hansson@linaro.org> References: <20240718234319.356451-1-ulf.hansson@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240718_164333_871661_B15D9912 X-CRM114-Status: GOOD ( 20.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Due to that the required-devs for the required OPPs are now always being assigned during the attach process in genpd, we no longer need the special treatment in _link_required_opps() for the single PM domain case. Let's therefore drop it. Signed-off-by: Ulf Hansson --- Changes in v2: - New patch. --- drivers/opp/of.c | 39 +++------------------------------------ 1 file changed, 3 insertions(+), 36 deletions(-) diff --git a/drivers/opp/of.c b/drivers/opp/of.c index 55c8cfef97d4..fd5ed2858258 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -295,7 +295,7 @@ void _of_clear_opp(struct opp_table *opp_table, struct dev_pm_opp *opp) of_node_put(opp->np); } -static int _link_required_opps(struct dev_pm_opp *opp, struct opp_table *opp_table, +static int _link_required_opps(struct dev_pm_opp *opp, struct opp_table *required_table, int index) { struct device_node *np; @@ -313,39 +313,6 @@ static int _link_required_opps(struct dev_pm_opp *opp, struct opp_table *opp_tab return -ENODEV; } - /* - * There are two genpd (as required-opp) cases that we need to handle, - * devices with a single genpd and ones with multiple genpds. - * - * The single genpd case requires special handling as we need to use the - * same `dev` structure (instead of a virtual one provided by genpd - * core) for setting the performance state. - * - * It doesn't make sense for a device's DT entry to have both - * "opp-level" and single "required-opps" entry pointing to a genpd's - * OPP, as that would make the OPP core call - * dev_pm_domain_set_performance_state() for two different values for - * the same device structure. Lets treat single genpd configuration as a - * case where the OPP's level is directly available without required-opp - * link in the DT. - * - * Just update the `level` with the right value, which - * dev_pm_opp_set_opp() will take care of in the normal path itself. - * - * There is another case though, where a genpd's OPP table has - * required-opps set to a parent genpd. The OPP core expects the user to - * set the respective required `struct device` pointer via - * dev_pm_opp_set_config(). - */ - if (required_table->is_genpd && opp_table->required_opp_count == 1 && - !opp_table->required_devs[0]) { - /* Genpd core takes care of propagation to parent genpd */ - if (!opp_table->is_genpd) { - if (!WARN_ON(opp->level != OPP_LEVEL_UNSET)) - opp->level = opp->required_opps[0]->level; - } - } - return 0; } @@ -370,7 +337,7 @@ static int _of_opp_alloc_required_opps(struct opp_table *opp_table, if (IS_ERR_OR_NULL(required_table)) continue; - ret = _link_required_opps(opp, opp_table, required_table, i); + ret = _link_required_opps(opp, required_table, i); if (ret) goto free_required_opps; } @@ -391,7 +358,7 @@ static int lazy_link_required_opps(struct opp_table *opp_table, int ret; list_for_each_entry(opp, &opp_table->opp_list, node) { - ret = _link_required_opps(opp, opp_table, new_table, index); + ret = _link_required_opps(opp, new_table, index); if (ret) return ret; }