Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp346725rdb; Thu, 22 Feb 2024 05:48:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUd7c2iqP/ZjjvTM0ckIzIMXIkvvZRktIMzz7E5Yja1J+iX6z4YFTPPg+hH6uaZAy/Hf3z5B0d06VGuMm7p9UfuggjUn1Q012awqkV9bw== X-Google-Smtp-Source: AGHT+IG3xCHG0iOI7XOeadu5Ph/nbASysast8+qdAy4KvIjJs6eucA3c+m47aiS/AHCsBae7qgZi X-Received: by 2002:a05:620a:44d6:b0:785:c9d1:8636 with SMTP id y22-20020a05620a44d600b00785c9d18636mr26407787qkp.59.1708609736540; Thu, 22 Feb 2024 05:48:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708609736; cv=pass; d=google.com; s=arc-20160816; b=sKPVLTDJNTVfc+M3Ke3KHRiBCU/PaDK79ifILr34ayRiKJnAmZFlCXz/5DygaM4R+v btFDe4VjIZQsV0jk2i6QRem98AFx7Dzet+kF4lsrnslHXs2h8ofUcrNjOyWSrB9NmDXs 6xAg98Bje8c2Cxlzsk3jR02n0+mCOUNXK5VOyfOSW/SGeqRuWXCOaxBYHai8GRPRwd0J rAGBOVzG34bXPX4mBingcLjj+cpLohL7WftHMcgCRd7Z9gghIi2BvEgzssbdLdHPfOmo mVkdy5BPM4xQAWbcxD+mHJM0B2oOlgdNSOGCDwBGKEx3fIxjpXeR+wlvPWeePHxUr44M 2DmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=pq7QWWU9M0E6N32mIV1CNOQHREQMEJTHwJ9hCgn89sY=; fh=HPYTmZZWrcuBOudhGCu5+DQj9whefW4Qab4MrY8JAQ8=; b=CP8Vn3VBNBo/3m7vhctk1X2kgg+kh99DrzrJkL7bvLIbAHz9ejUs79L27OklKZSegu AT6eBs8/eCDdAcI/IFq6ZZ/DZASvEaMmEtvBnIwC2WqugOLJjSt7d24RHrWifkOXIEtX VY0j0O2jwDZwYIw/JfCJ6mIwvgYRriTbpQRHI2s0NXPHreQyDZXYJKFKhTNhroQnr4tu TE4q4+JZ9T8jwJ9eeMUeMVQiiMpB0Jtmzadoi8m+DlT9SZvDFTEDVtSZdli5bDOG4fgK DXvvVOZ8KNWrPvz5p99aDZc8paI0xPqZAvkUbTZpg6JhY4AIgbt5y0I2hnRaDS6fh611 Dbyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GeaMut06; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-wireless+bounces-3924-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3924-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id j29-20020a05620a001d00b00785d6d13172si12828209qki.164.2024.02.22.05.48.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 05:48:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3924-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; dkim=pass header.i=@linaro.org header.s=google header.b=GeaMut06; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-wireless+bounces-3924-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3924-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 260D71C22397 for ; Thu, 22 Feb 2024 13:48:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCD891353EA; Thu, 22 Feb 2024 13:48:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="GeaMut06" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (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 A7E6858ADF for ; Thu, 22 Feb 2024 13:48:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708609725; cv=none; b=Fz76DwoKU9PIeF2puB9mcUMnf5VyLOMxgK3NSjDjGxS9DmWIPvKujNypjmqYQOgvO9xUjotA5TmaaG1yGssRwwe+clVp5vC7EsdYndLdF746/DtyUoZPxNs2JYsdcSRHbCgJsVSbhzw+cVy54pV8ZknLLcSExA+u/vGprfL2SvE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708609725; c=relaxed/simple; bh=Y6TgWPLINj7D8BQDnroVZ+T+LDIQasr9m7F1MIYp16M=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=an4dwLsIA39kf3tiBTWnWXd/KQWU4l9M9sDjskUSFWx+Yu3+Ux8HM2TUPyIBL26uTOtVR5Fezh33wBb3kUvtqkbLdXg/GGWNi1hEgslEZVhrcwU54R4nv1PhS/WcRqGwmKehSnN9ofv00hL+8oX0bkqXWPiIw4LxUEDPIyJ9PeA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=GeaMut06; arc=none smtp.client-ip=209.85.208.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2d26227d508so6669541fa.2 for ; Thu, 22 Feb 2024 05:48:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708609721; x=1709214521; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=pq7QWWU9M0E6N32mIV1CNOQHREQMEJTHwJ9hCgn89sY=; b=GeaMut06EpulYKeYJGsgRzXEwy8m+UnEuuuVN6iqS+mRzO/0xc2a2Bd+g0ntcSKrAr LK0dNww7n6tju7qUAACQFD35tV4tq5Z33TRLdu5FbaBPIaTvi5ZUvXj31pG9zqEpzquA M2t8vWVqygvHLY0sWpx37RRzFDDTQcVi/pE77ZhQFGouYBx6mSKGj4zwSiMQofsI/glf Dqog2cgVDnwa8F3EMqpct3WPt/HR+MesTfitn/2U3DJuoHSjW0p5osDZ6r+zg9XmmbFY obyL22y/VarX7o2ko3RfPoaIeUcyTDdRZv9vW82gS29gyswxRLCZzTgYmIV0mqDp2DfU 8qEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708609721; x=1709214521; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pq7QWWU9M0E6N32mIV1CNOQHREQMEJTHwJ9hCgn89sY=; b=ZBVfFx6P+Pn7vP/WNOyAr7uyWFON7AML0Acz7RykbQgJtvCJcrbZZrnQOX0C202v5H ZywvuDRgZoRc0URlr7pn05jML64jJNzURwOTe36kvMzjira6gMk4NxIvqt6XT43MRPOF 1JCoGiqN/KBnAJ0bOie77PFQ8DU3AZr1oavYgCH7NIuIoFva+vTpv4bgejtkdF+QzY6k B6uj9MzFS7fyMlmXBXfiWbAHPFaes1WDRat99CCdVbW8jWh3UOC74zjqPURuZJCPNFz+ a1cfV+lEMCyDehtxowGTx7ABXgH9eaWXjcTOSoao6Q04BRPGppQtRvVxtmJ1gWWi4d2u O5fg== X-Forwarded-Encrypted: i=1; AJvYcCVUkhuRPzLn2VBvIiOxM41Ujl+Zpv7e6V8dRUS45disDxIYO6Mo//yDOB8nSE1809Zdl7R4B+EePfnlIt3nSyR4qzvzBtGtNA65icDZHNg= X-Gm-Message-State: AOJu0YzEDr97X5rUSIqGiz9g+2k7vsRtMyG+V1YmHASmfwS1w9YJ1SR1 PEAyUtLM9QrtaOuGV6vCHOFMemXqOtO9OEK2BGJlE3ICsxODKG7uX7V8ldA4C0o= X-Received: by 2002:a2e:9256:0:b0:2d2:51c9:ef4e with SMTP id v22-20020a2e9256000000b002d251c9ef4emr3575102ljg.11.1708609720807; Thu, 22 Feb 2024 05:48:40 -0800 (PST) Received: from [192.168.10.46] (146725694.box.freepro.com. [130.180.211.218]) by smtp.googlemail.com with ESMTPSA id r11-20020a05600c35cb00b004120537210esm6505491wmq.46.2024.02.22.05.48.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Feb 2024 05:48:40 -0800 (PST) Message-ID: Date: Thu, 22 Feb 2024 14:48:39 +0100 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 8/9] thermal: of: Set THERMAL_TRIP_FLAG_RW_TEMP directly Content-Language: en-US To: "Rafael J. Wysocki" , Linux PM Cc: Lukasz Luba , LKML , Stanislaw Gruszka , Srinivas Pandruvada , Zhang Rui , netdev@vger.kernel.org, Ido Schimmel , Petr Machata , Miri Korenblit , linux-wireless@vger.kernel.org, Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Manaf Meethalavalappu Pallikunhi References: <6017196.lOV4Wx5bFT@kreacher> <9235101.CDJkKcVGEf@kreacher> From: Daniel Lezcano In-Reply-To: <9235101.CDJkKcVGEf@kreacher> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 12/02/2024 19:40, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > It is now possible to flag trip points with THERMAL_TRIP_FLAG_RW_TEMP > to allow their temperature to be set from user space via sysfs instead > of using a nonzero writable trips mask during thermal zone registration, > so make the OF thermal code do that. > > No intentional functional impact. > > Note that this change is requisite for dropping the mask argument from > thermal_zone_device_register_with_trips() going forward. > > Signed-off-by: Rafael J. Wysocki > --- > > v1 -> v2: Rename trip flag (Stanislaw). > > --- > drivers/thermal/thermal_of.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > Index: linux-pm/drivers/thermal/thermal_of.c > =================================================================== > --- linux-pm.orig/drivers/thermal/thermal_of.c > +++ linux-pm/drivers/thermal/thermal_of.c > @@ -117,6 +117,8 @@ static int thermal_of_populate_trip(stru > return ret; > } > > + trip->flags = THERMAL_TRIP_FLAG_RW_TEMP; > + > return 0; > } Even if you are not at the origin of this default behavior. I'm wondering if we should be more protective against changes from userspace when the firmware is telling us to protect the silicon at a specific temperature. What do you think if we set the THERMAL_TRIP_FLAG_RW_TEMP only if the trip point is not bound to a cooling device? So trip points without associated cooling device can be writable but others can be considered as managed by the kernel and no modifiable. (This comment does not put in question this patch BTW) > @@ -477,7 +479,7 @@ static struct thermal_zone_device *therm > struct device_node *np; > const char *action; > int delay, pdelay; > - int ntrips, mask; > + int ntrips; > int ret; > > of_ops = kmemdup(ops, sizeof(*ops), GFP_KERNEL); > @@ -510,15 +512,13 @@ static struct thermal_zone_device *therm > of_ops->bind = thermal_of_bind; > of_ops->unbind = thermal_of_unbind; > > - mask = GENMASK_ULL((ntrips) - 1, 0); > - > ret = of_property_read_string(np, "critical-action", &action); > if (!ret) > if (!of_ops->critical && !strcasecmp(action, "reboot")) > of_ops->critical = thermal_zone_device_critical_reboot; > > tz = thermal_zone_device_register_with_trips(np->name, trips, ntrips, > - mask, data, of_ops, &tzp, > + 0, data, of_ops, &tzp, > pdelay, delay); > if (IS_ERR(tz)) { > ret = PTR_ERR(tz); > > > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog