Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9717571rwd; Wed, 21 Jun 2023 10:52:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ56zcsDTsXY5PNxVVnIJLuB8dElgUjsnW5DTqwP57aFRM1UILecgJJ/8sDQbiMaSTgaYsXK X-Received: by 2002:a05:6a20:728a:b0:122:e62d:dcf3 with SMTP id o10-20020a056a20728a00b00122e62ddcf3mr4161751pzk.28.1687369941143; Wed, 21 Jun 2023 10:52:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687369941; cv=none; d=google.com; s=arc-20160816; b=PjN5jCzJe0j67C9DKj4m6Tg9ag0AvwTQKIMp9SjeBqbILOu0cQVN+xVMfwL7k3ULNa oin8LI9dAXY/7g+zbxFSVBVOxuR57uW56APp9VlLSqgm4GcvAHV2xCt2V+7EKITDU4uU V2QnGO9eeepbE92Q09xO2/3+C2XgO+VtT3MF1gDH01mZjl2MoCBxzfiPjK42Lgyu5Bqk xLB7y/Fq7ISxy+EnmVwC7ps/eDBt5I4UBn2poR/zQB0++evBFUJdLhd2Irk1M6Yr+kO+ VnjMOAfPCJiqtEeKsYkF0k6/dfl5gkqOKO8G+xDIVNgndjMdCBllBrsZz2GC9y/uj0HR 9kgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=bBfCY+AlLCHzYrBMlCC2ACqZPMyzd3rIx/eAZIVl/7w=; b=EGNfG+GieLYsEYdhz5yD5D+3axbTazDuvYJfwRZCp8oStPnW92PesLkHrghwJEqe9z mVPWkrg2kWZk0iVmljd0Q7gin+XFfYcEZqpFOr7vGBgXTmE6RfdIm0+nzLUrxV4ysHED twlX0BjwMZR6Ucmih7Qti/Qd6j43goARvgABlX8J0QM03yMZntc8PKkzDBauVc0bog5W zsCwLx/Aj3XvpEfin5bBFn4rSW+b8LJp029cF5CNxBLF7ccp5uVYhju41K7DhsN/Xuj1 BGqld3TpqER4t9SG1h32kRKxeYwiL48VbqnumfN3wesz1oNq8bZYfBsoulIy6305LHjZ XZKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s189-20020a625ec6000000b00666aaa3b271si4402380pfb.10.2023.06.21.10.52.08; Wed, 21 Jun 2023 10:52:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229830AbjFURpV convert rfc822-to-8bit (ORCPT + 99 others); Wed, 21 Jun 2023 13:45:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231605AbjFURog (ORCPT ); Wed, 21 Jun 2023 13:44:36 -0400 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1604819B7; Wed, 21 Jun 2023 10:44:25 -0700 (PDT) Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-98771dde617so152722466b.1; Wed, 21 Jun 2023 10:44:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687369463; x=1689961463; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HPP0mPj5nbFg1qXiSwWCfH7vtlRuQT6WtSGooLQEenE=; b=dJt8mEb8pTfWU2BZviQVW+B5Noy/HU/yyvktioqCNW+7PHrv5hXx08AqHKZGWCjVcK LlY3nFLQfAGmBhxWc073QHIJdh93q1EAGl0jBjY6K+iTofnSmch8Tf8M3MYtfy6sxb8F bwZQTjk/e6ZoY2YfTKCM02/tOM8UMRxCGxrpU9DqkdKZ8AiRqWxkw7Qziw3CceZ7Nw8L sIlyMqYPRl0A8eTteKbsgSF5SZGwv/fs6W3Odtm9/AY8Tnfi73cmSsL54hRe/0ZBx6H2 1RQfPK4Oa/N/riqGtyCcL9LDXQBpdenvw+285SWwuSfrfHNEZ8SLfOq/1SBdOvD6ufL9 3sLQ== X-Gm-Message-State: AC+VfDxLVdeGYi0r/pmkn6+Z8B6VO1GrmE/0bB0slrf+QH6pkbCepl12 P+XuivoYtYhxOIRVgFYIIPERZI4J0Hh82aoScPM= X-Received: by 2002:a17:906:5198:b0:987:6960:36c8 with SMTP id y24-20020a170906519800b00987696036c8mr10037606ejk.7.1687369463296; Wed, 21 Jun 2023 10:44:23 -0700 (PDT) MIME-Version: 1.0 References: <20230621065839.635809-1-tero.kristo@linux.intel.com> In-Reply-To: <20230621065839.635809-1-tero.kristo@linux.intel.com> From: "Rafael J. Wysocki" Date: Wed, 21 Jun 2023 19:44:12 +0200 Message-ID: Subject: Re: [PATCH] cpufreq: intel_pstate: Fix energy_performance_preference for passive To: Tero Kristo Cc: rafael@kernel.org, viresh.kumar@linaro.org, srinivas.pandruvada@linux.intel.com, lenb@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Niklas Neronin Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 21, 2023 at 8:59 AM Tero Kristo wrote: > > If the intel_pstate driver is set to passive mode, then writing the > same value to the energy_performance_preference sysfs twice will fail. > This is caused by the wrong return value used (index of the matched > energy_perf_string), instead of the length of the passed in parameter. > Fix by forcing the internal return value to zero when the same > preference is passed in by user. This same issue is not present when > active mode is used for the driver. > > Fixes: f6ebbcf08f37 ("cpufreq: intel_pstate: Implement passive mode with HWP enabled") > Reported-by: Niklas Neronin > Signed-off-by: Tero Kristo > --- > drivers/cpufreq/intel_pstate.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c > index 2548ec92faa2..f29182512b98 100644 > --- a/drivers/cpufreq/intel_pstate.c > +++ b/drivers/cpufreq/intel_pstate.c > @@ -824,6 +824,8 @@ static ssize_t store_energy_performance_preference( > err = cpufreq_start_governor(policy); > if (!ret) > ret = err; > + } else { > + ret = 0; > } > } > > -- Applied as 6.5 material, thanks!