Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1233477lqj; Mon, 3 Jun 2024 14:43:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWAEh3I220WZskMcD4RQk8feHmgISQw3ykDNmLNBr/qSsVd4Y13Phtw6o8iOo72T/tjVGy8OtQuAIyRK2+BCRSDWKP1S8cqQOjOVrhQeg== X-Google-Smtp-Source: AGHT+IEgTmADTWQjg7SS4pQRU8pjB35CVLO5gk+VriY8pIT5sppJivumXbCuR3aRf2A+u8bP6Xrj X-Received: by 2002:a17:902:6548:b0:1f6:20f4:196a with SMTP id d9443c01a7336-1f637048631mr97228365ad.32.1717451030495; Mon, 03 Jun 2024 14:43:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717451030; cv=pass; d=google.com; s=arc-20160816; b=TYlAEzdnh+L6kDz7Q2rL54NPRae7mfxiqkuxQ13GEzpgbDq0YI+1fQDll2nmf/sibs sLTnkZUaSiLHxCKeSYIoPzVUzcWoZMtto4iJ5bT3El/qHD9WXfOjlBggjMvewzQz+pso NPGboOuEBPhuvys0gh25DkOM7hDkqXUdk1wiHArOCeNURBwV6FuaskB4E/UqaAJTCxc0 UunTElYnao7qvwlMes/wUOZGxVUr90/vm8B9YKeb/mA15MsYpWSMI05+eX625MmytBzI SoUUreLP1Do/WZmhWrVnznmXAHK73B2BngJq5mB2/eQi6YJl1BdJ0ptVpAsrVAd0du0G ge0A== 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=/sdLfzdwWwtIdSsPbOArqzlfMCMJ0VgYT+awBaV9fPE=; fh=4f6o5JR6kIQnno1S9z7eD9toLWzVQEhUjxBoHQRdeEk=; b=bxpTUzsVxg1zU+8EfMNHbF1P/ZPCvpkVuc5lRQptH+ymCd1eYzbdWSA90a9fsSTtK9 tB8Xen6tsSnJrZ0oGjrGHWLI8ztv746Ly3hZgE+vXxRwgSAhI0RWJPSPm8bsur04FEZ3 cqMh+5jEGH1pNnD5ryVH/m31BqrDmSQSTCmyi7uUYHj6qpqp4vnAev4P5jRSiy02ex5C rF3x/18AdXpZzwSTSUUDuvBKbwuWrZCduoCG/rlEBTcfbXwhKPc6C8jeeejmIyhrTQuk qz01RiTj7QMF8jxIgkKPDDgu98mDCYe+oKjI7lb6vxiFB2ZYewKVVreex9sBUspvmFa/ dcpg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RfoT1fGQ; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-199578-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199578-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f63233d2f0si72877225ad.97.2024.06.03.14.43.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 14:43:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199578-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RfoT1fGQ; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-199578-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199578-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 8ADB5B2196B for ; Mon, 3 Jun 2024 18:48:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D54A91386D8; Mon, 3 Jun 2024 18:47:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="RfoT1fGQ" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 881D8F9E9; Mon, 3 Jun 2024 18:47:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717440477; cv=none; b=Casls81XtGBb2GiiJxvP10twvlsCNI6H8WQe88kkHIxa7lzYhXvtIJnicNZuMBNBUUIEx5XEEb3hwPzXN9YjzSTgXRq2P5JzWfWvifSkY3MMDiGSq1bC5rrcN7wUgZzQcLasfAuzJ93rl2uBk0zkXO1eRSquzydrD8iGJoa/jOg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717440477; c=relaxed/simple; bh=15edaRo3ICbpvaIs7c6VEpdb48R0PeutvnP1BJysCiA=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=IR0fgi0kgrsLF840WLPEJhF1x4/LZ6JGKfvczq7WPPycHGaMaN3CEQr+2godfUW2y1rTiop/mIjcVnsjW2ow5ACb4l38uhS3JxDa5pTs4fdUP3p6I9+F9RmOOsiFdHyYl+PDITjWbnZZmpqLA8yxtSSDFO7598unKId2cCSZb4o= 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=RfoT1fGQ; arc=none smtp.client-ip=192.198.163.19 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=1717440476; x=1748976476; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=15edaRo3ICbpvaIs7c6VEpdb48R0PeutvnP1BJysCiA=; b=RfoT1fGQCBdovUie90RhU2fUD8e9JUebxacGbpvN1K/ff66y86d5sxal 4fAEBY4YWewdpqetz/onlHZBH2A5XPnS9BO2pX1+ILr0d0Vov7StNm0Vn 5Gf9PhVZMLd75kQiwt6TyeokHTdImXOlLaGUkTPXxxLo/LgWl3Weo7KP1 2CZGgWDJqiBXhOKwap7eOJsgiEdI95/EJ1svnIhf4C8yQ9539WqChz3+n nbcSlOotLQ0ox+Q2kN6tF6siNH3sduOgvJBHuEndAKLlo9L7BNeplgQ/n 64n2xt3UhfXg9LultZJOngj6lElyXgxRrUFqVOf6c/Q7XcVWK41CV6O5k A==; X-CSE-ConnectionGUID: 7ybUBxOBRN2pX5XG4t/xmw== X-CSE-MsgGUID: EtfynT4kRoiAY9qcutCcEQ== X-IronPort-AV: E=McAfee;i="6600,9927,11092"; a="13760284" X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="13760284" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 11:47:55 -0700 X-CSE-ConnectionGUID: k4gcVFlcRN6rDfDYOVQJCg== X-CSE-MsgGUID: 5TjGErkLRrOhpKmSenUGNg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="74452120" Received: from spandruv-desk.jf.intel.com ([10.54.75.19]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 11:47:55 -0700 Message-ID: Subject: Re: [PATCH v1 2/6] cpufreq: intel_pstate: Do not update global.turbo_disabled after initialization From: srinivas pandruvada To: "Rafael J. Wysocki" , Xi Ruoyao Cc: "Rafael J. Wysocki" , Linux PM , LKML Date: Mon, 03 Jun 2024 11:47:54 -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> 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 Mon, 2024-06-03 at 20:32 +0200, Rafael J. Wysocki wrote: > On Mon, Jun 3, 2024 at 7:44=E2=80=AFPM Xi Ruoyao wro= te: > >=20 > > On Mon, 2024-06-03 at 10:11 -0700, srinivas pandruvada wrote: > > > On Mon, 2024-06-03 at 21:12 +0800, Xi Ruoyao wrote: > > > > On Sun, 2024-06-02 at 16:11 -0700, srinivas pandruvada wrote: > > > >=20 > > > > /* snip */ > > > >=20 > > > > > What is the output of: > > > > > grep . /sys/devices/system/cpu/intel_pstate/* > > > > >=20 > > > > > Also > > > > > rdmsr 0x771 > > > > > rdmsr 0x774 > > > > >=20 > > > > >=20 > > > > > Try these three patches. Don't worry about the commit > > > > > description > > > > > for > > > > > this issue. > > > >=20 > > > > Unfortunately they still do not fix the issue for me. > > > >=20 > > > > The outputs of grep and rdmsr commands are initially: > > > >=20 > > > > /sys/devices/system/cpu/intel_pstate/hwp_dynamic_boost:0 > > > > /sys/devices/system/cpu/intel_pstate/max_perf_pct:100 > > > > /sys/devices/system/cpu/intel_pstate/min_perf_pct:9 > > > > /sys/devices/system/cpu/intel_pstate/no_turbo:1 > > > > /sys/devices/system/cpu/intel_pstate/num_pstates:41 > > > > /sys/devices/system/cpu/intel_pstate/status:active > > > > /sys/devices/system/cpu/intel_pstate/turbo_pct:33 > > > > rdmsr 0x771: 10d1f2c > > > > rdmsr 0x774: 1f04 > > > >=20 > > > > But it then changes to: > > > >=20 > > > > /sys/devices/system/cpu/intel_pstate/hwp_dynamic_boost:0 > > > > /sys/devices/system/cpu/intel_pstate/max_perf_pct:100 > > > > /sys/devices/system/cpu/intel_pstate/min_perf_pct:9 > > > > /sys/devices/system/cpu/intel_pstate/no_turbo:1 > > > > /sys/devices/system/cpu/intel_pstate/num_pstates:41 > > > > /sys/devices/system/cpu/intel_pstate/status:active > > > > /sys/devices/system/cpu/intel_pstate/turbo_pct:33 > > > > rdmsr 0x771: 10c1f2c > > > > rdmsr 0x774: 1f04 > > > >=20 > > > > It seems only the output of rdmsr 0x771 has changed.=C2=A0 And if I > > > > read > > > > the > > > > SDM correctly it's a "Most_Efficient_Performance" change. > > > That is fine. > > >=20 > > > We don't have any notifications either via ACPI or via HWP > > > interrupt. > > > I think it was working by chance before this change as by the > > > cpufreq > > > core is trying to set policy, the turbo is enabled by the > > > firmware. > > >=20 > > > What is this laptop make and model? > >=20 > > It's a Hasee X5-2021S5H. > >=20 > > Hasee is known for producing some laptops very cheap but often > > having > > "minor" issues.=C2=A0 So I guess the firmware is doing some stupid > > thing. > >=20 > > But turbo works just fine on Windows 11 so it'd be better if we > > could > > make it work for Linux too. >=20 > In principle, there are two things that can be done about this. >=20 > First, MSR_IA32_MISC_ENABLE_TURBO_DISABLE on this system can be > ignored altogether, but that would require adding a quirk. >=20 > Second, a delayed work can be added to check the MSR long enough > after > initialization and update global.turbo_disabled if it is 1.=C2=A0 However= , > that would require some code surgery. I was about to send this suggestion. For the first one we can always program the HWP_REQ.max to HWP_CAP.max and let hardware do the clipping. But this is not friendly to passive mode. But display of scalig_max_freq still should reflect the reality. Thanks, Srinivas >=20