Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp956244rdd; Wed, 10 Jan 2024 04:48:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEukZ/eX5dvgNW51iJlQV9W/lP4L/7eKIMalS5a14CS3wPt03CF/PwprraVAhsLHr2T2vgn X-Received: by 2002:a17:907:7f88:b0:a28:fd0e:6051 with SMTP id qk8-20020a1709077f8800b00a28fd0e6051mr841364ejc.33.1704890894354; Wed, 10 Jan 2024 04:48:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704890894; cv=none; d=google.com; s=arc-20160816; b=yFk3URfV4AdW3JI+Qh09ypB7b/8ghMo0o6XSAONQp2gwmLaY/5Q94z4oD2XIm/deY2 zEz7ik7G6WG+ATyp9RY3mxdUpHZDoCCKkBjKUlfjxzWhg/rk764e38akBCbyMM4Syf7G v2VAI/D8BKzq1eQ/4T1Bi0vhGm1V+FUqDCezOe3y4lhP1OJs6s0XKDw3KSQi+BoIgZrZ GT4DRDjYa1bKapY0N0br0h3mfoUWJRximrfPqpQlrWFAEqLYGMQ+IhScLyv8D4QZRY/r 94r7LZhezgK3Mi+ze5Bw+jyGIReMEMv4S6nuIoy71WKRFrlvlczb/rAuDNnzIOTcKALB QAow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=i8J1gCk5JCeZc0OXGdHgoM6gqwj7n4x6zJOBGQRzsUY=; fh=JaDa3955HdBBkdNVgafeAOLXVYIR8JUTzxpjfR4CLRU=; b=SJp/U5ZyvsQeQaNPtE9/l6ceFlIM/xgx3vMmxiM2ymLPJ1is4SpDku6Vx8kgQlcI/J mdDtZ3MzLwNvPPeSuMpQPL1fz+S+Na0tPBJUfi94xBrohGy9mMJDh6azxg24eFkcYUbj bG9spG5Er893mErmU6D0b1FtNbQaGJBEBZSq6lb4VUo8TrmETGpWry4RHA7byRFGqv4d wULzRDROKyIdXXucaJpjm4r3dxZGoqI/zBL7F6E8E6iTvgPEd/KFXeUF6yTvkZ2BCqcs IWPfdXhghVcDU82yOMWxA3BRxM0rkbSOCqKuAbJcJB7g4ymxEFPDZR7Fww+wNHVWwZ0t 7XDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=CAhhENMR; spf=pass (google.com: domain of linux-kernel+bounces-22182-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22182-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id o26-20020a170906359a00b00a26ee9a2520si1676106ejb.709.2024.01.10.04.48.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 04:48:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22182-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=CAhhENMR; spf=pass (google.com: domain of linux-kernel+bounces-22182-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22182-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.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 2089C1F250D7 for ; Wed, 10 Jan 2024 12:48:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71F75482FA; Wed, 10 Jan 2024 12:48:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="CAhhENMR" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 191F2481A6; Wed, 10 Jan 2024 12:48:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40ABIS09027899; Wed, 10 Jan 2024 12:47:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=i8J1gCk5JCeZc0OXGdHgoM6gqwj7n4x6zJOBGQRzsUY=; b=CA hhENMRN8/sv4fhftwxeCrVkUveBN2Ghqz3svv+QHRmap0smGAjTM3F/lNxaGMUv3 3dkleuOjOk+/ouqLz7FEiR/XX42J5PoMCti8Leni7cNknsy+13fm/ej8mGQzEU5G wjDQSmCahhuZkTRM/i9mLsnIfDRkIlG0gxEd7WmCjcjr++O58/56yOWpuDigW2b9 TLyNCKN80W+N6nvxhTbQVWLDg4xM42MXeyy4M24JiP31C9Bq1/g1XU6ZPdjrv9wg x6IkiQNm3wnr+Q+tENco0h3PU/bVaexN8xkqgmGwRN3G1o1wdvmcxmjgXS2JrkQM bSDQVQka3UoCvjOOjLzw== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vhnbnrwhp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jan 2024 12:47:24 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40AClNOi007777 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jan 2024 12:47:23 GMT Received: from [10.216.36.30] (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 10 Jan 2024 04:47:21 -0800 Message-ID: <90c0a34a-2640-d6b7-0eb3-19fe789d2998@quicinc.com> Date: Wed, 10 Jan 2024 18:17:17 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] thermal/sysfs: Always enable hysteresis write support To: "Rafael J. Wysocki" CC: Daniel Lezcano , Zhang Rui , Lukasz Luba , , References: <20240106191502.29126-1-quic_manafm@quicinc.com> From: Manaf Meethalavalappu Pallikunhi In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: HOIewuGlM0jeWGMwkWdRj3NLhH2hzpQ6 X-Proofpoint-GUID: HOIewuGlM0jeWGMwkWdRj3NLhH2hzpQ6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 phishscore=0 spamscore=0 clxscore=1015 priorityscore=1501 mlxlogscore=712 suspectscore=0 adultscore=0 impostorscore=0 malwarescore=0 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401100105 Resending to reflect to format Hi Rafael, On 1/9/2024 7:12 PM, Rafael J. Wysocki wrote: > On Sat, Jan 6, 2024 at 8:16 PM Manaf Meethalavalappu Pallikunhi > wrote: >> The commit 2e38a2a981b2("thermal/core: Add a generic >> thermal_zone_set_trip() function") adds the support to update >> trip hysteresis even if set_trip_hyst() operation is not defined. >> But during hysteresis attribute creation, if this operation is >> defined then only it enables hysteresis write access. It leads >> to a case where hysteresis sysfs will be read only for a thermal >> zone when its set_trip_hyst() operation is not defined. I think it is regression after recent re-work.  If  a sensor  is registered witht thermal framework via thermal_of,  sensor driver doesn't need to  know the trip configuration and nothing to do with set_trip_hyst() in driver. Without this change, if  a sensor needs to be monitored from userspace(trip/hysteresis), it is enforcing sensor driver to add  dummy set_trip_hyst() operation. Correct me otherwise. > Which is by design. > > For some thermal zone types (eg. acpi), updating trip hysteresis via > sysfs might lead to incorrect behavior. To address this, is it okay to guard hysteresis write permission under CONFIG_THERMAL_WRITABLE_TRIPS flag ? Thanks, Manaf