Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp956805rdd; Wed, 10 Jan 2024 04:49:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IGDfIoJj+H/szIKx3EmQR5Olg+b+DhXQeQs8F/SPWL+LoNukji4TU7Ig8qtqUnS4z82zjAK X-Received: by 2002:a05:6214:c6b:b0:680:fee4:2a58 with SMTP id t11-20020a0562140c6b00b00680fee42a58mr6660qvj.44.1704890949872; Wed, 10 Jan 2024 04:49:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704890949; cv=none; d=google.com; s=arc-20160816; b=qWNUVgo3y/J+g/ETc9u11iC0wyvy50W8o+LRDursR9gT0AXTH8N4ZQ2CZblyOPdna0 LlCqgKR1eWL9B8ao5PONYN4iHazIwLV7cAyHbP5pMbpWCABievwoXrg9cPQRFo0oFm94 3mzm8h62d3rmUcHtexw1E+xLwMBwb/aOzjmPugTWOeL+FbB8mYDTxs9aAuUg3aI1XJ3b DUVNSsxu3s77mKGibiCqdyNmE2D6k/wV5u6P9+J1r2L9NfZZAcRN41jLMpZVsxoA2x6R XVs1iqaKJ3jOWDIcvJ7jxWYbyiib1OWxXbuvbn1K+8ep0fyAdafL5FFqQKF/yVEjlREu cF7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=O7wdR/Eyk4uZr26rU209ZZ1Q0iKlXSFwBwzNCr/1V7s=; fh=GgX1HoeOWQc9tFsVYIARAUsSXABbDbESagcEsVKs2rI=; b=m5sgm4WmGILIjh7KBfmGnVsmhXZFPE4eDq5HinufgkZhFSXPx9xJdqcFHG0+8xLsQB vI3D0dVlaEeNvOm/r2vD+IBj4fFPJCq6aIvjoyyW339Id3VpHtkb3IqKpo30IB1y9bcs PHDIEvLSRJVTpxRKwm/1vL8UV8YdaytFeSXoPdC4kpdhKWRrrd4ishApafWhcw117ZEo lt1MCIRTlYmuZX7XnFhFfq3RVcIrZV+4UkTa2Yi+UtuaFmjLM7ccmwIajczgiV1WYnFJ hX53b8PU7Lb7y4JzJDSaD9JuSQB0PXemEsoY01puxLTRlRtmjQv6ZRT1hu3TF/iKRj43 Vjew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-22184-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22184-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v9-20020a0c8e09000000b0067f93555f82si4205406qvb.538.2024.01.10.04.49.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 04:49:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22184-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-22184-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22184-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9E1EA1C223A4 for ; Wed, 10 Jan 2024 12:49:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42297482FC; Wed, 10 Jan 2024 12:49:02 +0000 (UTC) Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (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 76760481BB; Wed, 10 Jan 2024 12:49:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-6ddf73f0799so114026a34.1; Wed, 10 Jan 2024 04:49:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704890939; x=1705495739; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O7wdR/Eyk4uZr26rU209ZZ1Q0iKlXSFwBwzNCr/1V7s=; b=YnxaX9gnXkVxz7pPvXCzGjhIFfnyNEaGErYNbDhUa9d7/uTucN/nleC9GU5NPt+9jv cUtkDYkDH+EbBdibXNxAq6LOgs2ulQqb71ne6ovYbjoV8RytgmojiZecBY31hl/Qibyu FPQD+rhxEiZnmDqxQaIk45jRmhQiL0kH2GzG0LK1rs4UK7EFcLhpl+8BBssHLxISF1rZ lIytbR2L1zMDshEQI4VhZwDizur7zmrqEn3J/OSIocz/hlU3+hF2E3qa/KwLjDp48ZF8 0Z3Ql+5xeyZHKKomHR8N1SQhYQU2l4KLpdV9E9xrm+JSJ5fH51YVzi3Y+PJddcHVcndp MN+A== X-Gm-Message-State: AOJu0YzL6P7o0JPxibg8Fi5H3sRhPTHW9glWDBI6KuC6f0Tb2QI4iZCk Ks0vO5WuzWTsvVHT20HumvBr/Ym2Q3rIMCIQ5u0= X-Received: by 2002:a4a:e1b5:0:b0:598:76c6:7085 with SMTP id 21-20020a4ae1b5000000b0059876c67085mr1827065ooy.1.1704890939515; Wed, 10 Jan 2024 04:48:59 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240106191502.29126-1-quic_manafm@quicinc.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Wed, 10 Jan 2024 13:48:47 +0100 Message-ID: Subject: Re: [PATCH] thermal/sysfs: Always enable hysteresis write support To: Manaf Meethalavalappu Pallikunhi Cc: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Manaf, On Wed, Jan 10, 2024 at 9:17=E2=80=AFAM Manaf Meethalavalappu Pallikunhi wrote: > > Hi Rafael, > > On 1/9/2024 7:12 PM, Rafael J. Wysocki wrote: > > On Sat, Jan 6, 2024 at 8:16=E2=80=AFPM 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. > > Which is by design. > > I think it is regression after recent re-work. If a sensor is registered = with 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(tri= p/hysteresis), What exactly do you mean by "monitored" here? > it is enforcing sensor driver to add dummy set_trip_hyst() operation. Co= rrect me otherwise With the current design, whether or not trip properties can be updated by user space is a thermal zone property expressed by the presence of the set_trip_* operations, so yes, whoever registers the thermal zone needs to provide those so that user space can update the trip properties. > For some thermal zone types (eg. acpi), updating trip hysteresis via > sysfs might lead to incorrect behavior. > > To address this issue, is it okay to guard hysteresis write permission = under CONFIG_THERMAL_WRITABLE_TRIPS defconfig ? Not really, because it would affect all of the thermal zones then. TBH, the exact scenario in which user space needs to update trip hysteresis is not particularly clear to me, so can you provide some more details, please? Thanks!