Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4448083pxj; Mon, 21 Jun 2021 23:56:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgxUf347E5mAFt49hU+JGsK7N529DTUuc0iufqn+ksXIJb7sXO1a9uPUlpbZVOFP43kpf/ X-Received: by 2002:a17:907:265d:: with SMTP id ar29mr2322297ejc.113.1624344992799; Mon, 21 Jun 2021 23:56:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624344992; cv=none; d=google.com; s=arc-20160816; b=SzF6+uQyeDZUbNFDY+RwkMqSOZhVrZKc5z2fy7Ptr3/8YKrQ8UEoLhiIAMkCReeZeb TqFK0G5AyiKzT0p5YaCsboPL6W/PKxlsTaeXRcHCLqwpE4ntDiwkKSxQ7F8IjkyzcC63 vEXayprKlgqL+gVjco6OMOsHtWIshgHaQc550ENLE2PS8S90oirsSQVPLXIoTnNMO2V+ 4CnzEYWlxEQlIxQxG2SThhv6guHTp5wEZJxS0VTHODVOS/W7kExHovqaZP79BhpwRJPT LzD+FEwpLt+44DAqC3+oYPn5dS9OcILSDnlx/ngqzTx57HDvb44edvdBPbRCQ2UBJFPv 6BSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=A+0Tg8/ehjkNNlYZ11nZ7l0NXx3B5Abt3YljTUc7YIU=; b=zPgSk+t7SxmYiebQJ5g4yaiAIxq6/tvWzwWaH5lTyFzbyEukBGsy8EP4j9X020YdK3 O1Xyl2cvl5pkIAR0MuRIJEo97jqTIdaZPnZsVbH0HZvEGc4LLqs/vHPoNYxw4XEeWlUP B/12myyfNT5NFLxUiSjoaS/fkK1eabbh87gY6vadsnbQU+My/I00iryGHtDFr0UeCSBF OYU4O2ZStiKe/LhL/kuf55kI98+OGawdxo2AvvrIEXZYSQIdS8mYaBk73x0UPZsvEQ2l +cK04Ul4kTDotXmOxC1Fmh1sRS7RPe2XttIsKdoyegz/RdG2tz7dOCCd/x+DyzkvS5yV XPcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uWmEAgae; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a4si13353578ejj.485.2021.06.21.23.56.09; Mon, 21 Jun 2021 23:56:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uWmEAgae; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229574AbhFVGzU (ORCPT + 99 others); Tue, 22 Jun 2021 02:55:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229629AbhFVGzT (ORCPT ); Tue, 22 Jun 2021 02:55:19 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B15AC061574 for ; Mon, 21 Jun 2021 23:53:03 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id k6so15627374pfk.12 for ; Mon, 21 Jun 2021 23:53:03 -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=A+0Tg8/ehjkNNlYZ11nZ7l0NXx3B5Abt3YljTUc7YIU=; b=uWmEAgaeRHW4CpBeXjy8FKqCGke5BEp9kO0ZEsSZ8nwqjUF983zd0m1yPQnjszkTSW kh7LcDUJr70ThCHIXmfm6ftXOk3sMiPBK0SUwXtuRxzevg/1cWO+4dC5A7uHF3UtsgFs VLf0x+msmNGcD7Ffqfn5k+x7I3eiz9/kwwWYnV+eRdI9fQosHGWONKtqE3k2kt56RfFX UQnC/woA/zwGy6Oss6cm8cvkhx9RkMqisj6/2KtK1NQIxwVInznALAeDgbVpuQTTi4sf +IXV+er/DCTxt0gsRO+3VfAPD5iYW6y+9ZWQ0St8goS7np2SmkRoVg3IfpeHs1Aiicul GfLA== 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=A+0Tg8/ehjkNNlYZ11nZ7l0NXx3B5Abt3YljTUc7YIU=; b=iTjb4VtSmtMA9Hmb+qLpXO8Np9h4kI74LyfubJebrALXz1YQA7gNALfJxU4hPdoWn0 Y3WLa2FyieRsnxFqVZcMm5UZ5aCHNS/LDON+cU/eBQlGcDbYvc1XkAuGWyHF98JjpeHj QXJgI39XwVMSmmRa0jDGTEI9SNor/KANZkh01MO4o665Ju8/D8kwyOkZmjdkr3AfCTaB M9ij6o0yUknPJ41iK5h1csszQ9zbpeaQSj5vkhkaU++4OU1PqQ9sH3Xsn+J+QTlpZ4S1 4/T3YpWXDWZkmuv3PPmDnKgRGBs5Mf8GhlJNQ97XSb4CVLXT7P5WHPjp6fLn91LN1qSC YdrA== X-Gm-Message-State: AOAM530+CsKMShNjGLESNmGLVR5yhDwgO65gS5CmisK3nkdCmfc0tT3o WjkwV4rv7Dt1SL6sY1XQ8GMTQg== X-Received: by 2002:a63:4a18:: with SMTP id x24mr2311757pga.303.1624344782512; Mon, 21 Jun 2021 23:53:02 -0700 (PDT) Received: from localhost ([136.185.134.182]) by smtp.gmail.com with ESMTPSA id d20sm14848939pfn.219.2021.06.21.23.53.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jun 2021 23:53:02 -0700 (PDT) Date: Tue, 22 Jun 2021 12:22:59 +0530 From: Viresh Kumar To: Qian Cai Cc: Rafael Wysocki , Ionela Voinescu , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Greg Kroah-Hartman , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , "Rafael J. Wysocki" , Steven Rostedt , Sudeep Holla , Vincent Guittot , Will Deacon , linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, "Paul E. McKenney" , "Rafael J. Wysocki" Subject: Re: [PATCH V3 0/4] cpufreq: cppc: Add support for frequency invariance Message-ID: <20210622065259.nw3e7ajwgzgnlm5e@vireshk-i7> References: <09a39f5c-b47b-a931-bf23-dc43229fb2dd@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <09a39f5c-b47b-a931-bf23-dc43229fb2dd@quicinc.com> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21-06-21, 16:48, Qian Cai wrote: > Viresh, this series works fine on my quick tests so far. Thanks for testing. > BTW, I > noticed some strange things even with the series applied mentioned > below when reading acpi_cppc vs cpufreq sysfs. Do you happen to know > are those just hardware/firmware issues because Linux just > faithfully exported the register values? The values are exported by drivers/acpi/cppc_acpi.c I believe and they look to be based on simple register reads. > == Arm64 server Foo == > CPU max MHz: 3000.0000 > CPU min MHz: 1000.0000 > > /sys/devices/system/cpu/cpu0/acpi_cppc/highest_perf > 300 > /sys/devices/system/cpu/cpu0/acpi_cppc/lowest_freq > 1000 > /sys/devices/system/cpu/cpu0/acpi_cppc/lowest_nonlinear_perf > 200 > /sys/devices/system/cpu/cpu0/acpi_cppc/lowest_perf > 100 > /sys/devices/system/cpu/cpu0/acpi_cppc/nominal_freq <--- should be 3000? > 2800 > /sys/devices/system/cpu/cpu0/acpi_cppc/nominal_perf <--- should be 300? > 280 nominal-perf is max perf, and highest-perf is boost-perf. Same goes with nominal-freq (i.e. policy->max). So 280 and 2800 look to be the correct values, 300 and 3000 come with boost enabled. Look at the first entry, highest_perf. > /sys/devices/system/cpu/cpu0/acpi_cppc/reference_perf > 100 > > == Arm64 server Bar == > CPU max MHz: 3000.0000 > CPU min MHz: 375.0000 > > /sys/devices/system/cpu/cpu0/acpi_cppc/highest_perf <--- should be 3000? There is no cpufreq boost. > 3300 This isn't exported by cpufreq driver but acpi, and it just exports hardware values of highest_perf (with boost i.e.). cpufreq may or may not use this to support boost. > /sys/devices/system/cpu/cpu0/acpi_cppc/lowest_freq <--- don't understand why 0. > 0 Because corresponding hardware registers aren't implemented for your platform, this is the function that reads these registers: int cppc_get_perf_caps(int cpunum, struct cppc_perf_caps *perf_caps) { ... /* Read optional lowest and nominal frequencies if present */ if (CPC_SUPPORTED(low_freq_reg)) cpc_read(cpunum, low_freq_reg, &low_f); if (CPC_SUPPORTED(nom_freq_reg)) cpc_read(cpunum, nom_freq_reg, &nom_f); perf_caps->lowest_freq = low_f; perf_caps->nominal_freq = nom_f; } > /sys/devices/system/cpu/cpu0/acpi_cppc/lowest_nonlinear_perf > 375 > /sys/devices/system/cpu/cpu0/acpi_cppc/lowest_perf > 375 > /sys/devices/system/cpu/cpu0/acpi_cppc/nominal_freq <--- ditto > 0 > /sys/devices/system/cpu/cpu0/acpi_cppc/nominal_perf > 3000 > /sys/devices/system/cpu/cpu0/acpi_cppc/reference_perf > 100 -- viresh