Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp310088pxu; Fri, 23 Oct 2020 01:00:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvywZmlA1OxmQYa/sLLrGl79Sq4/FYceWZ5n95KwCcXh4ywbLctYCb/VN0Woq7n0xroM+0 X-Received: by 2002:a17:906:da1d:: with SMTP id fi29mr807082ejb.160.1603440018038; Fri, 23 Oct 2020 01:00:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603440018; cv=none; d=google.com; s=arc-20160816; b=BBPxzVOJxtNGGcMpCSddBL6hXG4dz1tcMQuwwEVnYYrdM+PmxwVorb9wAqQjdTnD+m +0FjnpqrYfUXnuw4oGQCCuhCwc3CcDJ1C6eHDl4F4JI+sVRh6I/q8rJS1ILS5sBC59WJ Jca6MKXq6kY8y3BhbDy3+S+SUhblhEBGbGCH1OC7EUE4ncUoMGr6HTXETgcp7AVYTFLG K3PuApQUBCSXWQjPAiTFHYp6W+J690QXNLycLlTEWzoAxQTAjGyh1giOMVIr7kTG5HXZ bo2/API15HmU3wBLZLs1r5KW9zQCBxoPbA6e4pJdLDLwguh2N34iy8Z0j93o9KV7uT81 N0Rw== 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=6UEn5uQoN4tJhlwF5ab2tVEcFvdTfAmRUHva/rE0Zjg=; b=Cv6d44kY/Dizyee939JyE/i5CtSNu5hiEYT/Ke3lXnRjWv1B18U4VPqkzDUoqgKDID R3fA0DIYVFtoC9li0OxeSBtowENwxB+XEI4lSQYIlmkysnkEwQh29rUpAfJp/oEupAQW jANzSHITuS7HPCwHRtmK50LWMlBMnSyTW5PEBvO09M4MK3xYhpXUqRk7yVgYIuPAQOE2 NjXdeeYZwO5AxrvLwlExelGUuoV9QsDdnA7tIZHdUO/fw0HUHKi21EcetV75wtabVVom wXJpIjisVTnj42t8a+NjTH6ycJL+WfJJRs5n1sJxmXsWjLlRKaVOf3+QIBJnmIj6x+bV hJ+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M7gPdb+h; 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 v20si348715eja.42.2020.10.23.00.59.55; Fri, 23 Oct 2020 01:00:18 -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=M7gPdb+h; 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 S372096AbgJWGKW (ORCPT + 99 others); Fri, 23 Oct 2020 02:10:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S372091AbgJWGKW (ORCPT ); Fri, 23 Oct 2020 02:10:22 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76F70C0613D2 for ; Thu, 22 Oct 2020 23:10:22 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id 19so371677pge.12 for ; Thu, 22 Oct 2020 23:10:22 -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=6UEn5uQoN4tJhlwF5ab2tVEcFvdTfAmRUHva/rE0Zjg=; b=M7gPdb+hguPe44SEUlDoDlStAqPFEbcVqaMJ5bChIX4Pxy+NjdIEjO1s8MlDngH7dP 0qe5JVVTxBIblOauNqW+rkh93FNU2LrfGHgTaAecOoyiAaBrisLbDz+8suOaJIK10hOO ifj0/17nqUEsmS0aO0Yht6VcYDlI7uTRwvhvSStMrnG27EAFZ+MYLgcYHEFDCPDJri+v bXxS84qIzuG/DNbIVNCNAlsZ6fUr2a6oT+b82ejX1ueUqvjZhTZucc8T7lA0aDlce3ht 5GnHxEXIiJBxWkAym5/hf84TZoTbixmcslk4xbJu5Ica/x+ClE1oPsA6d3cLg9yOKsqL ndCQ== 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=6UEn5uQoN4tJhlwF5ab2tVEcFvdTfAmRUHva/rE0Zjg=; b=kayNVuMcqw40HUTLZB+mHVFWMP+MwDuEneNmZzz5mjlNPfmvCeoq7AqVvdn+ur2twU Ql2tnFOBdd2DyaI7t4QpQcy18Sfxh8jWZjBh1HaOmZpgLfq/cb/qIgto0AfsNXyqX8V5 NkeWBqoG2hevSadwbcytaVTtNH+164pm6fb1N0B7ybT8LmIawGl1c/2UAckKXKxx3tv0 1WIQs9mGWwLgglJTGJ4hFxX3Syd/S9A6kG3rCLrqTxpcKUo+ZQmC5TW6mEBlrudBSMDz QdMaUsldRKp6dGhv8gpirU0dhA9QHDZptVpgvK+3qj/wi6KDgOhlUj+xUsj0falcMsPO YyrQ== X-Gm-Message-State: AOAM533iwQFMjGuhB5p+7o6UjOYKf/AJ1a+ozLfqbci6dFJ6ajwO2dLm /sKEm2aI2mmCuv2c71Qc2EN7uA== X-Received: by 2002:a17:90a:a898:: with SMTP id h24mr728011pjq.179.1603433421947; Thu, 22 Oct 2020 23:10:21 -0700 (PDT) Received: from localhost ([122.181.54.133]) by smtp.gmail.com with ESMTPSA id e23sm631470pfi.191.2020.10.22.23.10.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Oct 2020 23:10:20 -0700 (PDT) Date: Fri, 23 Oct 2020 11:40:18 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Linux PM , LKML , Srinivas Pandruvada , Zhang Rui Subject: Re: [PATCH 1/2] cpufreq: intel_pstate: Avoid missing HWP max updates in passive mode Message-ID: <20201023061018.euom3sfxw7uvtmya@vireshk-i7> References: <1666263.spd1I39WAV@kreacher> <76352140.UXiy1LajID@kreacher> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <76352140.UXiy1LajID@kreacher> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22-10-20, 13:57, Rafael J. Wysocki wrote: > Index: linux-pm/drivers/cpufreq/cpufreq.c > =================================================================== > --- linux-pm.orig/drivers/cpufreq/cpufreq.c > +++ linux-pm/drivers/cpufreq/cpufreq.c > @@ -2182,6 +2182,9 @@ int __cpufreq_driver_target(struct cpufr > pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n", > policy->cpu, target_freq, relation, old_target_freq); > > + if (cpufreq_driver->target) > + return cpufreq_driver->target(policy, target_freq, relation); > + > /* > * This might look like a redundant call as we are checking it again > * after finding index. But it is left intentionally for cases where > @@ -2194,9 +2197,6 @@ int __cpufreq_driver_target(struct cpufr > /* Save last value to restore later on errors */ > policy->restore_freq = policy->cur; > > - if (cpufreq_driver->target) > - return cpufreq_driver->target(policy, target_freq, relation); > - > if (!cpufreq_driver->target_index) > return -EINVAL; From what I understood, you want your driver to get notified about policy->min/max changes and right now they are making it work from within the target() callback. Your commit log talks about policy->max and powersave combination, I think the same will be true in case of policy->min and performance ? And also with any other governor (like schedutil) if the target_freq doesn't change for a while. And IMHO, this change is more like a band-aid which is going to remove the check of target != cur for all target() type drivers (which aren't many) and it feels like a penalty on them (which is also there for intel-cpufreq without hwp), and that we will get into the same problem for target_index() drivers as well if they want to do something similar in future, i.e. skip checking for same-freq. Maybe adding a new flag for the cpufreq-driver for force-updates would be a better solution ? Which will make this very much driver dependent. -- viresh