Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2401367rdb; Tue, 14 Nov 2023 22:29:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IEh+QGu0fMWXZNjlJPZqmJ5oTxvcvECwVyAypoXZFw9q6kqKhhqhhEdtCCfVuEg3kjmcH0t X-Received: by 2002:a05:6870:2185:b0:1f4:a9df:7ff0 with SMTP id l5-20020a056870218500b001f4a9df7ff0mr14191676oae.58.1700029793370; Tue, 14 Nov 2023 22:29:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700029793; cv=none; d=google.com; s=arc-20160816; b=LXod92W4RKQnGs+ktIDngZPl37EhBPd4hWDFAP3dGyVN68DCHUPKwZ1J9yBwtaHxq3 4zXUj+BVAMO0hyk+hJzen9iXGy6S/j1j9TVS3BHLvW+gYS+zBvPhaq9xMDVv0vA1Yj4s UOH25/t6qxBt8pQ1dY7hod6+wVs+u1t2I6EB4BKwpvhdjoB+V8WEUp4nllXQcPhIc0iA 1q+IatFP0Pp2efYwlkna4iHOjMRI0YQgVgRtzsAMkAUhv2V66TVIN9oMRQY8rNiiofpW KOvDjbekSqDSVgTMVw6/1R/y9rukCb7xjPvn8xHvVjhWHp78HlksKnIdP8A9wvrj3Y32 2i3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ijWgB/n7wQWOhBbaV1md72p8BCrVtoBj2gz5Jm1idO0=; fh=uFE0zGiV2ArtSAsP7F8OCR4BWrBI79J9nbx2ziObHLg=; b=LEho83T7eX+QthvA1Mut2wlLtZmmUiqnC06yzXNY7FVzUbdEcDzWbi0ipiY9aqw1nj 9r25kJtXgNvuWeV5Hnl62PSIWh3XtXcHV+kgrJSW3ZLPkuUEag4T4Z/18Qe1FERXLjiC PPVQDo+/kGNaxCbM+gFnQx8ny3NJOptq6F0Gs3u/Iq657zK7EDkd5hMA4VwPLhwH4zRV 8MOqqWjgokA8KW4Fd6lx6NndNMJ9wYlU2PNNW02F+mvGaXGAZnzcUm5HoHOA3TW5MpCf Xwudn2gXW9lWTcZRhiO2fXKhqiWuUKLeKHkk0tRFRnDxu8dp1CEAmsypWt3SxDOPgh0l fD9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BrLPsIcb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id fa7-20020a056a002d0700b006b7d62ed178si9628863pfb.5.2023.11.14.22.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 22:29:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BrLPsIcb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id D05998033DC2; Tue, 14 Nov 2023 22:29:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234593AbjKOG3n (ORCPT + 99 others); Wed, 15 Nov 2023 01:29:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234575AbjKOG3k (ORCPT ); Wed, 15 Nov 2023 01:29:40 -0500 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C40C1E8 for ; Tue, 14 Nov 2023 22:29:35 -0800 (PST) Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-6c4cf0aea06so5359249b3a.0 for ; Tue, 14 Nov 2023 22:29:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700029775; x=1700634575; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ijWgB/n7wQWOhBbaV1md72p8BCrVtoBj2gz5Jm1idO0=; b=BrLPsIcbbxEeDIlp/W6DNYnO7aFe9v/lWyJ9wXQfaHy54r50+uLkAZfeeY9P1lAhBn S9+G2/jnK2ZaDjho2gMvEYxlniqc2qT9Ty9VMUVgBfSGerEly11jSY/0TU5+MnsNl0yT S0256uC4zYisWcT10Z+uz2XW/xpZkSwONPhZCxcqKDwrrMeDa4ujhK5USuhTvmjdtTuH D/LeRBeHntStjb63XuvRPQdyLYXJ1soFFSjvD+iNnfVwkviglGfkPQhnHZWIc2wUeECM Uhj4VPju1NxAF4lVVrxgpvmHRdjndMyFdGtnBOiHbYJFj4ogEi61KuA7KkWb0gWTo/Qi JsnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700029775; x=1700634575; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ijWgB/n7wQWOhBbaV1md72p8BCrVtoBj2gz5Jm1idO0=; b=FYBHZe2qwcZM9OalOlEu1TJKf7rdsHS6a+5Hlx98klWIhs7gGaRhfrA+qrZfDsHq1V Fokd4ZpCh5tA/YdZsQ5IgKx+pKStvHuwrklNvELzUzD+LoE5vJNN5PulaZsImNbBM8i1 7vgmoz9QYyJIZBwe6uigvjesWuGbriAzOZOlXjfdVlJLMJUNGsgFcu1AiOSywBoEBHeM 1ynGjes8ItSH+yqb0+87CM54AdBPaLY86Ugbqolavxoxtg5mCrsIq1yp3ESVuv8yIOy6 /mJpHD0iL1E1LfE3uQ4QGY4an9LGDs+W1R7H7/N8sghbHX0LeGyCgza360+y81ChbdDG t+GA== X-Gm-Message-State: AOJu0YwvXhCyoXtUdAjqIwmCGMPTRfUt05MrteBUew+p3fmPft8eg+QK t1UrsUTXoVN61VQlwGpltnK05w== X-Received: by 2002:a05:6a20:244e:b0:15e:d84:1c5e with SMTP id t14-20020a056a20244e00b0015e0d841c5emr15202326pzc.38.1700029775212; Tue, 14 Nov 2023 22:29:35 -0800 (PST) Received: from localhost ([122.172.82.6]) by smtp.gmail.com with ESMTPSA id oo3-20020a17090b1c8300b0028328057c67sm5810344pjb.45.2023.11.14.22.29.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 22:29:34 -0800 (PST) Date: Wed, 15 Nov 2023 11:59:32 +0530 From: Viresh Kumar To: David Dai Cc: "Rafael J. Wysocki" , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sudeep Holla , Saravana Kannan , Quentin Perret , Masami Hiramatsu , Will Deacon , Peter Zijlstra , Vincent Guittot , Marc Zyngier , Oliver Upton , Dietmar Eggemann , Pavan Kondeti , Gupta Pankaj , Mel Gorman , kernel-team@android.com, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 2/2] cpufreq: add virtual-cpufreq driver Message-ID: <20231115062932.vz2tyg6wgux5lx6t@vireshk-i7> References: <20231111014933.1934562-1-davidai@google.com> <20231111014933.1934562-3-davidai@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231111014933.1934562-3-davidai@google.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 14 Nov 2023 22:29:51 -0800 (PST) On 10-11-23, 17:49, David Dai wrote: > diff --git a/drivers/cpufreq/virtual-cpufreq.c b/drivers/cpufreq/virtual-cpufreq.c > +static unsigned int virt_cpufreq_set_perf(struct cpufreq_policy *policy) > +{ > + writel_relaxed(policy->cached_target_freq, Drivers shouldn't be using the cached_target_freq directly. Use the target freq or index passed from cpufreq core. > +static int virt_cpufreq_cpu_exit(struct cpufreq_policy *policy) > +{ > + topology_clear_scale_freq_source(SCALE_FREQ_SOURCE_VIRT, policy->related_cpus); > + kfree(policy->freq_table); > + policy->freq_table = NULL; No need of doing this. Also the order of above two calls is wrong anyway. -- viresh