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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 153C4C433E7 for ; Tue, 20 Oct 2020 10:50:28 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 77A6C222C8 for ; Tue, 20 Oct 2020 10:50:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="J/0F43SM"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MOvMlkKI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 77A6C222C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XAyULboV6vNq1EmqzcYObSMOxaHe1Tk3f3SkjpiWLiI=; b=J/0F43SMIdtjcM+erT58Zaqb2 2TffV/BS7cOtDCn3Qb0hU4KbcyjXUO1q0nHPj73/5xZgzBWowXBaEfKp2zJq33pY1Q2fvNP+iWBIK 5QrTE03n2vfZog+AayQCjLFPoQSwEt/XiTENuG60d6Adgvt49PS3+kV7ZV6fblI8VYgAWbonTowF7 Vc5yLBv+/08rl1QtuaWR22gPtyw4oqyZ+1VzCQwEJHnjY8YtR+zWj3N6jxbMKFCzSQRGvYSiY4jA3 aeV3OileRCkAkoipaSqsitSjaZE24ridygHSl/6giOuYwYDnv0Z9EjMTZWSNYHw0B/ypZCrE5eWei 5qaqHdGnA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUpCL-0003Cb-Ck; Tue, 20 Oct 2020 10:48:57 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUpCJ-0003Bx-5K for linux-arm-kernel@lists.infradead.org; Tue, 20 Oct 2020 10:48:56 +0000 Received: by mail-pg1-x544.google.com with SMTP id g29so856566pgl.2 for ; Tue, 20 Oct 2020 03:48:54 -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=h3csrAd1jky9coyQEUbNeul9O9JSQ+GT/yRMQvwVlRM=; b=MOvMlkKIsU6yWtu6fAoRdXZqQmwKbFRGPzNPt7EIow+NWzRVTfWnoJMkb4id5xG+9Z nJdblopJrWREVTQzC32ssLnNCvh79+bgD+En93s6UUXb+cWsfU0QGVYDeTZokuWfucGM qaUkEcjKk9rAaiWSxQqqYAihvB9Q0Q6n3KfgFYr5qX47wDwxf57ddG7wNZIcKo0hgZTD FgV5+HWg3Xt5rTso+qIcJQvlWTLoAS7RczcRiyEP0L+Xn57EZ7VWWeY66OL8XSTqC5Zf Cjvc7mIId/NUeHFGu19k5Htu63MbgSNOGsL1GZdvCGJzHS4iB/t7g/YP55hjZ2ktX2wk 2s8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=h3csrAd1jky9coyQEUbNeul9O9JSQ+GT/yRMQvwVlRM=; b=EfBYBnZIkY7H1MCtnwmBivaGXduV0NFEIgXIC51vYli0ruarDjsAV8lXg6z4Y0ecXo VM6jEyC2Qg937bSqY5HllHpApqv/33oeuzqc7XQeyELXdevY1Ue4/Jn1a++3aJ7MZ/w4 RPUc7DPE3sFT7kdlbLlQvPdNej4E8mxerUF5eLoacX2QReE/RWy0+i+dEKdgOh5O3fT7 idoHesn+KGLzy4YTJLDQiAzSrwS920mOdpIYFav3GtjBKIwDmfQJ4ezHOsxPmkJpG85D L935hhm9w8AjV7NZeaCKStcxbFNV7RLPBV5pvPHakEwO8WR+ySx3b/Jo4m3TPpK0a2UK 4fIQ== X-Gm-Message-State: AOAM5312JZpj7kOLwvOr2gILsUdO8x4PZk/NIhDizFfnKXKpPkfOxqjp Y7Iuj98mJCrLIY5CBNk1vdFeXw== X-Google-Smtp-Source: ABdhPJyYDuvahYkU1IUub/PaLxmkTTPYqoYoyfGPonplDkCIKP9bIbjkkmWOPnvsvKP8u2DD0SQXww== X-Received: by 2002:a63:504b:: with SMTP id q11mr2076091pgl.17.1603190932800; Tue, 20 Oct 2020 03:48:52 -0700 (PDT) Received: from localhost ([122.181.54.133]) by smtp.gmail.com with ESMTPSA id b5sm1827560pgi.55.2020.10.20.03.48.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Oct 2020 03:48:51 -0700 (PDT) Date: Tue, 20 Oct 2020 16:18:49 +0530 From: Viresh Kumar To: Nicola Mazzucato Subject: Re: [PATCH v2 2/2] [RFC] CPUFreq: Add support for cpu-perf-dependencies Message-ID: <20201020104849.xh4prj4az5islmpt@vireshk-i7> References: <20201008150317.GB20268@arm.com> <56846759-e3a6-9471-827d-27af0c3d410d@arm.com> <20201009053921.pkq4pcyrv4r7ylzu@vireshk-i7> <20201012154915.GD16519@bogus> <20201012165219.GA3573@arm.com> <17819d4d-9e7e-9a38-4227-d0d10a0749f1@arm.com> <20201014042531.r7iykzygkvmpsqck@vireshk-i7> <503af305-77a4-964a-ed17-8df8b4e3a546@arm.com> <20201019094633.m3yvxurfm2xwsb6a@vireshk-i7> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-391-311a52 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201020_064855_205757_DEF721EE X-CRM114-Status: GOOD ( 35.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-pm@vger.kernel.org, vireshk@kernel.org, daniel.lezcano@linaro.org, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org, Sudeep Holla , chris.redpath@arm.com, Ionela Voinescu , morten.rasmussen@arm.com, Lukasz Luba Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 19-10-20, 14:36, Nicola Mazzucato wrote: > Hi Viresh, > > > On 10/19/20 10:46 AM, Viresh Kumar wrote: > > On 19-10-20, 09:50, Nicola Mazzucato wrote: > >> Hi Viresh, > >> > >> thank you for your suggestion on using 'opp-shared'. > >> I think it could work for most of the cases we explained earlier. > >> > >> Summarising, there are two parts of this entire proposal: > >> 1) where/how to get the information: now we are focusing on taking advantage of > >> 'opp-shared' within an empty opp table > >> 2) and how/where this information will be consumed > >> > >> Further details below: > >> > >> 1) a CPUFreq driver that takes the OPPs from firmware, can call > >> dev_pm_opp_of_get_sharing_cpus like you suggested. When doing so, a provided > >> cpumaksk will be populated with the corresponding cpus that share the same > >> (empty) table opp in DT. > >> All good so far. > > > > Great. > > > >> The current opp core is not expecting an empty table and therefore some errors > >> are thrown when this happens. > >> Since we are now allowing this corner-case, I am presenting below where I think > >> some minor corrections may be needed: > >> > >> --- a/drivers/opp/of.c > >> +++ b/drivers/opp/of.c > >> @@ static void _opp_table_alloc_required_tables(struct opp_table *opp_table, > >> struct device_node *required_np, *np; > >> int count, i; > >> > >> /* Traversing the first OPP node is all we need */ > >> np = of_get_next_available_child(opp_np, NULL); > >> if (!np) { > >> - dev_err(dev, "Empty OPP table\n"); > >> + dev_warn(dev, "Empty OPP table\n"); > >> + > >> + /* > >> + * With empty table we remove shared_opp. This is to leave the > >> + * responsibility to decide which opp are shared to the opp users > >> + */ > >> + opp_table->shared_opp = OPP_TABLE_ACCESS_EXCLUSIVE; > >> + > >> return; > >> } > >> > >> @@ int dev_pm_opp_of_find_icc_paths(struct device *dev, > >> int ret, i, count, num_paths; > >> struct icc_path **paths; > >> > >> ret = _bandwidth_supported(dev, opp_table); > >> - if (ret <= 0) > >> + if (ret == -EINVAL) > >> + return 0; /* Empty OPP table is a valid corner-case, let's not > >> fail */ > >> + else if (ret <= 0) > >> return ret; > >> > >> The above are not 'strictly' necessary to achieve the intended goal, but they > >> make clearer that an empty table is now allowed and not an error anymore. > >> What it is your point of view on this? > > > > Why is this stuff getting called in your case ? We shouldn't be trying > > to create an OPP table here and it should still be an error in the > > code if we are asked to parse an empty OPP table. > > A driver that gets a set of opp-points from f/w needs to add them to each > device. To do so, it will call dev_pm_opp_add(). If an opp_table struct for this > device is not found, one will be created and the opp-point will be added to it. > When allocation a new opp_table the opp will try to initialise it by parsing the > values in DT. It will also try to find_icc_paths. > > Everything happens silently if we don't have a table in DT. Right, you need something like your patch here. -- viresh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel