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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1B90C433F5 for ; Thu, 17 Mar 2022 16:31:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236304AbiCQQc7 (ORCPT ); Thu, 17 Mar 2022 12:32:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236598AbiCQQcw (ORCPT ); Thu, 17 Mar 2022 12:32:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 100601DEA9E; Thu, 17 Mar 2022 09:31:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9F9636134E; Thu, 17 Mar 2022 16:31:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BFBFC340ED; Thu, 17 Mar 2022 16:31:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647534693; bh=0O5d6Rq04+Hr+h8yNHQmWUz6ISqWFrwjXOw3xNpfpwg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VesdbL1bhztzrqSXkwiaWVU6oxT6ntFA9FuVl3Ix7yrUdBiYmpgAkZsmilhXhwAjo JU4Xm9+KsQsb1FnXqhtaPDJfoUMBq6G7oQhJ20pzTaSHisWH2itMf2nGgGXwd5iA2G UBbkraPcmjt0MG+ovONtq8Nay3hYRIkapEH7/3aYA9RAGJgwHK0FGLJ42XPfKBGMmg hvhvi3LF1SyPIqtY64qVHfoK4m3SEzTSy2BCMkirGb7FsMXdbpPdg3ob1bFt4ubQFY p4EOb+YB88y5PI/gm4o5meBIyG2Hk/W/UOYvTEfbV5wynLcqNFiboIBRa19AhtlhoN LVbVStRbdJEgg== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nUt2A-00FEoy-Nl; Thu, 17 Mar 2022 16:31:30 +0000 Date: Thu, 17 Mar 2022 16:31:30 +0000 Message-ID: <87o824y1zx.wl-maz@kernel.org> From: Marc Zyngier To: Pierre Gondois Cc: linux-kernel@vger.kernel.org, Ionela.Voinescu@arm.com, Lukasz.Luba@arm.com, Morten.Rasmussen@arm.com, Dietmar.Eggemann@arm.com, mka@chromium.org, daniel.lezcano@linaro.org, Catalin Marinas , Will Deacon , "Rafael J. Wysocki" , Viresh Kumar , Mark Rutland , Ard Biesheuvel , Fuad Tabba , Rob Herring , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: Re: [PATCH v1 2/3] cpufreq: CPPC: Add per_cpu efficiency_class In-Reply-To: References: <20220317133419.3901736-1-Pierre.Gondois@arm.com> <20220317133419.3901736-3-Pierre.Gondois@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: pierre.gondois@arm.com, linux-kernel@vger.kernel.org, Ionela.Voinescu@arm.com, Lukasz.Luba@arm.com, Morten.Rasmussen@arm.com, Dietmar.Eggemann@arm.com, mka@chromium.org, daniel.lezcano@linaro.org, catalin.marinas@arm.com, will@kernel.org, rafael@kernel.org, viresh.kumar@linaro.org, mark.rutland@arm.com, ardb@kernel.org, tabba@google.com, robh@kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Thu, 17 Mar 2022 16:07:01 +0000, Pierre Gondois wrote: > > >> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c > >> index 27df5c1e6baa..56637cbea5d6 100644 > >> --- a/arch/arm64/kernel/smp.c > >> +++ b/arch/arm64/kernel/smp.c > >> @@ -512,6 +512,7 @@ struct acpi_madt_generic_interrupt > >> *acpi_cpu_get_madt_gicc(int cpu) > >> { > >> return &cpu_madt_gicc[cpu]; > >> } > >> +EXPORT_SYMBOL(acpi_cpu_get_madt_gicc); > > > > Why not EXPORT_SYMBOL_GPL()? > > From what I understand, this could be made EXPORT_SYMBOL_GPL(). > The only reason was that the other symbol exportation in the > file wasn't restricted to GPL. I'm personally keen on keeping this for GPL code only, just like the current code is. If there is a further need to relax this, we can discuss it separately. > > > > >> > >> /* > >> * acpi_map_gic_cpu_interface - parse processor MADT entry > >> diff --git a/drivers/cpufreq/cppc_cpufreq.c > >> b/drivers/cpufreq/cppc_cpufreq.c > >> index 8f950fe72765..a6cd95c3b474 100644 > >> --- a/drivers/cpufreq/cppc_cpufreq.c > >> +++ b/drivers/cpufreq/cppc_cpufreq.c > >> @@ -422,12 +422,66 @@ static unsigned int > >> cppc_cpufreq_get_transition_delay_us(unsigned int cpu) > >> return cppc_get_transition_latency(cpu) / NSEC_PER_USEC; > >> } > >> > >> +static bool efficiency_class_populated; > >> +static DEFINE_PER_CPU(unsigned int, efficiency_class); > >> + > >> +static int populate_efficiency_class(void) > >> +{ > >> + unsigned int min = UINT_MAX, max = 0, class; > >> + struct acpi_madt_generic_interrupt *gicc; > >> + int cpu; > >> + > >> + for_each_possible_cpu(cpu) { > >> + gicc = acpi_cpu_get_madt_gicc(cpu); > >> + if (!gicc) > >> + return -ENODEV; > > > > How can that happen if you made it here using ACPI? > > This is effectively an extra check. This could be removed. Please do. Thanks, M. -- Without deviation from the norm, progress is not possible.