Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp94323rdb; Thu, 25 Jan 2024 09:08:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IEFJ0Bc4nf/lq5z+JI161JRZj2Br53jVpuofrK+ih65PgYY8MBTfWiD2upBvC9n+sYvN71S X-Received: by 2002:a05:6214:e61:b0:686:ab0f:986a with SMTP id jz1-20020a0562140e6100b00686ab0f986amr1552938qvb.66.1706202528189; Thu, 25 Jan 2024 09:08:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706202528; cv=pass; d=google.com; s=arc-20160816; b=xp86FybJU/XGgkTCa23a1TPSzrgUcIQNjbsNceegVfWhg/F7gkTgF2SB56WWDmZWEK 5gWXXHDMLApTY4iq/wICnYzosyGMaxhcNncSHFsO59/Qewh2E3oVetQ1NVbePdHcLltc UskIKWi31mfUsQ5adaMzFPT/2Bu1Hm4X3WrpqVo896siWWItgIzVCyIZCq1/Fu1Ib31U a+9KtAo7wALLxd9dTEfgb/HMMe1jLmafgp082mNBS0d6l0oQ/Wcl1ZfDLPwBJ8udcf/N T/fOSvkO66pL+gbe/81jLY6omG7NqUzCea6S+oZyxKHO/Hp8jEVGIEUhhdPi8Dd+g6At oKFg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=DzjhjzZbD+s5GEYZqItjiyxNngMaAUMLkvdlaRZOlj0=; fh=QEuEK1WRV8cP3H/kmDs1fbTbHiK6q+RggEpkjpowMxM=; b=S8TakgDk0WPKdqypKbNjewiNyZbjggcznnHaO9yklROz829FuNfGgTjrSTMAIkNUv9 /KlEWb1ZqktIJJQZJ/D6Q3m61q+tzvLzwqbH9XUmRDFkk0A8ywoHtDHWMTY4i0OKT61/ JVvPRalOwr23rvvyokskSvk1WL9d/UXWmOztIN/rVsKym9R807LsMHS1ruoAJMPM5uB4 smf+icXj8GzVpe8u/wYyvGGTCzclwfUcW+k3N+i4ZUSUann9cFCXTknm0vWMlUQXQH5t o6z7OsItRr2QyzxKfQ9w5ATKpqBqJC2vvQwXfQthlzKuLQ7vRaKUGH7rqNmczEcgwG66 9eYw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-38979-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38979-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q2-20020ad45742000000b006817e1bedaasi354782qvx.493.2024.01.25.09.08.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 09:08:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38979-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-38979-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38979-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id F22B91C26734 for ; Thu, 25 Jan 2024 17:06:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 61B1514462E; Thu, 25 Jan 2024 16:57:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 30DEA14461B; Thu, 25 Jan 2024 16:57:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706201868; cv=none; b=ORpto0jLIsQ/QFXOSG2Ygz/hYUrdVBbl0V6MBbk1h/pFUuwNh2E68IpuWZzqsqMsn++IOantda1sToLFs8jMmEp3O7tuusgZPU/FIPp90HCmXrOg8GZF+YrZKG+E+kaOSuEMxTfFPksa7tsbQwj+dpPLDUmW2TNk1r9cf7hlwas= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706201868; c=relaxed/simple; bh=J4RVHINTHxXCUS3FqAsSmdDYotLQ5j6o0EmlbWfe8BE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=P2TkMxIGgSoSPsmJetQpyltIgboLXzo0+U8zuesJ6iMOm1FQbl8T0sioLzJH4rqn9XXo/IzkrEvIIvK0yBn8g7jM6gKgCUflKysvuu46T14fMkqmb9rW2m8rPCsoAsyv/RIX/nh6WMVnqeQmH5ZaKHxaEslARw7KVw7ecjCgFO8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 026011FB; Thu, 25 Jan 2024 08:58:30 -0800 (PST) Received: from pluto (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7407E3F73F; Thu, 25 Jan 2024 08:57:44 -0800 (PST) Date: Thu, 25 Jan 2024 16:57:42 +0000 From: Cristian Marussi To: Guenter Roeck Cc: Peng Fan , "Peng Fan (OSS)" , "groeck7@gmail.com" , "sudeep.holla@arm.com" , "jdelvare@suse.com" , "linux-hwmon@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH V3] hwmon: scmi-hwmon: implement change_mode for thermal zones Message-ID: References: <20240125064422.347002-1-peng.fan@oss.nxp.com> <540cf4b3-ebf6-4a85-84c4-c012a69db416@roeck-us.net> 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 Content-Disposition: inline In-Reply-To: On Thu, Jan 25, 2024 at 08:16:45AM -0800, Guenter Roeck wrote: > On 1/25/24 08:09, Cristian Marussi wrote: > > > Agreed, but it seems that indeed here the attempt is to make sure that > > an accidentally disabled sensor is turned on. > > > > From the patch: > > +static int scmi_hwmon_thermal_change_mode(struct thermal_zone_device *tz, > + enum thermal_device_mode new_mode) > +{ > ... > + if (new_mode == THERMAL_DEVICE_ENABLED) > + config |= SCMI_SENS_CFG_SENSOR_ENABLED_MASK; > + else > + config &= ~SCMI_SENS_CFG_SENSOR_ENABLED_MASK; > > This clearly contradicts your statement. It leaves the sensor in full control > by the thermal subsystem. If the thermal subsystem decides to turn it off, > it is turned off. Yes, indeed, and this is wrong as you explained; what I meant is that it seems to me now after this discussion, and from the commit message, that the reason (and the aim of this patch) is different from how it achieves it (as a side effect) "The thermal sensors maybe disabled before kernel boot, so add change_mode for thermal zones to support configuring the thermal sensor to enabled state. If reading the temperature when the sensor is disabled, there will be error reported." So when I said: > > Agreed, but it seems that indeed here the attempt is to make sure that > > an accidentally disabled sensor is turned on. and >> In this case seems like the sensor is NOT supposed to be ever disabled >> (not even temporarily), it it just that you want to ensure that is >>enabled, so I would say @Peng, should not that be done in the fw >> SCMI server ? (i.e. to turn on, early on, all those resources that are >> exposed to the agent and meant to be always on) I implied to drop this patch and instead make sure the visible-and-always-enabled sensor is default-enabled by the SCMI server running in the firmware, given that there won't be any need to ever disable it, from the hwmon interface NOR from the thermal subsystem. Sorry if I have not been clear (but I maybe still well-wrong anyway :D) Thanks, Cristian