Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp397109lqb; Thu, 29 Feb 2024 04:33:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUAR1g6/OpZqYnXJTXmK76UYwdVkEdIHQKgkah/UMD6l+9lxvqH8YnRPxjiySEAHOBidErrGTcmH3seEgBfZEhCycBzUSD0muB9DxUasA== X-Google-Smtp-Source: AGHT+IGN0Ki1McfJYFMrgY1O5V0N0obWfCBLO5ktxn7ge2WnHwfwRwjJ5VpEgO6T+TUobdb1hh8e X-Received: by 2002:a05:6402:901:b0:566:59f5:26db with SMTP id g1-20020a056402090100b0056659f526dbmr1483056edz.11.1709209996188; Thu, 29 Feb 2024 04:33:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709209996; cv=pass; d=google.com; s=arc-20160816; b=HxVWZzXXt3G600VX/eshG9dGfJ/bhCv/VX4xt0xY/gwhTmdiZelcVOMId0MyGBZ03m AU5eCVZhFyZMawUYdwIp7+IWUWSq3TZJd6Z+Yut8Q9VWUaNqoirKXk20gOiFkh2SF85x 8X9MhF6YVmnPPcRWPWCE30W5QhiIKy8dIJH1GWZZ79ogwt3p2rtZIPEJBp5qA/r99EwV AQtMid3ZxJmiygUeBWwA5zhyvsekbQdqJG8wSy+bF+g1qRMW18cJrWmvgZ9mguOpMvqH twbEgQufmDSDSXPlrP2o/qIEi/7UkcZPukKGRwndldagx4A4ISOob/+y5sasIPiVz1DV 7rVg== 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 :references:message-id:in-reply-to:subject:cc:to:date:from :dkim-signature; bh=Ip1ftbbPsFV4oiinN3gthTeWVtXmuthxYcJ/fI96kwA=; fh=ZWqgRrjgiHkbLCOJ/mYm1Xgevf1I8vLp2i7bNggwygM=; b=F2yjW+R+9gneRoyjsEFt0yHbkOJaYQHJFrPJwpwJW4xp68LpI7QiAjmHgzqHKfnHIS XoKF58KciZ+V+F+vGTQQ+X+7mvZr3QRuHjp+4n9vlYmGDkPiXYbLEWWe2q/MilxmluGr 8jV1WdYtbpN3W+2Q//RuLI4ATNKUyNOZEcstD4hIIMsxm1KlgzZb3n9Mx4bemRc0JOsx ps1dTqqnP/zkR0eZO4KxWkEttdtfTU3f07hFAewulwUWMkCj2evoYrvl+kAEFESG1ZwL i5c41dXV7GTXFn1C0zQYoG5Rn5z/PzFl6xRb9ZvpLA1weohiobRpI1UXUI3UHeYmaz72 9lrw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="T/fCB2+f"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-86703-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86703-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 c7-20020aa7df07000000b005661942419bsi539754edy.689.2024.02.29.04.33.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 04:33:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86703-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="T/fCB2+f"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-86703-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86703-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 C57A61F2561C for ; Thu, 29 Feb 2024 12:33:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0ED7F7292C; Thu, 29 Feb 2024 12:33:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="T/fCB2+f" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (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 C7210185B; Thu, 29 Feb 2024 12:33:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709209988; cv=none; b=ofn35LBW4jBw4oNyTz1BIltj0TvTD2lA3GE7Y2/fpwaAG6S9R52zTJ2aTuhAfAOFUlEhjlfxnf+N89b8EKrHRAenlgJxJaW0ILORvKKjD/vnd46YY7shKUR+KL2hEd+IJDfPD9xKjMCljNxx0oa4bXltNoX7suzjHFfm8I3vU/M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709209988; c=relaxed/simple; bh=ZKlZMmZXcw2fZf045p5kABlG1+alTG4gOk2aY7Bv/KU=; h=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=plZAJhEV8BQ1x6lM62NBAaekxj3jkDZGQlRAESc7U6GmrGHpHiTi23Ris2iRRQnrNuZGtp5EXFWLcjVC2a368k/Xu3Cq/Uw2fwdsrxVYyieaoU6PnH4CG4uHI2vK5DRlzj8URzF2HOCNAI2rtvXRidl0sXrFn1piGkJnEVAgEPk= 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=T/fCB2+f; arc=none smtp.client-ip=192.198.163.17 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=1709209987; x=1740745987; h=from:date:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=ZKlZMmZXcw2fZf045p5kABlG1+alTG4gOk2aY7Bv/KU=; b=T/fCB2+fiv53Mzs5C/2Xff3CnMMCaINrAmcUOkzjh10Q/89kHRAQow8v 9+Ii+Zh3iXl+KoUstcxWNvwcRgURSFdJ1WNO9P1qrFssI/U82A1+ZByaH Kchi2qJsOsUyepGsTtZS0wZYIKWfttvjcJZOdNtEU1uN0BYzyN7yfnrB8 JqbBzvUofArFFB2tOywtQsadKwU+2b1M3QzwZgFag1bhYtA/1E0B+1VuA +YunkXU9R/MfDHegxLQIXn0Nsb8u1TBcnctqEvMHxt1+Kr6SAe4ceoHJw g4W+WtUaL2kIjEenlkZuPHHXw8w9feMdt4cIaAzE5PCp7K9RPg0uf1RRV g==; X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="3520378" X-IronPort-AV: E=Sophos;i="6.06,194,1705392000"; d="scan'208";a="3520378" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Feb 2024 04:32:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,194,1705392000"; d="scan'208";a="7766258" Received: from ijarvine-desk1.ger.corp.intel.com (HELO localhost) ([10.246.51.250]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Feb 2024 04:32:55 -0800 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Thu, 29 Feb 2024 14:32:50 +0200 (EET) To: Srinivas Pandruvada cc: Hans de Goede , markgross@kernel.org, Andy Shevchenko , platform-driver-x86@vger.kernel.org, LKML Subject: Re: [PATCH] platform/x86: ISST: Allow reading core-power state on HWP disabled systems In-Reply-To: <20240229002659.1416623-1-srinivas.pandruvada@linux.intel.com> Message-ID: <23b62f29-902c-800a-1cd4-6e24d70abd86@linux.intel.com> References: <20240229002659.1416623-1-srinivas.pandruvada@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Wed, 28 Feb 2024, 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 Is this a fix? (It's lacking the tag if it is). -- i. > --- > 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); >