Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1794381rdb; Thu, 25 Jan 2024 06:26:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMob33+8CDhfpj2jSWxR9fO1/2cGpxrcM9M39QOa1NmlO8S1TCQXxMirPL3mG4brKbYwFp X-Received: by 2002:a05:6359:4c1b:b0:176:7281:7eb3 with SMTP id kj27-20020a0563594c1b00b0017672817eb3mr548265rwc.30.1706192770308; Thu, 25 Jan 2024 06:26:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706192770; cv=pass; d=google.com; s=arc-20160816; b=jq/y8cqJX0FkoH5Ht9rVzpuaf9UakXGA8ZnhJR/KMdyMV9F7Tg24wgYu2huVS/3tKw bWb2lYwNq09j3Wmp4pT/waCcidnrC8epP+1NisCXjbMelzs2+wEmz4A8Exi4u5kvuil+ cxU88lyZ1mTX3vaz7nmcUOl7Wuh2BAg7DEnj3UkVnx8ziCVioUF6lrynlKDtr+5qYlpT WbK3wxrvQOY39YIAck29De/vavgUPHecXGYRK7hei7SzicMnPozZ56SJppz0JR/2Ro8W tApI+Md2JZYoBRzZPa581d1fxE+Khuezf1i7k/uNdoiRtw1TPdP2oS+W9lJneZyD5DPf 33Xg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :sender:dkim-signature; bh=zpqP5sER0oQ1ctnx/TCuLAJ16oYKTBCC8iIqh3prnGc=; fh=RN62bj4nz60zUvsXR7MakHRPgm3he8Y/n0pU50gFlBY=; b=KrgYWS85BZbMu7P/S1d86rY2P5a+eeUnlgeCqe1yP8iflB1KAjzGPwTCeY80xPJQyu oa+YCGM7lvMKQUqh3eQ9APoTfmJexwaQJzO6+KRA8r/e5HTevP47hpFhAvodL1qu/GHW DLQsKM+Lb7IVqXIjSySUbqN21N0B7KAnnXLToMxPDnrvTRZX1m1d0/wOWUpTbDnJ1dZZ 0klsvFkNWZYgpLigishhbGFrV2rlo7OBkrl5R11/cxkmAzXKGpPbq1MW8Zg/pF4RG+4W BwuFk/bkod6yPb9PaxDEc69ca1KH61knYmCFIv7Yy2k8duvpspFcFs8oDK0rFNauH0QG bXkw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=b6XKEDD6; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-38718-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38718-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id k18-20020a63f012000000b005c625d44bd5si13650262pgh.281.2024.01.25.06.26.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:26:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38718-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=b6XKEDD6; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-38718-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38718-linux.lists.archive=gmail.com@vger.kernel.org" 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 D36F5B21935 for ; Thu, 25 Jan 2024 14:25:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EABCD6341D; Thu, 25 Jan 2024 14:25:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="b6XKEDD6" Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (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 49AE55C60D; Thu, 25 Jan 2024 14:25:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706192706; cv=none; b=OxjJ2NHhTDCatywo/Nw4eslkzo8boiJVty03q1eDWW2qYURJTPdIlCai4Kyiw+u/I/OFdQNJrJ7T+sBDbRw/ZAPG9SR+kd0PFRZvcL4wZy0s5XOyUObvE07WMFBqEMcfr2ghg/mX1ujeEADVEheM9Yp+XFOd8yBBGh703FLd4dM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706192706; c=relaxed/simple; bh=KGLAirHlxaxNLl6c+ud0BFq34jV/liCx9KkdTcoUurY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=dzNg03MLdVXanoaCTq45UCXu0128WFraSeFejL2fpDwY93eSVVJ6rZCJ5DlO6LqPza/NgParQ8Pty+r9CmLSrZpxkuSVHN9cG8+32Jgg/HZpx9/gbYgBB21cEiUsO7rfmlbBvo/RRvEjIgZWDu/zEzOaPmi4BOD0/Ez5C+GXB5Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=b6XKEDD6; arc=none smtp.client-ip=209.85.210.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-6ddc1b30458so1502995b3a.1; Thu, 25 Jan 2024 06:25:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706192703; x=1706797503; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=zpqP5sER0oQ1ctnx/TCuLAJ16oYKTBCC8iIqh3prnGc=; b=b6XKEDD69SN67Hed2HexlOwC9ZTKO96o6dB340v2gmV/BHCYH6zEHPposV3UuqN8zK 2Pt0aOU0ytvdqGWa0Udi3FzdsCLAiP5ljifQORgVAc7m7shtSBEJYweeHV8NBl0azQSX oDIk71yjR9R/Gt5DB1HlIvMllFDD71YwYIpqm048TYvHvE98q6G4k3rxOGfv+GoaWc7e FwpHzjLn3ZkPmx1KexdMxQn2dmsndfXQ3LQQDaFEZIFZHMCIrh0YKIOXJiGPqiT8UU1U WA6Tp1iGKNeUFn7kWSXcP7rH1DSzwLAd28OgUUcssaBJneK7yBjhgzngWKn0N7nHhFa6 c+bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706192703; x=1706797503; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zpqP5sER0oQ1ctnx/TCuLAJ16oYKTBCC8iIqh3prnGc=; b=AXE+0sCyXemPD6SObnBcmGqcsTIODPe6XT8PiAyV6mrRqrMHUyV0ntiCUXxPEUyps5 SiwoSYN50IeI6dUP2pIgSKUqFvRCjUCJn0a+aCPZSjA9W7gI+HkfrxA0A+cgkKOcGUA7 m4XtdeEu3KmRw+TyEx8Bl846Bc46Bh7mYYBsbk7Be3OXSoi2Whb5Ql4Syhkw94iX3Nx0 MfH5wnsFXZXYO/bYfLq7Pa837089aa1fX/VSCkU1YhNdWLfnAE9SN8B2ZaaOWrPM+fVi egcYNqoBSRb85BAu8KPtjgEdsco4CgUrBEYOdbZtg04MAEkVwQXHrH0lQfmW+pH5ohC2 Doag== X-Gm-Message-State: AOJu0Yz9dZtoNei1iQlXKYw55Ji55vBCF1fmyAnfplgBU4lid/Yw4bEt 6NpyaNCnFrUQbw+IhdeSnJGLIhNfluurZC1KKCbfC5oKQ4/zdVtFLu/Whb4V X-Received: by 2002:a05:6a20:43a1:b0:19a:55a8:c04a with SMTP id i33-20020a056a2043a100b0019a55a8c04amr1397836pzl.78.1706192703287; Thu, 25 Jan 2024 06:25:03 -0800 (PST) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id c4-20020a056a00008400b006dabe67bb85sm15856033pfj.216.2024.01.25.06.25.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Jan 2024 06:25:01 -0800 (PST) Sender: Guenter Roeck Message-ID: <540cf4b3-ebf6-4a85-84c4-c012a69db416@roeck-us.net> Date: Thu, 25 Jan 2024 06:25:00 -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 V3] hwmon: scmi-hwmon: implement change_mode for thermal zones Content-Language: en-US To: Peng Fan , "Peng Fan (OSS)" , "groeck7@gmail.com" , "sudeep.holla@arm.com" , "cristian.marussi@arm.com" , "jdelvare@suse.com" Cc: "linux-hwmon@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20240125064422.347002-1-peng.fan@oss.nxp.com> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJMaWOhks//7d92Uf3EArDlDShwR2+D+AMon8NULuLBHiEUQARAQABzTJHdWVudGVyIFJv ZWNrIChMaW51eCBhY2NvdW50KSA8bGludXhAcm9lY2stdXMubmV0PsLBgQQTAQIAKwIbAwYL CQgHAwIGFQgCCQoLBBYCAwECHgECF4ACGQEFAlVcphcFCRmg06EACgkQyx8mb86fmYFg0RAA nzXJzuPkLJaOmSIzPAqqnutACchT/meCOgMEpS5oLf6xn5ySZkl23OxuhpMZTVX+49c9pvBx hpvl5bCWFu5qC1jC2eWRYU+aZZE4sxMaAGeWenQJsiG9lP8wkfCJP3ockNu0ZXXAXwI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dlI3HfeB2gj7Yc8XdHh9vkpPyuT nY/ZsFbnvBtiw7GchKKri2gDhRb2QNNDyBnQn5mRFw7CyuFclAksOdV/sdpQnYlYcRQWOUGY HhQ5eqTRZjm9z+qQe/T0HQpmiPTqQcIaG/edgKVTUjITfA7AJMKLQHgp04Vylb+G6jocnQQX JqvvP09whbqrABEBAAHCwWUEGAECAA8CGwwFAlVcpi8FCRmg08MACgkQyx8mb86fmYHNRQ/+ J0OZsBYP4leJvQF8lx9zif+v4ZY/6C9tTcUv/KNAE5leyrD4IKbnV4PnbrVhjq861it/zRQW cFpWQszZyWRwNPWUUz7ejmm9lAwPbr8xWT4qMSA43VKQ7ZCeTQJ4TC8kjqtcbw41SjkjrcTG wF52zFO4bOWyovVAPncvV9eGA/vtnd3xEZXQiSt91kBSqK28yjxAqK/c3G6i7IX2rg6pzgqh hiH3/1qM2M/LSuqAv0Rwrt/k+pZXE+B4Ud42hwmMr0TfhNxG+X7YKvjKC+SjPjqp0CaztQ0H nsDLSLElVROxCd9m8CAUuHplgmR3seYCOrT4jriMFBtKNPtj2EE4DNV4s7k0Zy+6iRQ8G8ng QjsSqYJx8iAR8JRB7Gm2rQOMv8lSRdjva++GT0VLXtHULdlzg8VjDnFZ3lfz5PWEOeIMk7Rj trjv82EZtrhLuLjHRCaG50OOm0hwPSk1J64R8O3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/24/24 23:06, Peng Fan wrote: > Hi Guenter, > >> Subject: Re: [PATCH V3] hwmon: scmi-hwmon: implement change_mode for >> thermal zones >> >> On 1/24/24 22:44, Peng Fan (OSS) wrote: >>> From: Peng Fan >>> >>> 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. >>> >>> The cost is an extra config_get all to SCMI firmware to get the status >>> of the thermal sensor. No function level impact. >>> >>> Reviewed-by: Cristian Marussi >>> Signed-off-by: Peng Fan >>> --- >>> >>> V3: >>> Update commit log to show it only applys to thermal >>> Add comments in code >>> Add R-b from Cristian >>> >> >> You didn't address my question regarding the behavior of hwmon attributes if >> a sensor is disabled. > > Would you please share a bit more on what attributes? > You mean the files under /sys/class/hwmon/hwmon0? > > If the sensor is disabled, when cat temp[x]_input, it will > report: > root@imx95-19x19-lpddr5-evk:/sys/class/hwmon/hwmon0# cat temp3_input > cat: temp3_input: Protocol error > > For enabled, it will report value: > root@imx95-19x19-lpddr5-evk:/sys/class/hwmon/hwmon0# cat temp1_input > 31900 > This is wrong. If the sensor is disabled, there should either be no sensor attribute (if the condition is permanent), or there should be tempX_enable attribute(s) which return the sensor status (and, if appropriate, permit it to be enabled). If the condition is not permanent, attempts to read the sensor value should return -ENODATA. Overall, hwmon functionality is orthogonal to thermal subsystem use. It is not appropriate for the thermal subsystem to disable any temperature sensors in the hwmon subsystem because the user might expect to be able to read temperatures from hwmon devices even if sensors are not in use by the thermal subsystem. Thanks, Guenter