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, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, 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 6AEEDC4167B for ; Wed, 9 Dec 2020 09:42:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2234123B81 for ; Wed, 9 Dec 2020 09:42:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728777AbgLIJmP (ORCPT ); Wed, 9 Dec 2020 04:42:15 -0500 Received: from foss.arm.com ([217.140.110.172]:60134 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbgLIJmP (ORCPT ); Wed, 9 Dec 2020 04:42:15 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2C3F21FB; Wed, 9 Dec 2020 01:41:29 -0800 (PST) Received: from bogus (unknown [10.57.54.168]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2B1E13F718; Wed, 9 Dec 2020 01:41:26 -0800 (PST) Date: Wed, 9 Dec 2020 09:41:21 +0000 From: Sudeep Holla To: Viresh Kumar Cc: Nicola Mazzucato , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, rjw@rjwysocki.net, vireshk@kernel.org, robh+dt@kernel.org, sboyd@kernel.org, nm@ti.com, daniel.lezcano@linaro.org, morten.rasmussen@arm.com, chris.redpath@arm.com Subject: Re: [PATCH v4 3/4] scmi-cpufreq: get opp_shared_cpus from opp-v2 for EM Message-ID: <20201209094121.b6jloegdzpmcphqz@bogus> References: <20201202172356.10508-1-nicola.mazzucato@arm.com> <20201202172356.10508-4-nicola.mazzucato@arm.com> <20201208055053.kggxw26kxtnpneua@vireshk-i7> <0e4d3134-f9b2-31fa-b454-fb30265a80b5@arm.com> <20201208072611.ptsqupv4y2wybs6p@vireshk-i7> <20201208112008.niesjrunxq2jz3kt@bogus> <20201209054502.ajomw6glcxx5hue2@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201209054502.ajomw6glcxx5hue2@vireshk-i7> User-Agent: NeoMutt/20171215 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 09, 2020 at 11:15:02AM +0530, Viresh Kumar wrote: > On 08-12-20, 11:20, Sudeep Holla wrote: > > It is because of per-CPU vs per domain drama here. Imagine a system with > > 4 CPUs which the firmware puts in individual domains while they all are > > in the same perf domain and hence OPP is marked shared in DT. > > > > Since this probe gets called for all the cpus, we need to skip adding > > OPPs for the last 3(add only for 1st one and mark others as shared). > > Okay and this wasn't happening before this series because the firmware > was only returning the current CPU from scmi_get_sharing_cpus() ? > > Is this driver also used for the cases where we have multiple CPUs in > a policy ? Otherwise we won't be required to call > dev_pm_opp_set_sharing_cpus(). > > So I assume that we want to support both the cases here ? > Yes indeed, completely depends on what granularity firmware provides the performance control. It could be individual CPUs, could be pair of CPUs (or all the threads in the core) or subset of CPUs in the performance domain. The subset could be full set. > > If we attempt to add OPPs on second cpu probe, it *will* shout as duplicate > > OPP as we would have already marked it as shared table with the first cpu. > > Am I missing anything ? I suggested this as Nicola saw OPP duplicate > > warnings when he was hacking up this patch. > > The common stuff (for all the CPUs) is better moved to probe() in this > case, instead of the ->init() callback. Otherwise it will always be > messy. You can initialize the OPP and cpufreq tables in probe() > itself, save the pointer somewhere and then just use it here in > ->init(). > > Also do EM registration from there. > Makes sense. -- Regards, Sudeep 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 5C320C433FE for ; Wed, 9 Dec 2020 09:42:56 +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 EED7A233FA for ; Wed, 9 Dec 2020 09:42:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EED7A233FA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com 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=yKxxvzIk9ZH9Gl8R6y0+PmVMi56vEjm0xMj7l7wXoTI=; b=LTMeZEaIBF4MCoD3YASgV9Wxk g3Rk0iK/KOFO8pZkpNZTzU7CO37OcHXZurLM7nm7YHXGeniaSMgRtkMzBLkX0cnQC30BbH6voeYrH RdAnVdYzSpwMKDBYqiR400VXVsbmKnm/9A48iwEGcymtGY61Y59akXzq8Dd17I9S4Cfh+7SHf06Hs yn5jL3n5cx+GRc/3DkX7FQeXxWe/lS0ylEzOOnvsM9Jlzrh78vjcOZDjlUdIm/rm/IsPChlSTPDxI Nx6Za/qfer4NoUPr2oADftB4RatKRukWcuuHxVCjnLCWy2/BXli1Vk63ew7JFxbA1CNawtWFxnVgc x8TGNlDLg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmvyZ-0004r9-7r; Wed, 09 Dec 2020 09:41:35 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmvyV-0004qj-P3 for linux-arm-kernel@lists.infradead.org; Wed, 09 Dec 2020 09:41:32 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2C3F21FB; Wed, 9 Dec 2020 01:41:29 -0800 (PST) Received: from bogus (unknown [10.57.54.168]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2B1E13F718; Wed, 9 Dec 2020 01:41:26 -0800 (PST) Date: Wed, 9 Dec 2020 09:41:21 +0000 From: Sudeep Holla To: Viresh Kumar Subject: Re: [PATCH v4 3/4] scmi-cpufreq: get opp_shared_cpus from opp-v2 for EM Message-ID: <20201209094121.b6jloegdzpmcphqz@bogus> References: <20201202172356.10508-1-nicola.mazzucato@arm.com> <20201202172356.10508-4-nicola.mazzucato@arm.com> <20201208055053.kggxw26kxtnpneua@vireshk-i7> <0e4d3134-f9b2-31fa-b454-fb30265a80b5@arm.com> <20201208072611.ptsqupv4y2wybs6p@vireshk-i7> <20201208112008.niesjrunxq2jz3kt@bogus> <20201209054502.ajomw6glcxx5hue2@vireshk-i7> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201209054502.ajomw6glcxx5hue2@vireshk-i7> User-Agent: NeoMutt/20171215 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201209_044131_876387_4236DEE0 X-CRM114-Status: GOOD ( 21.93 ) 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: nm@ti.com, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, sboyd@kernel.org, vireshk@kernel.org, daniel.lezcano@linaro.org, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, robh+dt@kernel.org, Nicola Mazzucato , chris.redpath@arm.com, morten.rasmussen@arm.com, linux-arm-kernel@lists.infradead.org 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 Wed, Dec 09, 2020 at 11:15:02AM +0530, Viresh Kumar wrote: > On 08-12-20, 11:20, Sudeep Holla wrote: > > It is because of per-CPU vs per domain drama here. Imagine a system with > > 4 CPUs which the firmware puts in individual domains while they all are > > in the same perf domain and hence OPP is marked shared in DT. > > > > Since this probe gets called for all the cpus, we need to skip adding > > OPPs for the last 3(add only for 1st one and mark others as shared). > > Okay and this wasn't happening before this series because the firmware > was only returning the current CPU from scmi_get_sharing_cpus() ? > > Is this driver also used for the cases where we have multiple CPUs in > a policy ? Otherwise we won't be required to call > dev_pm_opp_set_sharing_cpus(). > > So I assume that we want to support both the cases here ? > Yes indeed, completely depends on what granularity firmware provides the performance control. It could be individual CPUs, could be pair of CPUs (or all the threads in the core) or subset of CPUs in the performance domain. The subset could be full set. > > If we attempt to add OPPs on second cpu probe, it *will* shout as duplicate > > OPP as we would have already marked it as shared table with the first cpu. > > Am I missing anything ? I suggested this as Nicola saw OPP duplicate > > warnings when he was hacking up this patch. > > The common stuff (for all the CPUs) is better moved to probe() in this > case, instead of the ->init() callback. Otherwise it will always be > messy. You can initialize the OPP and cpufreq tables in probe() > itself, save the pointer somewhere and then just use it here in > ->init(). > > Also do EM registration from there. > Makes sense. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel