From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C34ED26B0B3 for ; Fri, 16 Jan 2026 15:11:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768576310; cv=none; b=plCPL5DxqxhmNrYzeqFLs1WmjpVFFT2sm+f1dkT6t+p7YXiud3uqLikx2Pd84dBOefGMpmFXhqheBAYSsHSpkSqglx/mZy832GfmcxcItT94t9IlTudqCKr5dh6p5mbz7byUiPUIen5eENCOQ11BK1Adr2Kid8HcCZwMBwzXHYo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768576310; c=relaxed/simple; bh=LHJz1cNbdJQq0/h8jrYMOKnwm3tV3jhv4dWCXIxIans=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=smYUmfhNSuR89zr+8JFAYvh1Pr1VpSiK6/p+rSo+iiVmn6liLmYVu19wCddkZIAWvwxjXvyTHjRbxJX5WcC0DqVPigPLj5FOYuhR5oK1lBff6Yt9sW8DkZm0Norw0GXczG7/7FtFwwTj1cjXuNtBUU/n+N1xZkneiXw4Y+qzrp8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EYKKhCwg; arc=none smtp.client-ip=209.85.210.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EYKKhCwg" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-81ecbdfdcebso1282921b3a.1 for ; Fri, 16 Jan 2026 07:11:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768576309; x=1769181109; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=oXeFz9RUH6z49b4qnoPEulCblA5c5mYZyI1OI75NppM=; b=EYKKhCwgfkbT+r5t475W4DqjJIS55JuR7DHiL6rDFUds5+jUSQiKfGoa72zT/A1qtj wQNurPFk0FRO9MTh/M8/G+EI9NX0NYtvlWDukBYDJeWMH+m75SMJolKi2aGN8HI7HC/I kt+Q3nQzyJ8x+2/otVHT5wb532IpkL/LZJbo/9mvIW3fChefz87ubJfdtRX91MC2J5xV KyZ2PwHchD1JfMsUdbxhc41FcszD4Ex7MEr65s2AK4NSjRK/DGd5zUdPj8WjiI2s5u6E 5X0Uog/90pWC63K5FERZIuERUQUV3hlJkZBJe8eAcvtUOK9sxG8saDVS1NlCbVbjdDt6 1yfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768576309; x=1769181109; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oXeFz9RUH6z49b4qnoPEulCblA5c5mYZyI1OI75NppM=; b=iLhCmkaPo99rZNA4volb/F5XxyAXPPkfQGaOLGvg8Q1i9i8dMXhNoUbOhQVGO/sNdL htm1qkz+GtjkuvoAM9BIpYDcJhdZcmIx3stg9ZmhaxA2jeKS+OkqUHGDx1UnLSiKh2zz MZUSAaMcbsjKFnBDx6O6tnaLVBEQV3Dpy3PIcmyq60AdV7d2LAQaEoGi9fhsErz1YasN K48xlHfE0lU8OjdhI9ajM1K6MT2oUdeTVdPzdp7qQ928wCS3Ett96oC1rIsdiVVRdrM9 ZrMXCvKJ3/sP+uTfJIm+pBhXLvqlSdJi0ICaRbyeCN3WRc/L193X/RXYAqbIxbu0jJFR FQrA== X-Forwarded-Encrypted: i=1; AJvYcCWbOziNckFM27B7p/90wjOKAGgqWPeZhQ+/08pQtpSRhEKHYDhjHifg03+ckcoHlaGCx/hMQ48vD4ZUPyY=@vger.kernel.org X-Gm-Message-State: AOJu0Ywg5NxWrsgISHGFc4im3/zrJkQwgh72ybMEupQF9hI8p37J9yzA cIkJukNLWFGK9RS2kMZpAl511Heq14nZ7jHj+LIepBNbjyUzkiTCHP30 X-Gm-Gg: AY/fxX5uEGHKmvIMuy68T9lnA9CqLsZqGuDnI/1N0H3Gk+Mq3CvQjqBxx/d8dAkzwf9 g5iyoUQ/bzX47IELAiCRDPMxgwmLuZpPl4/UAP9vtE5JicUD2EY+NO2gCWfKvOBZU++XcYhw0ZG BtEAKCkOlQgpZOrG8Ph7GkAVOkfdhPKsg0GSZZFI+rdOAphl47PlWw720DKN5swoGSZsWJ+YTla c81srlI3t3lUYKIgEpmTisr9DHV0pGPxAhIh5rx0ZOCKHBheDyp/SGOU+kY0Crc7zkU3XzzACTv k++W/vM/YJncAqFeqS8YzVPDiB9GK+jCzyIWKgmB0lubiKIE3lfxVdF0Ublxo2fCFHSN77q7hay SYohze+y4c9Z9QQRg5xcg+qWjtdEjzJQ28KFfQrFW9EGOzBSgm7qxiPzVrUIji5Jni2jdS1Yx4A 9V04IHIXoPeXHvHhkm+10= X-Received: by 2002:a05:6a00:369a:b0:81e:cbb0:db14 with SMTP id d2e1a72fcca58-81fa17a1465mr2493656b3a.21.1768576309123; Fri, 16 Jan 2026 07:11:49 -0800 (PST) Received: from archlinux ([2405:201:1b:225c:eb9d:1fc0:f95c:bd90]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-81fa108bf00sm2347192b3a.10.2026.01.16.07.11.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 07:11:48 -0800 (PST) Date: Fri, 16 Jan 2026 20:41:40 +0530 From: Krishna Chomal To: Ilpo =?utf-8?B?SsOkcnZpbmVu?= Cc: Hans de Goede , platform-driver-x86@vger.kernel.org, LKML Subject: Re: [PATCH v5 2/2] platform/x86: hp-wmi: Add EC offsets to read Victus S thermal profile Message-ID: References: <20251218124303.22024-1-krishna.chomal108@gmail.com> <20260113182604.115211-1-krishna.chomal108@gmail.com> <20260113182604.115211-3-krishna.chomal108@gmail.com> <60c0e7ad-f25e-4e73-668b-4bb08dbbb79e@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=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <60c0e7ad-f25e-4e73-668b-4bb08dbbb79e@linux.intel.com> On Thu, Jan 15, 2026 at 03:26:45PM +0200, Ilpo Järvinen wrote: [snip] >> +static int platform_profile_victus_s_get_ec(enum platform_profile_option *profile) >> +{ >> + int ret, i; >> + bool current_ctgp_state, current_ppab_state; >> + u8 current_dstate, current_gpu_slowdown_temp, tp; >> + static const u8 tp_ec_offsets[2] = { HP_OMEN_EC_THERMAL_PROFILE_OFFSET, >> + HP_VICTUS_S_EC_THERMAL_PROFILE_OFFSET }; >> + >> + /* >> + * Victus S devices have more than 1 EC layouts, hence we cannot directly >> + * call omen_thermal_profile_get() like other platform_profile_*_get_ec() >> + * variants, since it would only resolve to that 1 type of board. Hence >> + * we iteratively query a set of candidates: tp_ec_offsets[] until we >> + * find a valid thermal profile. >> + */ >> + for (i = 0 ; i < ARRAY_SIZE(tp_ec_offsets) ; i++) { >> + ret = ec_read(tp_ec_offsets[i], &tp); > >I'm not so sure about this. Reading EC offsets and hoping we find the >correct one doesn't sound the best idea. I'd prefer we store the >information like we already do for thermal profiles. Unless there's some >other way to detect which layout it is? I explored the Omen Gaming Hub (OGH) behavior on Windows to see if a WMI query exists for readback. OGH appears to default to "Balanced" on first run and tracks state via a profile.json file on the disk. Deleting this file causes the app to lose the current state, suggesting that there is no official WMI readback query. By implementing EC reads, the driver can actually remain more consistent with the real hardware state than the offcial software. I agree that iterative EC reads are not ideal. However, since these two offsets (0x95 and 0x59) cover all (or almost all) known Victus/Omen layouts, the risk of "hoping" is low. Storing them at compile time in the victus_s array as a part of .driver_data is indeed the best thing. But since we do not know what EC layout is followed by the existing boards in the array, we can take a hybrid approach here: 1. I (and subsequent additions) will store their EC offset in the .driver_data field struct. 2. For already existing boards we will perform this iterative probe once during init, and store it somewhere common. 3. Then platform_profile_victus_s_get_ec() can simply use this "definite" offset to perform the EC read. > >FYI, I took the first patch of this series again into the review-ilpo-next >branch as it seems uncontested and fixes a problem in the existing code. > >-- > i. > Thank you :)