Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp4262lqg; Thu, 29 Feb 2024 17:26:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUaaFSXwmjsFwk/qW3V9f5ycJ7ma90EJYV7ZzbC5boXaYocKKUo6671e87p2Swg63WG1rbZJaF0L4XlkPxt3J2fduc0cYQSoOiAURcWcA== X-Google-Smtp-Source: AGHT+IF2ZJrtNOdPQ9kS0SjdT62meA8t4XmAyVIwGvtbJ3fJ6QyA8iPVJij1kaIJHApFWaBkRgPD X-Received: by 2002:a05:6a00:14c1:b0:6e5:54a6:5a9d with SMTP id w1-20020a056a0014c100b006e554a65a9dmr464861pfu.19.1709256370863; Thu, 29 Feb 2024 17:26:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709256370; cv=pass; d=google.com; s=arc-20160816; b=fzsXLUHPidZXS1wbumir/bAbHOvZlpDO4zpD04hKrR6m+zUFBX9Ckc3KRRMGXdjJQ2 iQq8hUHL3EeD3bQo/o5p5FSjPwPz00REeOrGBfoKX3QZk9HAEeVXKGjp3NPCa3HEn3F7 GsTAlr7/dwmU8ON/pwipBXeFbvdOoxTrKGPZkB917ZhJNbssadD8G7PwwrZle/1Q29Yc daI1miF41PNB98o5SLVjQW12UZ2oUSpk5aLMphsO+eR/pOpVAAcQHY39XJ2wb5yGgw6E EsVCnnQfahPSXoKwVOmTY/ffPeoCV4qjw3SwloVFACzYa4wJi34Imu+c3/2gXLlx0mTQ xdvQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=tAbCPp+RB6tHOvWEWA2o5LmiIoR89x4HpHxvSazhrkI=; fh=GcwRy7p7bOv7/UGLQtY6iD/uRo5P0HTfPSuC0R//t+w=; b=LPDBKvxKcV70MU/WAcXChNIEnKE8DNqAJVK9Zs4TYqr9CPogb62kgfaY5x1/0RzssV l5ro2bD4YmDKqaQ+a48WldFbPZAIqphrZ1e3+6RlPkodgXxO28wS003CzTYDw4iizpqJ E0um1TYRNDPX6FiNB6cCKNJiro64yGgQLZnGFuNfi3aV9Kgm1lnROtusttRHvYk29ZW+ emZn7Y6yJWb7p86CeaTx7UEIYN0u51gb2yQ3i5t3ZvNhCQgZKL+57rFlYVTK6I/cN1ax GUAXdfalnpsVu0DTV52SdfegprNN2QgjcnpVh21wm2DPVAF2pTgfG2/1f6pT158nKHF3 4AWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=es7kiwcP; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-87570-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87570-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p21-20020a637415000000b005c69365abc9si2506340pgc.687.2024.02.29.17.26.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 17:26:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87570-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=es7kiwcP; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-87570-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87570-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 14E0E289DC1 for ; Thu, 29 Feb 2024 21:18:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A4B2C16FF4C; Thu, 29 Feb 2024 21:18:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="es7kiwcP" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (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 8230016FF34; Thu, 29 Feb 2024 21:18:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709241508; cv=none; b=O3TyHyEe1Z7NXub+WGiJfvKew0S1DDoQBzF6DkWarmXV0pSHGQKfdZZT09bFED2kecKWtKfIfPPF3Ai3j7ljqpX4HohZ4jklSbNWq6zaM1slE/DAC/to18RN7+C6BDmJ7w+L8U8hGCJYakcWC4gki4C0sUCmLgqNkiBp+vMt+rc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709241508; c=relaxed/simple; bh=59iOag6GB72bkNMijk1auQJkojkJz2SZvr7evBnMPuA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=o/mXICPnr9lQVTxX1548QiRevU+neoILlocnaswysmLqlHrdqLISHUH4IUj1bVWm5nS+kELqQ+iaaL1/YWRThCjY8paE6vH4iIFQZaysNGPkV7wQynhN2aBa/kt66mf0aTvSrvut+chred5tSLpyUoUOcYQ5wtb8LamhrktPbj8= 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=es7kiwcP; arc=none smtp.client-ip=198.175.65.15 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=1709241508; x=1740777508; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=59iOag6GB72bkNMijk1auQJkojkJz2SZvr7evBnMPuA=; b=es7kiwcPWTXsaCbdh3Klix22/HClX3Zf1HqzG6XZ4c4HBxV+tzkTxoD2 mQzEl37GtgQ452KzqEbOhMwFTFI8G16wcSuHoQ29WfcuGaML3Za04M/ko DjNXHx4BOB9jG0sLwhA8X+UsKmVWhEYtz53Fu2xmDpHWO5v9OeCf1Mc9h mZ3Duadk0n8aE3KPJ5UWuBnIGRT5g9d9hdiUFNKCF2EKzmhbG3yqSpFEJ CDZ4SZIUqayjunCM8z7X8dtTnssZGWM1lglddFQ1UhpGB/Es8SwJHvySA JgooW6Ucl/8uWrGfS1aIcfJje3w485bhs2dDkh6EvYLGLu02o8GMH2Z9/ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10999"; a="7572755" X-IronPort-AV: E=Sophos;i="6.06,194,1705392000"; d="scan'208";a="7572755" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Feb 2024 13:18:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,194,1705392000"; d="scan'208";a="45509481" Received: from gditter-mobl1.amr.corp.intel.com (HELO [10.209.51.74]) ([10.209.51.74]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Feb 2024 13:18:27 -0800 Message-ID: <0f335f76-1a76-4964-9dd4-0491fe4bcf91@linux.intel.com> Date: Thu, 29 Feb 2024 13:18:26 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] platform/x86: ISST: Allow reading core-power state on HWP disabled systems Content-Language: en-US To: Srinivas Pandruvada , hdegoede@redhat.com, markgross@kernel.org, ilpo.jarvinen@linux.intel.com, andriy.shevchenko@linux.intel.com Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240229002659.1416623-1-srinivas.pandruvada@linux.intel.com> From: Kuppuswamy Sathyanarayanan In-Reply-To: <20240229002659.1416623-1-srinivas.pandruvada@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/28/24 4:26 PM, Srinivas Pandruvada wrote: > When HWP (Hardware P-states) is disabled, dynamic SST features are > disabled. But user should still be able to read the current core-power > state, with legacy P-states. This will allow users to read current > configuration with static SST enabled from BIOS. > > To address this, do not call disable_dynamic_sst_features() when the > request is for reading the state. > > Signed-off-by: Srinivas Pandruvada > --- Looks good to me. Reviewed-by: Kuppuswamy Sathyanarayanan > drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c > index 2662fbbddf0c..1d918000d72b 100644 > --- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c > +++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c > @@ -462,10 +462,10 @@ static long isst_if_core_power_state(void __user *argp) > struct tpmi_per_power_domain_info *power_domain_info; > struct isst_core_power core_power; > > - if (disable_dynamic_sst_features()) > + if (copy_from_user(&core_power, argp, sizeof(core_power))) > return -EFAULT; > > - if (copy_from_user(&core_power, argp, sizeof(core_power))) > + if (core_power.get_set && disable_dynamic_sst_features()) > return -EFAULT; > > power_domain_info = get_instance(core_power.socket_id, core_power.power_domain_id); -- Sathyanarayanan Kuppuswamy Linux Kernel Developer