Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp3435420rwl; Tue, 27 Dec 2022 09:04:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXtsz2uMwipxIes5BiseUOQV/h9cfZjHkjwR6hQe910d22UYoOUGntLy4za1Z3RnJOhtMmir X-Received: by 2002:a05:6a21:788c:b0:b2:5fcb:8e00 with SMTP id bf12-20020a056a21788c00b000b25fcb8e00mr34726762pzc.29.1672160689946; Tue, 27 Dec 2022 09:04:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672160689; cv=none; d=google.com; s=arc-20160816; b=x2tYVsWLNPj1+u8iBH1GKQ+fCNK/gHlT3HgwGPyMK7EhPlFk27YPWXjGLLkEEyObo4 XhbEUn7aNvmq5uJsUFCujGwRlgIOQVEzufql0O37jn8CX1XAtWZB1Sk1t0gTkwzDHj9S uch7Ni3W9MfA3blqzHLulel7FRwgUr/tJTOducOSPnRPe6VWGK83oL/nWMYvWQfs1Unj p+PzMY8lLLSmpfSZvZ/Mj2RlqvGUH9HqOOfg3NoxqiuWQq5gwCfubHucJXpVvlivvLSo ZYv/QmV/ybLW9Co8WOdPEWWHTMlUOTladCbBLfY1nfHNaSVGZXOA1YxkcK6cYkQyLik+ Sv3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=9VFfowRsk5Dc+j9uuHVgkVocQheGrp4E4CpxM7g+Bp0=; b=o0phZ7ivyG/LcfmhEEBCUQUt625YQ91uyDrIeMpY7SG13LcS8/hE8/pdo/bx42l0J/ QOUIJVgZ8X865bBiutUdEpV3b5Bpx0MJQLaHeyjMa6uLjk0lqR3W3ej9VKTaN8Bu1+uO YBTYAZ+GzQe66AURfi8QEwsRLMFuTfFgtn/CwnLGM3zBjLKmMIAdZKiaVC2w+LjvCA/b KDjP2la1GdVE+0m04CdDEEWAocnyIkb1ycJaRQxwlXvX0BrQ2OS2ANMAwrNprzMsHUjl bNTN2H+iRm6HAifZ7DRfKVJArFBplCRSfM+V7BN6pnzRikGRWvmw6/NQvETduJwDfv3s SlaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CvmKrK72; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k62-20020a638441000000b004971a30e4f8si11088826pgd.69.2022.12.27.09.04.36; Tue, 27 Dec 2022 09:04:49 -0800 (PST) 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; dkim=pass header.i=@intel.com header.s=Intel header.b=CvmKrK72; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231723AbiL0Qkw (ORCPT + 66 others); Tue, 27 Dec 2022 11:40:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231614AbiL0QkY (ORCPT ); Tue, 27 Dec 2022 11:40:24 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3061BE23; Tue, 27 Dec 2022 08:40:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672159222; x=1703695222; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=IRATqieH5GzTgS6odrliQ0LbeJjujXJnPHSE5feiNho=; b=CvmKrK72CG1B3J2i9iaOgIN3OE6jyZDxsBwxRdpCtFONBXm4NHm/0BBR EhACz6/M/tISnAt+K/IsXIMgXnY8eNPFJCNdpJmUUkkdXCEOKEcxmwJ9t OwfjNalkW0exHGcB0S59XkSDbsNxApFBPmi8gZ0roIQxoeTIqNmoBKEUL rQtmN/5MQpdkcevzHWz6rVgCmMR/TGt1CY58a5JEgMSmsryr8vClkbaGF ZxruJR8gaA/vEucUp37CtNZJxxHN+hu9Bnh75VTsfFtESmPey0V1TmqH8 pn8pSvVXKg9/uJ4sf3wpPzdkh4j3o3i1Jq0X36GXja3ctJtiWHNkpeSAD A==; X-IronPort-AV: E=McAfee;i="6500,9779,10573"; a="321958438" X-IronPort-AV: E=Sophos;i="5.96,278,1665471600"; d="scan'208";a="321958438" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Dec 2022 08:40:22 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10573"; a="741781189" X-IronPort-AV: E=Sophos;i="5.96,278,1665471600"; d="scan'208";a="741781189" Received: from admiller-mobl1.amr.corp.intel.com (HELO spandruv-desk1.amr.corp.intel.com) ([10.212.206.1]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Dec 2022 08:40:21 -0800 Message-ID: <33dd969d9bdb1eb93f8f2a2167efeb535455cf74.camel@linux.intel.com> Subject: Re: [PATCH 0/2] intel_pstate: fix turbo not being used after a processor is rebooted From: srinivas pandruvada To: Pratyush Yadav Cc: linux-pm@vger.kernel.org, "Rafael J. Wysocki" , Len Brown , Viresh Kumar , Robert Moore , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, devel@acpica.org Date: Tue, 27 Dec 2022 08:40:21 -0800 In-Reply-To: References: <20221221155203.11347-1-ptyadav@amazon.de> <72bcd14eef038ec9181d30b3d196b0a872f47ccb.camel@linux.intel.com> <2ed9702b67832e3e33ef352808124980206c1e95.camel@linux.intel.com> <8e2cc66f7dadcfb04099aac7c4eef0b02075c91b.camel@linux.intel.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 Tue, 2022-12-27 at 16:38 +0100, Pratyush Yadav wrote: > Hi Srinivas, > > On Sat, Dec 24 2022, srinivas pandruvada wrote: > > > On Fri, 2022-12-23 at 10:10 -0800, srinivas pandruvada wrote: > > > Hi Pratyush, > > > > > > On Thu, 2022-12-22 at 11:39 +0100, Pratyush Yadav wrote: > > > > > > > > Hi Srinivas, > > > > > > > > On Wed, Dec 21 2022, srinivas pandruvada wrote: > > > > > On Wed, 2022-12-21 at 16:52 +0100, Pratyush Yadav wrote: > > > > > > When a processor is brought offline and online again, it is > > > > > > unable to > > > > > > use Turbo mode because the _PSS table does not contain the > > > > > > whole > > > > > > turbo > > > > > > frequency range, but only +1 MHz above the max non-turbo > > > > > > frequency. > > > > > > This > > > > > > causes problems when ACPI processor driver tries to set > > > > > > frequency > > > > > > constraints. See patch 2 for more details. > > > > > > > > > I can reproduce on a Broadwell server platform. But not on a > > > client > > > system with acpi_ppc usage. > > > > > > Need to check what change broke this. > > > > When PPC limits enforcement changed to PM QOS, this broke. > > Previously > > acpi_processor_get_platform_limit() was not enforcing any limits. > > It > > was just setting variable. So any update done after > > acpi_register_performance_state() call to pr->performance- > > > states[ppc].core_frequency, was effective. > > > > We don't really need to call > >         ret = freq_qos_update_request(&pr->perflib_req, > >                         pr->performance->states[ppc].core_frequency > > * > > 1000); > > > > if the PPC is not changed. When PPC is changed, this gets called > > again, > > so then we can call the above function to update cpufreq limit. > > > > The below change fixed for me. > > Right.  I think, this is the only change you require to fix this. In addition set pr->performance_platform_limit = 0 in acpi_processor_unregister_performance(). Thanks, Srinivas > Should I re-roll my patches with your diff below then? Or do you > think my patches should be good to merge as-is? > > > > > diff --git a/drivers/acpi/processor_perflib.c > > b/drivers/acpi/processor_perflib.c > > index 757a98f6d7a2..c6ced89c00dd 100644 > > --- a/drivers/acpi/processor_perflib.c > > +++ b/drivers/acpi/processor_perflib.c > > @@ -75,6 +75,11 @@ static int > > acpi_processor_get_platform_limit(struct > > acpi_processor *pr) > >         pr_debug("CPU %d: _PPC is %d - frequency %s limited\n", pr- > > >id, > >                        (int)ppc, ppc ? "" : "not"); > > > > +       if (ppc == pr->performance_platform_limit) { > > +               pr_debug("CPU %d: _PPC is %d - frequency not > > changed\n", pr->id, ppc); > > +               return 0; > > +       } > > + > >         pr->performance_platform_limit = (int)ppc; > > > >         if (ppc >= pr->performance->state_count || > > >