Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5140429rwb; Mon, 8 Aug 2022 12:58:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR5MNmK3we0J2kcXkEnyXQgOM9pxZVC5piMmufmBn9uF7JuYfKNspN2GkN2bHC9hoKsNs6h8 X-Received: by 2002:a62:79d1:0:b0:52f:3fda:c3e1 with SMTP id u200-20020a6279d1000000b0052f3fdac3e1mr6615361pfc.71.1659988704661; Mon, 08 Aug 2022 12:58:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659988704; cv=none; d=google.com; s=arc-20160816; b=flsv5inOQjjMHqf7Kiz3KWLo+R3122FD1C6dJ1GnuKCnKVg807qrz1hXP8Lbst7Epc wweeHYy3nQp1VttPkunwKMtEv9PvUtN716gVnu0zqeOz9n1meQT1MrJ+JZgd8ExUuwqg DJswAd2sk/DhT0d8nwHVancf264sUCj8rzQ8kW39qP+VxBm73YT6AJclhVYUlv6BOIEd 5zj7mfH3CjUCybq+vNABORlV0a0LRh/javS0c45MaQQ8t31Mra2cqD7XJZDiTMzVtd30 IH0FBYpcSWJdJWSHs14PmkZLLRbL3iv7uK+px/Dm59fn0/lvT1Xj3X+/DLS4CzOeOxNa Y/gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=6PcikS8QTWzyBcGDXFze41ukd1XEOnadcRVXN190DHY=; b=YWyvKqB85DES3CJA7oxhg7ndR6ZglExMoPjVNBaxo9wzJSbyF+GhV/1KDvuCrFN2IZ uaTSNqWqLNZzyIrf35CYwFd04jLfIChzqZTsKk13Pp+pAaR0sKy7cd5LCPdYthK2S1q8 TnoiRrwci//AQaqmun6yGTi0bCEZ/q4cJnKgXZ/FdYom83HedC7gRqZaLwiphrwuNlIx kRFLN0SRceHgpqNw30qsovnN3dD/yAac9lo4XsfzrQTeffqf27rZmiK2mZF8QYZzv8Fy CCvPsC8LUZDe9yBAOXcXyPnHYnvVuUorkDhnlDRE7FjVMJzWIdSWbeSAC1T+KGc65WXu cWpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k64-20020a638443000000b0041c19374289si7983119pgd.742.2022.08.08.12.58.09; Mon, 08 Aug 2022 12:58:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243812AbiHHThS (ORCPT + 99 others); Mon, 8 Aug 2022 15:37:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbiHHThR (ORCPT ); Mon, 8 Aug 2022 15:37:17 -0400 X-Greylist: delayed 156 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 08 Aug 2022 12:37:15 PDT Received: from smtprelay02.ispgateway.de (smtprelay02.ispgateway.de [80.67.18.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D98913DEF; Mon, 8 Aug 2022 12:37:15 -0700 (PDT) Received: from [109.90.180.58] (helo=[192.168.1.27]) by smtprelay02.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1oL8WY-0006MF-26; Mon, 08 Aug 2022 21:34:50 +0200 Message-ID: Date: Mon, 8 Aug 2022 21:34:32 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v1 23/26] thermal/drivers/acerhdf: Use generic thermal_zone_get_trip() function Content-Language: en-US To: Daniel Lezcano , rafael@kernel.org Cc: rui.zhang@intel.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Hans de Goede , Mark Gross , "open list:ACER ASPIRE ONE TEMPERATURE AND FAN DRIVER" References: <20220805145729.2491611-1-daniel.lezcano@linaro.org> <20220805145729.2491611-24-daniel.lezcano@linaro.org> From: =?UTF-8?Q?Peter_K=c3=a4stle?= In-Reply-To: <20220805145729.2491611-24-daniel.lezcano@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Df-Sender: cGV0ZXJAcGlpZS5uZXQ= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, some comments. Please merge if those are considered. Thanks. On 05.08.22 16:57, Daniel Lezcano wrote: > The thermal framework gives the possibility to register the trip > points with the thermal zone. When that is done, no get_trip_* ops are > needed and they can be removed. > > Convert ops content logic into generic trip points and register them with the > thermal zone. > > Signed-off-by: Daniel Lezcano Acked-by: Peter Kästle > --- > drivers/platform/x86/acerhdf.c | 73 ++++++++++++---------------------- > 1 file changed, 26 insertions(+), 47 deletions(-) > > diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c > index 3463629f8764..cf757f3a1e6b 100644 > --- a/drivers/platform/x86/acerhdf.c > +++ b/drivers/platform/x86/acerhdf.c [...] > @@ -137,6 +139,15 @@ struct ctrl_settings { > int mcmd_enable; > }; > > +static struct thermal_trip trips[] = { > + [0] = { .temperature = ACERHDF_DEFAULT_TEMP_FANON, > + .hysteresis = ACERHDF_DEFAULT_TEMP_FANON - ACERHDF_DEFAULT_TEMP_FANOFF, > + .type = THERMAL_TRIP_ACTIVE }, > + > + [1] = { .temperature = ACERHDF_TEMP_CRIT, > + .type = THERMAL_TRIP_CRITICAL } > +}; > + > static struct ctrl_settings ctrl_cfg __read_mostly; > > /* Register addresses and values for different BIOS versions */ > @@ -326,6 +337,15 @@ static void acerhdf_check_param(struct thermal_zone_device *thermal) > fanon = ACERHDF_MAX_FANON; > } > > + if (fanon < fanoff) { > + pr_err("fanoff temperature (%d) is above fanon temperature (%d), clamping to %d\n", > + fanoff, fanon, fanon); > + fanoff = fanon; > + }; > + Tab whitespace, please remove. > + trips[0].temperature = fanon; > + trips[0].hysteresis = fanon - fanoff; > + Tab whitespace, please remove > if (kernelmode && prev_interval != interval) { > if (interval > ACERHDF_MAX_INTERVAL) { > pr_err("interval too high, set to %d\n", I don't know the current behavior of the thermal layer well enough. Is it ensured, that those new trips[0].temperature / trips[0].hysteresis values are taken into account? -- best regards, --peter;