Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1112617lqt; Fri, 7 Jun 2024 08:18:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU35dEriexf+1EtfNVZr826xDhWZ8fCq6ywGQQjpGFExPCsi29uyNtejseyYlA6v/pS/LJ01XU9npqCq9qL3iMqmDthWmh03qcWbzcidw== X-Google-Smtp-Source: AGHT+IE7Xve7eOSQod74acpj59NXOS/pQUx9gSzXtyHsMAWcX3UZXMPTy4rlXTGmBLdaPHesrus2 X-Received: by 2002:a17:906:79a:b0:a63:41f7:d46 with SMTP id a640c23a62f3a-a6cd6663cbdmr186230666b.17.1717773517469; Fri, 07 Jun 2024 08:18:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717773517; cv=pass; d=google.com; s=arc-20160816; b=ooFSr15/0vhoq7RXIZnXNC06s97TnGm0SOxo8r81wwSu4tP79zJVD2w1oJe7axXKe5 WG85UhTrwfUYCLVlcTsVvaxoeMqxcfPCwysAv9DXs3FELJHJl228C9Mjg5p4TmjTgiI1 NGQOjuaEraAG39Y4VmE9b2Xe6QA1AMqdkA9U9m70w62MjVGIypEiAsW0BnYHJCMLUguv BT6v2cBAnD9BuE8/+/AXbKZ3Egtov38UNdxIYiKGoSTocPYNsU6SzQqK3cx0xPcF5qJg 7hfTpSVHDFREVzzjPixLxIclC+JnCotdt13F4JwUKh3nkonOjv9FBTl3qukAdrgEyLSL 2UKw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=mx+HUEjgAJNMiC9UnPN48IwI2aMt7Q4WkoEfs7332KA=; fh=TxiKkBA8xn5NpS6NDwJEXRbAAoX4hkmGhHiQ92IH4LA=; b=HWsc/nzNlBH2lcERjUYOlxcj29lzlx3oFpMC9VCSlucuiB2qTIG1LMRGsZXq+V19KT 54ee/K04GAAdbIT+lpBJP4+eYh68Nl6FQJqy1M2PifbtGWWdShQvZjfy1tEvCT/HyOi6 jLQCCdBgFfur0EXiasZD01KgMBYy7yKQv6+l5+9pIOA9c5Jr4JDUQVkbTO+56MoylXUv Sfe5zziWWX0sSFhad3MpX9XRs/LrbaufDKbOOkHBKqNyThFAXAUl6CAQSL2lbN694f9T n27fUtT2fn93/9/Lf8bZtMw7emJKH1kEgjYqi4vdK0U8+aFQSnqWPTyOkZdhohx7XPH4 Nhbg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=X7v4NTKD; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-206370-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206370-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c8058238fsi201654866b.61.2024.06.07.08.18.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 08:18:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206370-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=X7v4NTKD; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-206370-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206370-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 364081F2421D for ; Fri, 7 Jun 2024 15:18:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A43A019597A; Fri, 7 Jun 2024 15:18:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="X7v4NTKD" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 479411922FD; Fri, 7 Jun 2024 15:18:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717773511; cv=none; b=DyYAIRmcmTjoSI0v2iYX5yFpwHuqX3EiWhy4eCDvwt1WC/2vaxqpIEzkw5sua39YbQgKZiOTinTlvRxBxY+Etuj2p/Xtq5yzvYpLdeAdv1bi/tVpcT3y0h4vM2LGUf1zSZRM/7k0y29JoHitSbPJ01s801tkEXTiirTqfHJhsRE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717773511; c=relaxed/simple; bh=mx+HUEjgAJNMiC9UnPN48IwI2aMt7Q4WkoEfs7332KA=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=ncqRUMeSYKRFqKBBXyVGAt9T/TNq/KWj09L8tfq3BQZbc+wKz/baxB8W3w+2geJnyKk48MulZFR9NavpWndCI3UxXysDHrhRz4lI2736h5ql1WjwrR6SwNzTQ22SG3evX2vUF6tqM0FYJvS/tgwinRSqWmmilI7yAw0GGwat5aU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=X7v4NTKD; arc=none smtp.client-ip=198.175.65.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717773511; x=1749309511; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=mx+HUEjgAJNMiC9UnPN48IwI2aMt7Q4WkoEfs7332KA=; b=X7v4NTKDS6+VW7mTYImdN7IaNVh/UeqRIWWU+z0Slg30p4i3tZUpY0lQ Wi9T6blpyuzZ/PsR2CxJBrg4Rj1CDSInF7ZUKGSiqsV6GVLUY2zbQvX/C xJMDTk+k5b0QF/9JZa/Y2xj4iq29E5vh0moVmVTjbmocwoATO3ZGVul2l bwe/j9VuxIdrrCigP+g5WpsZI6yNRsZFxI2LMhs4ziE3MNKZZOkUm54mx 5SGXOMbgydWjMaV/GRBJMVz5UVWLwmrYgHp4OzRH3Hr5Mv2lcncQElRJR z3YGhWZznyXGnF1H5SC0Uyz+hbbZYC1PihEUaBNU40oCtqGNRz93Ylb74 w==; X-CSE-ConnectionGUID: fet2cx53Q+K1irDaY+WkBA== X-CSE-MsgGUID: 0pKbWhI7S2KWhPuFq4p5Qg== X-IronPort-AV: E=McAfee;i="6600,9927,11096"; a="37028793" X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="37028793" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 08:18:30 -0700 X-CSE-ConnectionGUID: sJPDrhkSQHC0MIwJ+Xr9Qw== X-CSE-MsgGUID: gozCqHLWQa6HT+JxZPxvww== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,221,1712646000"; d="scan'208";a="43295641" Received: from spandruv-desk.jf.intel.com ([10.54.75.19]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2024 08:18:30 -0700 Message-ID: <4fe39e45c117a976b60dfb37234551391050b199.camel@linux.intel.com> Subject: Re: [PATCH v1 2/6] cpufreq: intel_pstate: Do not update global.turbo_disabled after initialization From: srinivas pandruvada To: "Rafael J. Wysocki" Cc: Xi Ruoyao , "Rafael J. Wysocki" , Linux PM , LKML Date: Fri, 07 Jun 2024 08:18:29 -0700 In-Reply-To: References: <13494237.uLZWGnKmhe@kreacher> <8366982.T7Z3S40VBb@kreacher> <6d5ee74605bd9574baa5ed111cb54e959414437a.camel@linux.intel.com> <6ebadacd8aaa307a5766cdb1b4d4a5c69acd87ac.camel@xry111.site> <30a30c5107a47a2cc3fd39306728f70dd649d7fe.camel@linux.intel.com> <29d69252dcdc398f147c9139a8666d09e7bd831d.camel@linux.intel.com> <0324bc3a88654855719cd48a5ed69a34eea31037.camel@xry111.site> <48eba83030e155f703b4248e9c1ae65aa44b1a83.camel@xry111.site> <1da736da33a61de92314934ecf7fa0420d6d6b81.camel@linux.intel.com> <63e98f2151ef64de92cf7e3da796937755ea5552.camel@linux.intel.com> <258ce61c155c28937620f6abe57a39f2b4b0ff56.camel@xry111.site> <101b903e58f2ebae60934edc374c7cda09f83de1.camel@linux.intel.com> <651d11578646200cdb0a91c46ed09a22f29e94a0.camel@linux.intel.com> <1031cc4e4b507628531d9115ce7e4bc588dbab1c.camel@xry111.site> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Fri, 2024-06-07 at 17:04 +0200, Rafael J. Wysocki wrote: > On Wed, Jun 5, 2024 at 2:05=E2=80=AFPM srinivas pandruvada > wrote: > >=20 > > On Wed, 2024-06-05 at 13:21 +0800, Xi Ruoyao wrote: > > > On Tue, 2024-06-04 at 09:56 -0700, srinivas pandruvada wrote: > > > > > > With such a delay, I am not sure how this even worked > > > > > > before. > > >=20 > > > It didn't work out of box but it worked after manually writing 0 > > > to > > > no_turbo after 20 seconds, see > > > https://bugzilla.kernel.org/show_bug.cgi?id=3D218702. > >=20 > > That make sense. So it never worked out of box. The > > store_no_turbo() > > has additional read for turbo flag before, which is removed now. I > > think adding that back will will restore old behavior. > >=20 > > diff --git a/drivers/cpufreq/intel_pstate.c > > b/drivers/cpufreq/intel_pstate.c > > index 4b986c044741..0d5330e5b96b 100644 > > --- a/drivers/cpufreq/intel_pstate.c > > +++ b/drivers/cpufreq/intel_pstate.c > > @@ -1301,6 +1301,8 @@ static ssize_t store_no_turbo(struct kobject > > *a, > > struct kobj_attribute *b, > >=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 no_turbo =3D !!clamp_t(int, = input, 0, 1); > >=20 > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 global.turbo_disabled =3D turbo_i= s_disabled(); > > + > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (no_turbo =3D=3D global.n= o_turbo) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 goto unlock_driver; > >=20 > >=20 > > Need to adjust the mutex around it also. >=20 > Anyhow, it can be made work. >=20 > global.turbo_disabled can be updated right before it is checked in > store_no_turbo(), so if 0 is written to no_turbo (and global.no_turbo > is 1), it will succeed if global.turbo_disabled changes from 1 to 0. >=20 > Something like the attached (untested) patch. Should work. Xi, Please test so that we can close this issue. Thanks, Srinivas