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 C57F2C43461 for ; Fri, 11 Sep 2020 14:41:59 +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 1D8C2222D5 for ; Fri, 11 Sep 2020 14:41:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CdZf8e/h" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D8C2222D5 Authentication-Results: mail.kernel.org; dmarc=none (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=HKU08kLNB25mL+VNUyqsDnMwbMjP5Nld9AIqV/g1ejU=; b=CdZf8e/h6WABllVcSzL+uPNQd sDCM3Qq+9QQWRHQqH5R12SFwHhnIMA6wuwpWUiXpy/9ReB06+IB5fFw69H1hPA9/MS5KRACxMosQM 1r3xtHMsIDh8l4cm9a1MYynvOczrErZKrVipKt1bNkK56mQoqaOyw3tfZyl4zHukHKOsFGuSGrk+p 3bOc66GiKrwK4hU/axMc3ZShLMoOI6iFqeaHk4K8C/VYIysJM1PmJ6mpVnVu1JiTkRCvQS0o9s49n z4eFdajJOYjo3KSbPnZyUwIDLcqcdKTaHWfRdVXeEvxn0WUh3SM+M1X84UcYKzbyBTKq3osGcBKKJ d9GuckkiQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGkEC-00055R-1P; Fri, 11 Sep 2020 14:40:40 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGkE9-00054c-DQ for linux-arm-kernel@lists.infradead.org; Fri, 11 Sep 2020 14:40:38 +0000 Received: from gaia (unknown [46.69.195.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E6D4522266; Fri, 11 Sep 2020 14:40:34 +0000 (UTC) Date: Fri, 11 Sep 2020 15:40:32 +0100 From: Catalin Marinas To: Ionela Voinescu Subject: Re: [PATCH 4/4] arm64: implement CPPC FFH support using AMUs Message-ID: <20200911144032.GC12835@gaia> References: <20200826130309.28027-1-ionela.voinescu@arm.com> <20200826130309.28027-5-ionela.voinescu@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200826130309.28027-5-ionela.voinescu@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200911_104037_530290_3C58BDA9 X-CRM114-Status: GOOD ( 15.66 ) 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: souvik.chakravarty@arm.com, viresh.kumar@linaro.org, linux-kernel@vger.kernel.org, morten.rasmussen@arm.com, linux-arm-kernel@lists.infradead.org, sudeep.holla@arm.com, will@kernel.org, valentin.schneider@arm.com, dietmar.eggemann@arm.com 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, Aug 26, 2020 at 02:03:09PM +0100, Ionela Voinescu wrote: > +/* > + * Refer to drivers/acpi/cppc_acpi.c for the description of the functions > + * below. > + */ > +bool cpc_ffh_supported(void) > +{ > + const struct cpumask *cnt_cpu_mask = cpus_with_amu_counters(); > + int cpu = nr_cpu_ids; > + > + if (cnt_cpu_mask) > + cpu = cpumask_any_and(cnt_cpu_mask, cpu_present_mask); > + > + if ((cpu >= nr_cpu_ids) || !freq_counters_valid(cpu)) > + return false; > + > + return true; > +} IIUC, the only need for the cpumask is this function, the others would have worked just fine with the existing cpu_has_amu_feat(). So you have a lot more !cnt_cpu_mask checks now. I wonder whether instead you could add a new function near cpu_has_amu_feat(), something like get_cpu_with_amu_feat() and do the cpumask_any_and() in there. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel