Linux Power Management development
 help / color / mirror / Atom feed
From: Alex Elder <elder@linaro.org>
To: Stephen Boyd <swboyd@chromium.org>, Georgi Djakov <djakov@kernel.org>
Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev,
	linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Doug Anderson <dianders@chromium.org>,
	Taniya Das <quic_tdas@quicinc.com>,
	Mike Tipton <quic_mdtipton@quicinc.com>
Subject: Re: [PATCH] interconnect: Restore sync state by ignoring ipa-virt in provider count
Date: Wed, 27 Apr 2022 07:00:40 -0500	[thread overview]
Message-ID: <fb1f9a17-9b27-b0ac-124d-66644851e204@linaro.org> (raw)
In-Reply-To: <20220427013226.341209-1-swboyd@chromium.org>

On 4/26/22 8:32 PM, Stephen Boyd wrote:
> Ignore compatible strings for the IPA virt drivers that were removed in
> commits 2fb251c26560 ("interconnect: qcom: sdx55: Drop IP0
> interconnects") and 2f3724930eb4 ("interconnect: qcom: sc7180: Drop IP0
> interconnects") so that the sync state logic can kick in again.
> Otherwise all the interconnects in the system will stay pegged at max
> speeds because 'providers_count' is always going to be one larger than
> the number of drivers that will ever probe on sc7180 or sdx55. This
> fixes suspend on sc7180 and sdx55 devices when you don't have a
> devicetree patch to remove the ipa-virt compatible node.
> 
> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> Cc: Doug Anderson <dianders@chromium.org>
> Cc: Alex Elder <elder@linaro.org>
> Cc: Taniya Das <quic_tdas@quicinc.com>
> Cc: Mike Tipton <quic_mdtipton@quicinc.com>
> Fixes: 2fb251c26560 ("interconnect: qcom: sdx55: Drop IP0 interconnects")
> Fixes: 2f3724930eb4 ("interconnect: qcom: sc7180: Drop IP0 interconnects")
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>

So of_count_icc_providers() counts the number of
interconnect providers defined in the DTB, regardless
of whether anything in the code supports it.

This seems to be a more general problem, but I
suppose in practice it's not likely to occur.

I think your solution looks fine, but I'm interested
in what Georgi has to say.

Reviewed-by: Alex Elder <elder@linaro.org>


> ---
>   drivers/interconnect/core.c | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
> index 9050ca1f4285..c52915a58b22 100644
> --- a/drivers/interconnect/core.c
> +++ b/drivers/interconnect/core.c
> @@ -1087,9 +1087,15 @@ static int of_count_icc_providers(struct device_node *np)
>   {
>   	struct device_node *child;
>   	int count = 0;
> +	const struct of_device_id ignore_list[] = {
> +		{ .compatible = "qcom,sc7180-ipa-virt" },
> +		{ .compatible = "qcom,sdx55-ipa-virt" },
> +		{}
> +	};
>   
>   	for_each_available_child_of_node(np, child) {
> -		if (of_property_read_bool(child, "#interconnect-cells"))
> +		if (of_property_read_bool(child, "#interconnect-cells") &&
> +		    likely(!of_match_node(ignore_list, child)))
>   			count++;
>   		count += of_count_icc_providers(child);
>   	}
> 
> base-commit: 2fb251c265608636fc961b7d38e1a03937e57371


  reply	other threads:[~2022-04-27 12:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27  1:32 [PATCH] interconnect: Restore sync state by ignoring ipa-virt in provider count Stephen Boyd
2022-04-27 12:00 ` Alex Elder [this message]
2022-04-27 20:52   ` Georgi Djakov
2022-04-29 18:52     ` Alex Elder
2022-04-27 14:35 ` Doug Anderson
2022-05-02 15:18 ` Nathan Chancellor
2022-05-03 19:07   ` Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fb1f9a17-9b27-b0ac-124d-66644851e204@linaro.org \
    --to=elder@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=dianders@chromium.org \
    --cc=djakov@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=quic_mdtipton@quicinc.com \
    --cc=quic_tdas@quicinc.com \
    --cc=swboyd@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox