From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 466C0C433F5 for ; Thu, 14 Oct 2021 06:56:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A08560D07 for ; Thu, 14 Oct 2021 06:56:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229622AbhJNG6p (ORCPT ); Thu, 14 Oct 2021 02:58:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbhJNG6n (ORCPT ); Thu, 14 Oct 2021 02:58:43 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E3E8C06174E for ; Wed, 13 Oct 2021 23:56:39 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id q5so4621880pgr.7 for ; Wed, 13 Oct 2021 23:56:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ElQNmzsxcV0CPmY8lvOg8SstMmCe+niXLKtqIMPRzlc=; b=Xp5UvWAIJv0+50PGfjRILQj/4/m2mfb9EUgCxvcD+M7fvKZBW3ScvNqMtwYsIBUolx amwkMgIcTtK444A6G5yuXtwsK0LfRQaiW8On3gx2OrterEklOFlmopltMMiLERqADDeP YodOx0s0JroK/EqhGJxBmfIhAc/Dsrs2dDmo6+RGW1HWNO+NtZd5dhw056LK+ZDA4BUo aexhlv7+hP84yByZj4zkeDEzgJPYOkjmJA5VDaYpIztTS/5AkoWO8af4x80fBBYTMbSA q1kvSHyhxw+2NQizDfbXkDoWawxzEr0v42mukXgU8EEAunkIDOjMXYOp4fAqAo0ZaaVP gkvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ElQNmzsxcV0CPmY8lvOg8SstMmCe+niXLKtqIMPRzlc=; b=dmzovz04AQ3Q5aklnxPro3K+Tcs2cyniKFNSLM3pluS9Z4OE/609Vd/Z2ZKWvc3VL0 byirc8CZGo6nhiXPfvsNayqbP0ZziUBxjaS5uDDEuzpDCOPRkFcB6tZfB9/U10Naa37s 9XkdOnM2vRFsCx/2xyhVG4TF+yZmiJiwBJoCM3PY4H/YA2z3Ge86oeIQZUs0K6TeOqv0 i/iI8gbK2SH9sp4KG3fN2bmBJcFulc8lKXAjeIv41uFY+CFtY6bnxleeEU48KGe2cRmK +qhPB9bvDkgdZXIWf+gm3KSs5uJPgHb4c2GmXLk7B3rG6yIsSbBJ5PZ72BilduCV3QDB 1I8Q== X-Gm-Message-State: AOAM532lvtAzBDg8frwlf6pkqECMI92wvVs+VRlTkNZHtWxGP/OX7oHK BAZS/LiJVDJkxkrmoPpMN1DznQ== X-Google-Smtp-Source: ABdhPJwVIm0nmI+e9hjedM+iJOgP7Bo19ctF0+0OahszYFIkHTFSCY/vLqLX9TFlcadPSMGBhvfjlQ== X-Received: by 2002:a65:6187:: with SMTP id c7mr2918324pgv.317.1634194598786; Wed, 13 Oct 2021 23:56:38 -0700 (PDT) Received: from localhost ([106.201.113.61]) by smtp.gmail.com with ESMTPSA id j12sm1427294pff.127.2021.10.13.23.56.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 23:56:38 -0700 (PDT) Date: Thu, 14 Oct 2021 12:26:36 +0530 From: Viresh Kumar To: Ulf Hansson , Hector Martin Cc: Sibi Sankar , Saravana Kannan , linux-arm-kernel@lists.infradead.org, Alyssa Rosenzweig , Sven Peter , Marc Zyngier , Mark Kettenis , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Viresh Kumar , Nishanth Menon , Catalin Marinas , "Rafael J. Wysocki" , Kevin Hilman , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 4/9] opp: core: Don't warn if required OPP device does not exist Message-ID: <20211014065636.lkv77aqbugp3qhif@vireshk-i7> References: <20211011165707.138157-1-marcan@marcan.st> <20211011165707.138157-5-marcan@marcan.st> <20211012032144.2ltlpat7orrsyr6k@vireshk-i7> <20211012055143.xmkbvhbnolspgjin@vireshk-i7> <20211012092603.lkmhhjoo5v67wh44@vireshk-i7> <049FC437-EC38-4FE5-891E-5E25960892CF@marcan.st> <20211012093252.hb6rlcpxv5bmk7n3@vireshk-i7> <0db8e994-ac2c-8fad-55d0-1b5a9e2e21f2@marcan.st> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0db8e994-ac2c-8fad-55d0-1b5a9e2e21f2@marcan.st> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14-10-21, 15:52, Hector Martin wrote: > The CPU devices aren't attached to their genpd, so the required OPP > transition fails with the same error. > > However, this was easier to fix than I expected. With this patch to > cpufreq-dt, it all works properly, and I can drop the parent genpd > from the clock node and related handling. Thoughts? > > commit c4f88743374c1f4678ee7f17fb6cae30ded9ed59 > Author: Hector Martin > Date: Thu Oct 14 15:47:45 2021 +0900 > > cpufreq: dt: Attach CPU devices to power domains > This allows the required-opps mechanism to work for CPU OPP tables, > triggering specific OPP levels in a parent power domain. > Signed-off-by: Hector Martin > > diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c > index 8fcaba541539..5b22846b557d 100644 > --- a/drivers/cpufreq/cpufreq-dt.c > +++ b/drivers/cpufreq/cpufreq-dt.c > @@ -16,6 +16,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -264,6 +265,16 @@ static int dt_cpufreq_early_init(struct device *dev, int cpu) > goto out; > } > + /* > + * Attach the CPU device to its genpd domain (if any), to allow OPP > + * dependencies to be satisfied. > + */ > + ret = genpd_dev_pm_attach(cpu_dev); > + if (ret <= 0) { > + dev_err(cpu_dev, "Failed to attach CPU device to genpd\n"); > + goto out; > + } > + Other platform do this from some other place I think. Ulf, where should this code be moved ? cpu-clk driver ? -- viresh