Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2639995rdh; Mon, 30 Oct 2023 03:30:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBhppFYS5QnNdKnca7krkHOYdzXQa5aBv6c6Cb7KuqHjk8rAHMJaYU8yOGIafezt8K/x8J X-Received: by 2002:a05:6a00:1387:b0:6bd:2c0a:e7d with SMTP id t7-20020a056a00138700b006bd2c0a0e7dmr11975260pfg.19.1698661815896; Mon, 30 Oct 2023 03:30:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698661815; cv=none; d=google.com; s=arc-20160816; b=n8epgpgmgeEf6gDk6QFyS/VzrR442wX/X3Szah0xz7wlu7lhMJ0D/GUM9vyxbLuKn7 LGF22oKB7XrliKmTykBubuhBhNV3iAwGG5m4J45inBppDw6dyO+sCWf4trvnrpYJSPeM CntfsF4F/YVguQeVC4MRPZ8b+FP10SXNZc41Z/Ccp21S/sv4rkvSSIApPpAUhakE8Gun GlgrFmyrUZK4jsW6MVNjtdrZpSqGkTQyFQtBid1OytpOznGRoaqqOHpDGSA2mq0TrgLh CoNHvIzLHFADpylIWTlK6Zj9T6OEf1sBNC22ljjd9CfII23n7XvEsXVJCPm0ysk0+7B/ pjxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xQ903xeVy9AHTb8iQsfsuNGoJuliVwNflrg4mGwSUpg=; fh=vUmwVhvnMyqAw2WQu+Bog2UleH0BB9PY7gQpXg8l5VA=; b=OjhJ0XVUD3UsbySWW2hQ1mkaHyTMJiw8TQNeBDOD4ao9X40Km5vnWLF23MYZ2+Cyfn KBlhnbNy3VTPGdfo4vwOPxmuzSqSt7TOQT6ZA+vykMzJuGQcdwZnclHafJa3O2EJnacS z9C1SWRSK/dKDUoGnaqWTcDq9uqMZGB2+tSdMC9wU4LZX9WX8iy4LdpXoHn5qmCX1Wg+ I89kO8nNL9gV3btT/eLtRDmc/S+uwphgyXx30CztcTMh5Nx8j7ph8LkQlVRKadZyS74z O7hOfzhoDWtjnhlzeG8ttOYilzPPlG32iZoIq2XRrY1BaPLfcKqeZdosByZl3bG4EF7S dp5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XaXwNxN5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id x8-20020a631708000000b005b928e3942csi4673023pgl.74.2023.10.30.03.30.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 03:30:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XaXwNxN5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 8B8B08063BFB; Mon, 30 Oct 2023 03:30:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232588AbjJ3K3z (ORCPT + 99 others); Mon, 30 Oct 2023 06:29:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231741AbjJ3K3u (ORCPT ); Mon, 30 Oct 2023 06:29:50 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E45A39E for ; Mon, 30 Oct 2023 03:29:47 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6b2018a11efso4265331b3a.0 for ; Mon, 30 Oct 2023 03:29:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698661787; x=1699266587; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=xQ903xeVy9AHTb8iQsfsuNGoJuliVwNflrg4mGwSUpg=; b=XaXwNxN5BAKfgACkpsi8UODdwRRu9pCDTCeDqeBNCs16ikE4nibXbbzGR2a1ht4Eh4 coJZZNURbMVzXGkjKGULTAA/1Az7UZtNWcK4a296hDJiHxP9NhdmorvuoI183MHe0LU9 TufSd2MfPxdAZKvu6fB872VUS73lTNUiJGeLMV3dzzxporuokW9LGPY2WRiXU2U6pMvV AQWVDRg/mBP+hHAs7h3ggIRXzKs0pUcCA0uji+1R1ktmJi461F08qTQwoI8x55UDPoU4 tC5DfSHom1TofIxcHEO8u/0djqALtDg/8dj22m591zQWW2ZsPJ6nYQOc0ZPZHZ4Afz9+ 0rhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698661787; x=1699266587; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xQ903xeVy9AHTb8iQsfsuNGoJuliVwNflrg4mGwSUpg=; b=HrcOxdxFInqxjTYGi8Z5fJCpOEGkzPMH2uEcxKhl2D2yloPORrhSqMR4uXGZG4FyyW Yk63aTyfeGFJdCjpUC4LNTISoIMoBeyBj0BITVQIAOAKlFCicTYMtXl+15L9qtRTsWAL a6FHG0tQZkAS/DN0B65dLLWxfdWxIfD126ppPjfUzUaa43E//p5pW17oRBIeot+7PJg3 2nDx6abxGD1nORzQMG6AuYcHFQSSYbADa44Jvd6Zu1zCFlpquLZGN/gJT8kxIfrAELE+ 85eMaivRTEUz4uvw1mE9ghAmP0S9idh6h/YPsRB4tgza+/uT2NJkBCogdj0H9CCnX9T3 c37w== X-Gm-Message-State: AOJu0YyORl6ZMnuPVx+lkZxK9BaH1qhLk9Fi6jh715JCY3MvQbVyLlSR dvPdcGGbZfzaBUba1SoQ98qAeg== X-Received: by 2002:a05:6a20:914a:b0:13f:9cee:ff42 with SMTP id x10-20020a056a20914a00b0013f9ceeff42mr11931773pzc.41.1698661787428; Mon, 30 Oct 2023 03:29:47 -0700 (PDT) Received: from localhost ([122.172.80.14]) by smtp.gmail.com with ESMTPSA id e26-20020a62aa1a000000b006c003d9897bsm5628756pff.138.2023.10.30.03.29.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 03:29:46 -0700 (PDT) Date: Mon, 30 Oct 2023 15:59:44 +0530 From: Viresh Kumar To: Ulf Hansson Cc: Stephan Gerhold , Viresh Kumar , Nishanth Menon , Stephen Boyd , linux-pm@vger.kernel.org, Vincent Guittot , "Rafael J. Wysocki" , Stephan Gerhold , Konrad Dybcio , Manivannan Sadhasivam , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] OPP: Use _set_opp_level() for single genpd case Message-ID: <20231030102944.nrw4bta467zxes5c@vireshk-i7> References: <20231025065458.z3klmhahrcqh6qyw@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 30 Oct 2023 03:30:11 -0700 (PDT) On 26-10-23, 11:53, Ulf Hansson wrote: > On Wed, 25 Oct 2023 at 15:49, Stephan Gerhold wrote: > > 2. The OPP WARNing triggers with both variants because it just checks > > if "required-opps" has a single entry. I guess we need extra checks > > to exclude the "parent genpd" case compared to the "OPP" case. > > > > [ 1.116244] WARNING: CPU: 2 PID: 36 at drivers/opp/of.c:331 _link_required_opps+0x180/0x1cc > > [ 1.125897] Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT) > > [ 1.146887] pc : _link_required_opps+0x180/0x1cc > > [ 1.146902] lr : _link_required_opps+0xdc/0x1cc > > [ 1.276408] Call trace: > > [ 1.283519] _link_required_opps+0x180/0x1cc > > [ 1.285779] _of_add_table_indexed+0x61c/0xd40 > > [ 1.290292] dev_pm_opp_of_add_table+0x10/0x18 > > [ 1.294546] of_genpd_add_provider_simple+0x80/0x160 > > [ 1.298974] cpr_probe+0x6a0/0x97c > > [ 1.304092] platform_probe+0x64/0xbc > > > > It does seem to work correctly, with and without this patch. So I guess > > another option might be to simply silence this WARN_ON(). :') > > Oh, thanks for pointing this out! This case haven't crossed my mind yet! > > Allow me to think a bit more about it. I will get back to you again > with a suggestion soon, unless Viresh comes back first. :-) I have resent the series now. Stephan, please give it a try again. Thanks. Regarding this case where a genpd's table points to a parent genpd's table via the required-opps, it is a bit tricky to solve and the only way around that I could think of is that someone needs to call dev_pm_opp_set_config() with the right device pointer, with that we won't hit the warning anymore and things will work as expected. In this case the OPP core needs to call dev_pm_domain_set_performance_state() for device and then its genpd. We need the right device pointers :( Ulf, also another important thing here is that maybe we would want the genpd core to not propagate the voting anymore to the parent genpd's ? The dev_pm_opp_set_opp() call is better placed at handling all things and not just the performance state, like clk, regulator, bandwidth and so the recursion should happen at OPP level only. For now my series shouldn't break anything, just that we will try to set performance state twice for the parent genpd, the second call should silently return as the target state should be equal to current state. -- viresh