Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp27205iob; Wed, 27 Apr 2022 18:04:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxihywBIa3XOMqDZ7GjCS7Hz/Giut5kTkwvJX12Mu0GBIJ105OHKxSG6orfQl6/Qurwc3XF X-Received: by 2002:a63:2309:0:b0:398:d3fe:1c41 with SMTP id j9-20020a632309000000b00398d3fe1c41mr26278615pgj.131.1651107881792; Wed, 27 Apr 2022 18:04:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651107881; cv=none; d=google.com; s=arc-20160816; b=f11pr1z5YfzMa5ErGNHUkwA9+OwoqAofPVdoViPZHbE+REpRQ7KGkihD5qwy1qtwUL CkRm/pZpQW4PQXC2IZKyB3a/1UW/Q7xMHkrnISYXIMT55xhcw2EZuhTzw0+1gJMAYAt3 XNz7FumTWiDstrqklf3i43bhRYmoGJxCHJtDAjeQDKGgkFEgtvUJGv7A3v6iz+8ZJW/2 woePkGYg2ZTcY2XkifPqDwxEJXOfhH23TUoZmAVD87xZArtMuLe3aSSLshpr85AMpLIJ JTodt3B9amod2Ba0Ht3a7m4J60DUq4jE0ONsrWxIGRXU8G+47MKosZTvHo1EIfFExsTK cLuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:mime-version:date :message-id:dkim-signature; bh=94yAnil/mWXGxnxsscJ3F9D7WcwcWSNB3lXabrlOkE4=; b=akpUoW3Kw2/NBEHMMMdN6rnQJ/F6Dilel7aJtTypeQq414uYkgP3InuGEy3cBXQq19 8aNZjBaZvQh/wqB1SKgdgiegUfQTg1jEczqvut+2961HCkvuzDzNNwLYKh1BTmds7CBl o48FcDd7SEfBNloAHeTHqdnVtF5TyW52BQIm/yoB5h0fUvGWP9rRyMFRMgK+vDpSLdB6 3zmw+QaokCPVpc6ixHZOByKCUflVnIQ8uUDT7U+7WyTMl8A5+3BDyrWjicn1pbwCK7Jv q4Mh2e3nppob2VwxMDR0q3ObZe57vJ1rrP6Qh+SrP+bvavBt5xeg7THnnfESBQ0tcsxD vroA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P9m+UfRC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i9-20020a170902c94900b00153b2d1660csi3523090pla.532.2022.04.27.18.04.23; Wed, 27 Apr 2022 18:04:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P9m+UfRC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237328AbiD0U4J (ORCPT + 99 others); Wed, 27 Apr 2022 16:56:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236962AbiD0U4F (ORCPT ); Wed, 27 Apr 2022 16:56:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36BE781194; Wed, 27 Apr 2022 13:52:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DFC11B82A53; Wed, 27 Apr 2022 20:52:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74C48C385A9; Wed, 27 Apr 2022 20:52:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651092765; bh=v307TXmNX7Dq2c5DVdjkniPVMOiPiXk6sD1IgSoBwuk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=P9m+UfRC0IpQ/qL6+CZa0XyV1aGev8ss06l5wt3Yo2ywAQRD6OP06klVRAbABES23 N2Oi/mMC6KXz8eVr+GUoeKqkDgCD3YM+hptXm57Kaduc2pB5MwXp2P/shI0Nwr1ZL1 E08z7RTZdZxY1tyd/di4kcYEcLU5syNHhpzpn8fnNZT3ejRECInNUE98m+DgDZ91W6 /SOxVtJO58S/Xqw2Z5vIszx0U93UwjtzsZBk6V7liJHJ2sZEL4FrGIL1VqCZsgn+uU h5CZnWI1yyF0PeSvJNSnrWD/2HBEcDyY7HdbPu8A+o0iBz6/jEWHvn8wz0Ypms0rmb /qlh5sdvvsJGQ== Message-ID: <38149635-26ee-ab02-7c69-c5dd5f64fab5@kernel.org> Date: Wed, 27 Apr 2022 23:52:39 +0300 MIME-Version: 1.0 Subject: Re: [PATCH] interconnect: Restore sync state by ignoring ipa-virt in provider count Content-Language: en-US To: Alex Elder , Stephen Boyd Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, Bjorn Andersson , Doug Anderson , Taniya Das , Mike Tipton References: <20220427013226.341209-1-swboyd@chromium.org> From: Georgi Djakov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27.04.22 15:00, Alex Elder wrote: > 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 >> Cc: Doug Anderson >> Cc: Alex Elder >> Cc: Taniya Das >> Cc: Mike Tipton >> Fixes: 2fb251c26560 ("interconnect: qcom: sdx55: Drop IP0 interconnects") >> Fixes: 2f3724930eb4 ("interconnect: qcom: sc7180: Drop IP0 interconnects") >> Signed-off-by: Stephen Boyd > > So of_count_icc_providers() counts the number of > interconnect providers defined in the DTB, regardless > of whether anything in the code supports it. Yes, that's the case currently. There could be multiple provider drivers in different modules, and the modules may be loaded even not during boot, but later. So we rely on DT. Thanks, Georgi > 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 > > >> --- >>   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 >