From patchwork Mon Dec 14 23:38:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 343586 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3431839jai; Mon, 14 Dec 2020 15:40:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJygP4DCiEW05nt1heSEJg44ZfbeLHcWCVbdxK+WiGIsrCF4teotyXb8f79oWFXI9Art4bFH X-Received: by 2002:a17:906:f0d0:: with SMTP id dk16mr24634310ejb.144.1607989230560; Mon, 14 Dec 2020 15:40:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607989230; cv=none; d=google.com; s=arc-20160816; b=1LWBdws27SPTShJEBRPIiEk2iUX57buQg0tUpj8MX7lqTBOkCbvV4uaYOIiIgqvUmo aD4yKl/e8TgzKKOB3n+D3pyiPVfjaWWzyJlGIyWvWVuanDFTO0mhzVApU5lCIi1+ivz8 393s//uV7TwXdqcAu+S9yXdyNIhab8cU1MYavYyub4sSSds7oBBqMDip2K5mlk/1sZJ7 0XqxZY09pqAIzoHZ0/vU2caZOEBDXY06RlIPARqETtDHIpMgKATW55Yh+nXxMSI2KlT9 Xmr+g7OJrfpo9WD7QP+awBKuqI21Q4CFxv617pjiw/zOVjrBBWRkBwQtRmdCUQvCwdW3 nV9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=26F5bU6HzmYDlPPEyiuAM3Eq9TxTugaHeptJZ4C0SqU=; b=1EM4nX7SKY/H0f8GiUNcSjKcRKO/dqc0b4vWcoQ2kR2yiQL36B/CmpNghu+DpvrUhf +Z85W924f4o6uOi8E3JXyyDW24dufxaCM5J8VM736eUFqgXDiD4jVSfUzeGcNeFI2WeF kppE3kWa1nvp6r2G6r+f++IwOM85GMNQDmAqkMsk6jHQKuZrFM6EvNrlBCQ+TV0b1d9g 6vwYH9Nbl1I8PfDYtFfTNUJDPY9bxi7ceWbiNvNkJ4J0bUGcXyq/LJX0seBwVm9lsOJ8 Ny+ACYGPu5zDe0VmAkV/EJ76gehjjghVrLpXyB2qvcN70DIfGbrdTCxap1UpdhIGSlLH 8E3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tJyvxhlI; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i7si70138eds.423.2020.12.14.15.40.30; Mon, 14 Dec 2020 15:40:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tJyvxhlI; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725856AbgLNXk2 (ORCPT + 8 others); Mon, 14 Dec 2020 18:40:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725763AbgLNXk2 (ORCPT ); Mon, 14 Dec 2020 18:40:28 -0500 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E11C6C06179C for ; Mon, 14 Dec 2020 15:39:47 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id c133so3271009wme.4 for ; Mon, 14 Dec 2020 15:39:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=26F5bU6HzmYDlPPEyiuAM3Eq9TxTugaHeptJZ4C0SqU=; b=tJyvxhlIUERBUJEVvnukQdpKelK1ioR8LBIevf5H4JxcTsYTmFPRYVH0I8Lt3g2ee7 RqtHXgIPskDnsNyuWS1Y0CKCAy97IRxpj5kndO0KreWrtXKzJeWgfx/RUqS2zaWhES7w WTYynE4Y4+NAqU72or5rkzBDifYFJLLfbhnYdKkRSiYpSCsqVe8ROt0K2AUCS0GCKdXC 5cTrEJ9eao5srLwO3sebCFPVjasGZC4iaaRcctmrgC5NE4ZySUNDgsBccvVkys4FvpoO FkFvDFtxUP23+yD/k6B+xLw6QRnUgj8LwmtjZkPZh7nXme+xLJDWDSvEDKXzF2sImZb0 6hEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=26F5bU6HzmYDlPPEyiuAM3Eq9TxTugaHeptJZ4C0SqU=; b=hzuTFNFRFN7nUBo1vhRTk/tOO68e6Nqq9U5pbw+XTJQfZInATRkcfOSD+EJSpyGC4z 9f7PiJEuLMoWjfRt3gnCgFcK1Ii150EzFO5jauA59i1SBeI0Ny7XatK2gyO6WwwzPQuc 8a7hCxZEBeds79x6P6yXwgAwiOCmg32Ob1Vko5zSto9yfOv4qhTBDeUrOA8HFvFl7JmE z/9k7aDOFa1RTr7tA5HW88SgwhKnrPxdg7If5ngac0dN6jDcf0DQhJKmK08QjxwpKFKL IXWIT0/+pwt9vVHfGp6ouwtEnTWpZBBwZUEfLWvR3pjMZzSl9nJezHmcQto3weC2DXyZ +weA== X-Gm-Message-State: AOAM532UoBRlER7+Tb07+d0WyawBNfdgY50PIhCtJ9B8y0tL9ICYsqPC lLYALUZnujP9yOv6GjlNnzz4SA== X-Received: by 2002:a05:600c:2057:: with SMTP id p23mr29686434wmg.109.1607989186511; Mon, 14 Dec 2020 15:39:46 -0800 (PST) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:e842:4086:6f24:55a6]) by smtp.gmail.com with ESMTPSA id h3sm34145075wmm.4.2020.12.14.15.39.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 15:39:45 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: mjg59@codon.org.uk, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, amitk@kernel.org, thara.gopinath@linaro.org, Jonathan Corbet , Viresh Kumar , linux-doc@vger.kernel.org (open list:DOCUMENTATION) Subject: [PATCH 1/6] thermal/core: Remove the 'forced_passive' option Date: Tue, 15 Dec 2020 00:38:04 +0100 Message-Id: <20201214233811.485669-1-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The code was reorganized in 2012 with the commit 0c01ebbfd3caf1. The main change is a loop on the trip points array and a unconditional call to the throttle() ops of the governors for each of them even if the trip temperature is not reached yet. With this change, the 'forced_passive' is no longer checked in the thermal_zone_device_update() function but in the step wise governor's throttle() callback. As the force_passive does no belong to the trip point array, the thermal_zone_device_update() can not compare with the specified passive temperature, thus does not detect the passive limit has been crossed. Consequently, throttle() is never called and the 'forced_passive' branch is unreached. In addition, the default processor cooling device is not automatically bound to the thermal zone if there is not passive trip point, thus the 'forced_passive' can not operate. If there is an active trip point, then the throttle function will be called to mitigate at this temperature and the 'forced_passive' will override the mitigation of the active trip point in this case but with the default cooling device bound to the thermal zone, so usually a fan, and that is not a passive cooling effect. Given the regression exists since more than 8 years, nobody complained and at the best of my knowledge there is no bug open in https://bugzilla.kernel.org, it is reasonable to say it is unused. Remove the 'forced_passive' related code. Signed-off-by: Daniel Lezcano --- .../driver-api/thermal/sysfs-api.rst | 13 --- drivers/thermal/gov_step_wise.c | 14 +--- drivers/thermal/thermal_sysfs.c | 80 ------------------- include/linux/thermal.h | 4 - 4 files changed, 3 insertions(+), 108 deletions(-) -- 2.25.1 Reviewed-by: Thara Gopinath diff --git a/Documentation/driver-api/thermal/sysfs-api.rst b/Documentation/driver-api/thermal/sysfs-api.rst index e7520cb439ac..a4969c474cc3 100644 --- a/Documentation/driver-api/thermal/sysfs-api.rst +++ b/Documentation/driver-api/thermal/sysfs-api.rst @@ -520,19 +520,6 @@ available_policies RW, Optional -passive - Attribute is only present for zones in which the passive cooling - policy is not supported by native thermal driver. Default is zero - and can be set to a temperature (in millidegrees) to enable a - passive trip point for the zone. Activation is done by polling with - an interval of 1 second. - - Unit: millidegrees Celsius - - Valid values: 0 (disabled) or greater than 1000 - - RW, Optional - emul_temp Interface to set the emulated temperature method in thermal zone (sensor). After setting this temperature, the thermal zone may pass diff --git a/drivers/thermal/gov_step_wise.c b/drivers/thermal/gov_step_wise.c index 2ae7198d3067..12acb12aac50 100644 --- a/drivers/thermal/gov_step_wise.c +++ b/drivers/thermal/gov_step_wise.c @@ -109,7 +109,7 @@ static void update_passive_instance(struct thermal_zone_device *tz, * If value is +1, activate a passive instance. * If value is -1, deactivate a passive instance. */ - if (type == THERMAL_TRIP_PASSIVE || type == THERMAL_TRIPS_NONE) + if (type == THERMAL_TRIP_PASSIVE) tz->passive += value; } @@ -122,13 +122,8 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip) bool throttle = false; int old_target; - if (trip == THERMAL_TRIPS_NONE) { - trip_temp = tz->forced_passive; - trip_type = THERMAL_TRIPS_NONE; - } else { - tz->ops->get_trip_temp(tz, trip, &trip_temp); - tz->ops->get_trip_type(tz, trip, &trip_type); - } + tz->ops->get_trip_temp(tz, trip, &trip_temp); + tz->ops->get_trip_type(tz, trip, &trip_type); trend = get_tz_trend(tz, trip); @@ -189,9 +184,6 @@ static int step_wise_throttle(struct thermal_zone_device *tz, int trip) thermal_zone_trip_update(tz, trip); - if (tz->forced_passive) - thermal_zone_trip_update(tz, THERMAL_TRIPS_NONE); - mutex_lock(&tz->lock); list_for_each_entry(instance, &tz->thermal_instances, tz_node) diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c index 0866e949339b..4e7f9e880d76 100644 --- a/drivers/thermal/thermal_sysfs.c +++ b/drivers/thermal/thermal_sysfs.c @@ -216,49 +216,6 @@ trip_point_hyst_show(struct device *dev, struct device_attribute *attr, return ret ? ret : sprintf(buf, "%d\n", temperature); } -static ssize_t -passive_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) -{ - struct thermal_zone_device *tz = to_thermal_zone(dev); - int state; - - if (sscanf(buf, "%d\n", &state) != 1) - return -EINVAL; - - /* sanity check: values below 1000 millicelcius don't make sense - * and can cause the system to go into a thermal heart attack - */ - if (state && state < 1000) - return -EINVAL; - - if (state && !tz->forced_passive) { - if (!tz->passive_delay) - tz->passive_delay = 1000; - thermal_zone_device_rebind_exception(tz, "Processor", - sizeof("Processor")); - } else if (!state && tz->forced_passive) { - tz->passive_delay = 0; - thermal_zone_device_unbind_exception(tz, "Processor", - sizeof("Processor")); - } - - tz->forced_passive = state; - - thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED); - - return count; -} - -static ssize_t -passive_show(struct device *dev, struct device_attribute *attr, - char *buf) -{ - struct thermal_zone_device *tz = to_thermal_zone(dev); - - return sprintf(buf, "%d\n", tz->forced_passive); -} - static ssize_t policy_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) @@ -403,7 +360,6 @@ static DEVICE_ATTR_RW(sustainable_power); /* These thermal zone device attributes are created based on conditions */ static DEVICE_ATTR_RW(mode); -static DEVICE_ATTR_RW(passive); /* These attributes are unconditionally added to a thermal zone */ static struct attribute *thermal_zone_dev_attrs[] = { @@ -438,45 +394,9 @@ static const struct attribute_group thermal_zone_mode_attribute_group = { .attrs = thermal_zone_mode_attrs, }; -/* We expose passive only if passive trips are present */ -static struct attribute *thermal_zone_passive_attrs[] = { - &dev_attr_passive.attr, - NULL, -}; - -static umode_t thermal_zone_passive_is_visible(struct kobject *kobj, - struct attribute *attr, - int attrno) -{ - struct device *dev = kobj_to_dev(kobj); - struct thermal_zone_device *tz; - enum thermal_trip_type trip_type; - int count, passive = 0; - - tz = container_of(dev, struct thermal_zone_device, device); - - for (count = 0; count < tz->trips && !passive; count++) { - tz->ops->get_trip_type(tz, count, &trip_type); - - if (trip_type == THERMAL_TRIP_PASSIVE) - passive = 1; - } - - if (!passive) - return attr->mode; - - return 0; -} - -static const struct attribute_group thermal_zone_passive_attribute_group = { - .attrs = thermal_zone_passive_attrs, - .is_visible = thermal_zone_passive_is_visible, -}; - static const struct attribute_group *thermal_zone_attribute_groups[] = { &thermal_zone_attribute_group, &thermal_zone_mode_attribute_group, - &thermal_zone_passive_attribute_group, /* This is not NULL terminated as we create the group dynamically */ }; diff --git a/include/linux/thermal.h b/include/linux/thermal.h index c80032322158..a57232a9a6f9 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -131,9 +131,6 @@ struct thermal_cooling_device { trip point. * @prev_high_trip: the above current temperature if you've crossed a passive trip point. - * @forced_passive: If > 0, temperature at which to switch on all ACPI - * processor cooling devices. Currently only used by the - * step-wise governor. * @need_update: if equals 1, thermal_zone_device_update needs to be invoked. * @ops: operations this &thermal_zone_device supports * @tzp: thermal zone parameters @@ -167,7 +164,6 @@ struct thermal_zone_device { int passive; int prev_low_trip; int prev_high_trip; - unsigned int forced_passive; atomic_t need_update; struct thermal_zone_device_ops *ops; struct thermal_zone_params *tzp; From patchwork Mon Dec 14 23:38:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 343588 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3432494jai; Mon, 14 Dec 2020 15:41:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJxPJWEoVT0RJmJ517RfY5TSzIVM0tsg4tVBtkbHa67PnM6GXDcGFr5Z22sVAr8+ztyeqEY0 X-Received: by 2002:a17:906:3c04:: with SMTP id h4mr24057146ejg.220.1607989308965; Mon, 14 Dec 2020 15:41:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607989308; cv=none; d=google.com; s=arc-20160816; b=VHcXtB1ghKJJkFm97+jAxxuqKdzv0BkBEGHR74SkoBqtswlQGfh9sgkokdlbqOJThl c3Es98AllsFgRtHs3mladdsOzyszRnPywtiMojAl8pmT4Ddb/bWKF6PfNTj8RdOU2hhc vbva8+wkIk0Ngkp32sTIjrSFC1GZcMERFoabVTLGwhnHYupwxxS7BkObf4Id4yrZceyt k22foSDcziltBJStYPChhLBZdNDGj6V0V3gDjWhi8AskzbmcUH7VcTgt0/G9dTRmNafH QOQlwt+XhpACdbuEDa3/BC03D2TKPLRx5AitrrT9zl4dZ/72HSVTkARmx2jh6GX3Xb40 VIiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=365sGsgJNcvgkVzei9+4ZgSu6iZEYSl+7/l7/Wor6X4=; b=g/hkyYB9cPjmz96equhWY6MrAbHZ/kKbEizk5PZNpI9WL4ta+iU7YZllfG356HoMuN ItwLy4KOx8w0/BDSVGDiJY9Wsl6hqjQjJ7UUjPZTm1CgQVOKG07pIzdFiMFOtjWZdBNK QRVSHv1VAdLpgFnA/ssHPDlf/8KxyWCJhDlb0TMV6gYY/ysthYUW77B1eBpi8t2qnlvR 9C5h6QdaEy9RDp1/sC09XC8jT7FHo+innRLbyfpi9tEYZUi5rXVhvSkGIaSs6uX+E3qA uqzA9Fx0xv/FNr2+xkwX06pSQXWiz+TdBpkhoPmKkM2kcRY7KaAH6Mvhap4pHP6aPDZs i4Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="IJ/I+X0H"; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r3si19101ejc.166.2020.12.14.15.41.48; Mon, 14 Dec 2020 15:41:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="IJ/I+X0H"; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726643AbgLNXlB (ORCPT + 8 others); Mon, 14 Dec 2020 18:41:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726347AbgLNXk5 (ORCPT ); Mon, 14 Dec 2020 18:40:57 -0500 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99828C06138C for ; Mon, 14 Dec 2020 15:40:00 -0800 (PST) Received: by mail-wm1-x341.google.com with SMTP id a6so15282099wmc.2 for ; Mon, 14 Dec 2020 15:40:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=365sGsgJNcvgkVzei9+4ZgSu6iZEYSl+7/l7/Wor6X4=; b=IJ/I+X0HMVRT5A2fpWqr8R0hwgyYg5m5wPjgcUTbuOIurubce0Hq34PjQ/pvejV+qD F8HnNcPy9isnlqUQXotXE4Hq6DLqcXDT79PJDh3Ftxad+OgH03L1Xi7SM7nKJL3yNsLz xaO9LxgcgBT8JSC6h+2/P7fjVxMr+EZ49aq4cY8K6Q/bjWQTPe2wQj+feDCbCQ6LYCcA dfkgHiXz6bZw8+2BFL8n46v5ON3IvCBqZkoODDGSNRH8YFILYlbRUvjTM602e7+LxP4w YiSz6JuFm8MNhpoMNahZlbn1+dU0/1tE6S2HDVbuM1RjmtMN/pmWdV6mLoVNK+U8JbXp i9uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=365sGsgJNcvgkVzei9+4ZgSu6iZEYSl+7/l7/Wor6X4=; b=P4ASv9s6Rp7+QouoR71zWHLd7f7hjIRMd4012CUF1Zl6FK4gO1IwwW7x0p4oUbuWw4 MIJ9uR72vpY/LC0/YGlGM8EKqMSFF3hB3DR5r8GolBGFmCAw7fsqLPUsSn72USlc6Dg+ /4ui5N5eINyVtZDECXIdjsk8q61Zslx+C02imSbf+VTCD/Snuieu1N1svi9lKJTBFLUi 7DcBQRjtMJ12C1TLqlXuSg2fJPREoQMWVx3wm071RV59qBEjPt2rxAZbGHc9zFehCbfQ n4G+pHeIBKTEjk/gY660DvZaV6Wt+nlYICJh8wQSHrP1u+YhcwM6b3YJGTibw5kR8FmN kQcA== X-Gm-Message-State: AOAM531x2+Va6Vt7eh+yRS8A7ozdpFTh4hZlKsZ6GUX7ZTTeQsq+giv4 p3MSRh6dUSHTqCYx6j6So9qUng== X-Received: by 2002:a7b:c3c8:: with SMTP id t8mr29888592wmj.88.1607989199169; Mon, 14 Dec 2020 15:39:59 -0800 (PST) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:e842:4086:6f24:55a6]) by smtp.gmail.com with ESMTPSA id h3sm34145075wmm.4.2020.12.14.15.39.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 15:39:58 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: mjg59@codon.org.uk, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, amitk@kernel.org, thara.gopinath@linaro.org Subject: [PATCH 2/6] thermal/core: Remove unused functions rebind/unbind exception Date: Tue, 15 Dec 2020 00:38:05 +0100 Message-Id: <20201214233811.485669-2-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201214233811.485669-1-daniel.lezcano@linaro.org> References: <20201214233811.485669-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The functions thermal_zone_device_rebind_exception and thermal_zone_device_unbind_exception are not used from anywhere. Remove that code. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.c | 37 ---------------------------------- drivers/thermal/thermal_core.h | 4 ---- 2 files changed, 41 deletions(-) -- 2.25.1 Reviewed-by: Thara Gopinath diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 567bc6f254c0..a0f0c33c8d9c 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -598,26 +598,6 @@ static void thermal_zone_device_check(struct work_struct *work) thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED); } -void thermal_zone_device_rebind_exception(struct thermal_zone_device *tz, - const char *cdev_type, size_t size) -{ - struct thermal_cooling_device *cdev = NULL; - - mutex_lock(&thermal_list_lock); - list_for_each_entry(cdev, &thermal_cdev_list, node) { - /* skip non matching cdevs */ - if (strncmp(cdev_type, cdev->type, size)) - continue; - - /* re binding the exception matching the type pattern */ - thermal_zone_bind_cooling_device(tz, THERMAL_TRIPS_NONE, cdev, - THERMAL_NO_LIMIT, - THERMAL_NO_LIMIT, - THERMAL_WEIGHT_DEFAULT); - } - mutex_unlock(&thermal_list_lock); -} - int for_each_thermal_governor(int (*cb)(struct thermal_governor *, void *), void *data) { @@ -685,23 +665,6 @@ struct thermal_zone_device *thermal_zone_get_by_id(int id) return match; } -void thermal_zone_device_unbind_exception(struct thermal_zone_device *tz, - const char *cdev_type, size_t size) -{ - struct thermal_cooling_device *cdev = NULL; - - mutex_lock(&thermal_list_lock); - list_for_each_entry(cdev, &thermal_cdev_list, node) { - /* skip non matching cdevs */ - if (strncmp(cdev_type, cdev->type, size)) - continue; - /* unbinding the exception matching the type pattern */ - thermal_zone_unbind_cooling_device(tz, THERMAL_TRIPS_NONE, - cdev); - } - mutex_unlock(&thermal_list_lock); -} - /* * Device management section: cooling devices, zones devices, and binding * diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index 8df600fa7b79..e50c6b2909fe 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -118,10 +118,6 @@ struct thermal_instance { int thermal_register_governor(struct thermal_governor *); void thermal_unregister_governor(struct thermal_governor *); -void thermal_zone_device_rebind_exception(struct thermal_zone_device *, - const char *, size_t); -void thermal_zone_device_unbind_exception(struct thermal_zone_device *, - const char *, size_t); int thermal_zone_device_set_policy(struct thermal_zone_device *, char *); int thermal_build_list_of_policies(char *buf); From patchwork Mon Dec 14 23:38:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 343587 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3432498jai; Mon, 14 Dec 2020 15:41:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/eG3PseXOcjRkG7XW31/c85R12RgqxQ0mbOzeY9PIOh5tGZWQKIij9KCYhnva0qqeM5yf X-Received: by 2002:a17:906:e15:: with SMTP id l21mr24783871eji.509.1607989309405; Mon, 14 Dec 2020 15:41:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607989309; cv=none; d=google.com; s=arc-20160816; b=sDLXW9qck/eyAhbe3Er7Iu008Hyul/2C85sNIQjK6YJIphbLVO4GwFyKSoXVEkr88G VFbEbVDIgAKDExT3FLAUHcjGR0WghM1YvlWSSClek22eB2oKfLPXJFLzIzNeukvR5SPr rIpWpMaqr7cpWeQIQVfvjausgzITAANmVbz5FSqQ14ezlpIxomfBQgbus88XrjDvMLtM rRQ6SJ4XjYjAxqj/7xhhmF6hM9qCP7jGfdgMdRVpavQDauJPs+zH4lala9SMp1N6IjXn kTn5ubwCkkDWCdv1pSnQWEYlCZld24Uw21lDbIDA7vijBUrbaludckB2Lm3Mx4qirObG 7O6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Vw6zXAVb14wYNaSbzDr0/nxXdw6EsBX7NJU8sXRM6aI=; b=ylokEcFkOSmMEjkR4EzPNfkoQc7tgdmeOPNTwspJjdXMsp3SVjN7cwo2UYKME8gDx0 UFni3uDcynhbe/kggb4o1QWc2/yZHhVlSmVPsRZT5VlTzkzspEhTKbELQa2EeqwnfFCN LRp2jH2agQqbzEVLhzxotqE6m/ossKEvpYWib1LIzU9ZnXcvyVMqyinkhWYpjlqexj9C FxLNGbNu3SP7Br4yFFuFAHCm8DBEiEJHGB8fyco5q0jd0/QvZFRf1FaqVXolhEti5xle 5SOGt43E8Lm/aFxhrUNe97WC1hkYmbnOPqeIX5k+8dJ86t+FAtNH0UaZMPx4S3CWptJ+ NZWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f0g8Uw1C; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r3si19101ejc.166.2020.12.14.15.41.49; Mon, 14 Dec 2020 15:41:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f0g8Uw1C; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726769AbgLNXlF (ORCPT + 8 others); Mon, 14 Dec 2020 18:41:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726686AbgLNXlD (ORCPT ); Mon, 14 Dec 2020 18:41:03 -0500 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E882DC061285 for ; Mon, 14 Dec 2020 15:40:01 -0800 (PST) Received: by mail-wm1-x342.google.com with SMTP id a3so16793499wmb.5 for ; Mon, 14 Dec 2020 15:40:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Vw6zXAVb14wYNaSbzDr0/nxXdw6EsBX7NJU8sXRM6aI=; b=f0g8Uw1Cgwv+yIrfOsY4jCzbXBoIw7JjgtgY4EsnRINvE1qvXl5DzItAGzHfavvWmx Jek0Anymic0OdGaHMyxPP5Uw0jxtUhK6dZG5a16Mzm8Jkfgijq/Og0uYX0oMIYdZRqAS Cg3ufEp08+FpYgua4YJFKbz8GYbDkDWzUZDOHQrEW3hPRsDcxK/2Hw3BSw8jVyYOoHUe VW2sGsh7HDRnK6lpYze7a5TdkAJAr5zfoMBnIyAjhjq6TpZHM3TCznwmZgd4Zw/flG7H 8xCdoJqi3YisO6ynAePqxRm2qHhVd3qTGvMsPj8aG4SSE5oHfkvf+GIWMxtpwIkfTv1L UG+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Vw6zXAVb14wYNaSbzDr0/nxXdw6EsBX7NJU8sXRM6aI=; b=gO7+7umcLFqHXZlsHCA5y9C3XonnwNnV/oam/14elCmojQYwLqJfSDjTwa5BQBtm9Z t5BIpEbvJbp82ZtypSmxNkMunq+JCEFSEZzGHgIToi9kw8v084sx24AQN/K+S/Z1m+EZ NWF8j6x9O7jbWJ0UO0MJGa7sEEkBDTSlB0Ik+bvdW2GJSyUPKiVoEQ18Kh7o81fbLB07 qZjlLn1r08NBBBUigo8b4JmoqswJe95qKeu7UcgtF2fkg0+4J44jyq395PnG9AC8t/Ue x4uXJ8xwouVRVhTzT3Eec/7N+/8LfFP8nE26fZ333+sdyl9YD5vN8Ig1ATtnZlbU9wvy gk3g== X-Gm-Message-State: AOAM533Jfm/BAcGJzhKc2CagVGEj6UBRUZwyQAxZ8VlbHYrC5mkaI3ES SLFYkWsoXNk4bldmtV9ZeDoybw== X-Received: by 2002:a7b:cd90:: with SMTP id y16mr30789973wmj.115.1607989200619; Mon, 14 Dec 2020 15:40:00 -0800 (PST) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:e842:4086:6f24:55a6]) by smtp.gmail.com with ESMTPSA id h3sm34145075wmm.4.2020.12.14.15.39.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 15:39:59 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: mjg59@codon.org.uk, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, amitk@kernel.org, thara.gopinath@linaro.org Subject: [PATCH 3/6] thermal/core: Remove pointless test with the THERMAL_TRIPS_NONE macro Date: Tue, 15 Dec 2020 00:38:06 +0100 Message-Id: <20201214233811.485669-3-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201214233811.485669-1-daniel.lezcano@linaro.org> References: <20201214233811.485669-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The THERMAL_TRIPS_NONE is equal to -1, it is pointless to do a conversion in this function. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_sysfs.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- 2.25.1 Reviewed-by: Thara Gopinath diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c index 4e7f9e880d76..345917a58f2f 100644 --- a/drivers/thermal/thermal_sysfs.c +++ b/drivers/thermal/thermal_sysfs.c @@ -875,10 +875,7 @@ trip_point_show(struct device *dev, struct device_attribute *attr, char *buf) instance = container_of(attr, struct thermal_instance, attr); - if (instance->trip == THERMAL_TRIPS_NONE) - return sprintf(buf, "-1\n"); - else - return sprintf(buf, "%d\n", instance->trip); + return sprintf(buf, "%d\n", instance->trip); } ssize_t From patchwork Mon Dec 14 23:38:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 344231 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FD2CC2BB9A for ; Mon, 14 Dec 2020 23:43:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5A87A225AC for ; Mon, 14 Dec 2020 23:43:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727705AbgLNXmv (ORCPT ); Mon, 14 Dec 2020 18:42:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727051AbgLNXlI (ORCPT ); Mon, 14 Dec 2020 18:41:08 -0500 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 972FDC0611C5 for ; Mon, 14 Dec 2020 15:40:03 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id y23so16821287wmi.1 for ; Mon, 14 Dec 2020 15:40:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HR6fxnctcFG0S2fOhN1StND9v+I0KlYE3gnQEW5jseo=; b=I4+ur7/JqkDvRM9rhYAD8XbIRYlOOoS5VmC+0o3cupQmlhxvVdRe5zc1ugCTN2c50N rUCImwC/t6kBthv1M2bwbWgHCayE1VisBLU4Etxmli/UZw03f3d976Ws99Ep9PcZoQDN MEXTGyToiCQh1Y6IhO6g6Y4yY7GOQveUouYtNOk1UMvM0XGxJkxPRvsqmo4UdosctfW8 pMTaP7uJMLDlFOhOd656vO7TunBRhFr32P3JgME36WPwQSkCrSJE4ldXKhOk1elfhuzc 4Ozvb0ZZLcQBBvaAv24A8g9JNIOfBNGMc+mpd1WCCDQ1ZZx8aR8mya6qP0gdMWp1jCxs EI2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HR6fxnctcFG0S2fOhN1StND9v+I0KlYE3gnQEW5jseo=; b=bticJJuhnTO4/2pxILWwYWkdvhiDS7MwXSSPHVcSs7cCirEpYaiyqQGKkMx1gQFIVn VVg5xPFnltBENl+i+rGaGaV+Ym6T0OVr0yhiLbLo7yyseT4BiaarLECp/seHzoB50Aud s0GRS1JauDito6h5eI7vCXg4m/nzmnbTeXkR9f0vxxvkF9uGodtFG8Z2NrkfBfyuMdRx K73Y+Ii1UNVngwMVPMH/bCLQUCxiERfZymMmJGPkcthhFR5BOaty96oWRKEEbU+xGPuj UUPOrmBEQ7yJsN0XNCk+8kkKAXQ50diANtaE+/tp9NHcvk05AgTXZpml9YV2Kk9UUEmj J4cA== X-Gm-Message-State: AOAM530zKAY45y11R3giGxuGJOLpbrg4cCW6qPM8KauJ13XDgY+IB85I rjkfNLjW1zIjEBDXmzaZQDNaNQ== X-Google-Smtp-Source: ABdhPJy7Yk7b8Tx5ebVkN303VPChAZspl2TDmQ7lnf4hy9dgarasNh2bFkcPl+Ftld8ZcrfTN396vA== X-Received: by 2002:a1c:81d5:: with SMTP id c204mr29695087wmd.156.1607989202159; Mon, 14 Dec 2020 15:40:02 -0800 (PST) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:e842:4086:6f24:55a6]) by smtp.gmail.com with ESMTPSA id h3sm34145075wmm.4.2020.12.14.15.40.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 15:40:01 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: mjg59@codon.org.uk, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, amitk@kernel.org, thara.gopinath@linaro.org, "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org (open list:ACPI THERMAL DRIVER) Subject: [PATCH 4/6] acpi/drivers/thermal: Remove TRIPS_NONE cooling device binding Date: Tue, 15 Dec 2020 00:38:07 +0100 Message-Id: <20201214233811.485669-4-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201214233811.485669-1-daniel.lezcano@linaro.org> References: <20201214233811.485669-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The loop is here to create default cooling device binding on the THERMAL_TRIPS_NONE number which is used to be the 'forced_passive' feature. However, we removed all code dealing with that in the thermal core, thus this binding does no longer make sense. Remove it. Signed-off-by: Daniel Lezcano Acked-by: Zhang Rui --- drivers/acpi/thermal.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index b5e4bc9e3282..26a89ff80a0e 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -764,25 +764,6 @@ static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal, } } - for (i = 0; i < tz->devices.count; i++) { - handle = tz->devices.handles[i]; - status = acpi_bus_get_device(handle, &dev); - if (ACPI_SUCCESS(status) && (dev == device)) { - if (bind) - result = thermal_zone_bind_cooling_device - (thermal, THERMAL_TRIPS_NONE, - cdev, THERMAL_NO_LIMIT, - THERMAL_NO_LIMIT, - THERMAL_WEIGHT_DEFAULT); - else - result = thermal_zone_unbind_cooling_device - (thermal, THERMAL_TRIPS_NONE, - cdev); - if (result) - goto failed; - } - } - failed: return result; } From patchwork Mon Dec 14 23:38:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 343591 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3433490jai; Mon, 14 Dec 2020 15:44:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJhxangf0HLsCU1Br4IhBsB07uq0Tou1m+0kbmdDwiT2u+3nY/LNDS+M6Lisbs3R11/4Nx X-Received: by 2002:a17:906:7f11:: with SMTP id d17mr24627607ejr.534.1607989451433; Mon, 14 Dec 2020 15:44:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607989451; cv=none; d=google.com; s=arc-20160816; b=Nwk4YtE2h+/PviC6NKfJUfkXjZDJ7Mpa48XbOISlS8nkCTInI+al2pWGJKerNYIXrR 23IMwbKPQKb/vib9wDUji/p/dz9bKKGgNilo3lz550drxWUvgNwT6vuuYt85mj0fEeX6 Wx+teipvGEeLdqoctwjLcGKhtbbM5o+1pDgehZZvdzH25WLaxhMlbsLCtvvNAvHqnIbi 44t6JAt8cf9NQF9PeWbrbfOW0k2K5f9rFlqnQydqpVnFKtKJNbjZLjhEJxHFzRicM1yX 9KJtt1PXEz4Pxq5FYWP1WDm87s/LWTDL5EHIjyEE1E6Fwhdr4b8++LjJNTwJmvcXlLOG dI5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PSByTdwbrz5R7qZA9VLp4ym5fJNRgGAvRPN2xEy9pYc=; b=QWXJUyUDL6eu7RO/n8ICRK6Ji2MuYrA37UEb88mnHS6YHB6J4QdKPY7HrbKVR9xOpY a8DvPHqs7qBtEcYZhuPXUjGTUcss4gm8v/yuV9+f3Kh4tLfHVbdPNk3jFVA1GjWw0IWq 4+4a/h5/7yQlw49oaJ+EAi1o+tiGz/7ajCjvnK8Outgu3eudoPmZlKU7khjX3TsfBRdM oMNzY5u4tYeqq3vP6sd3xhTtlKZhtlL0rdINFX3jVrRIc7H0BjOxZsf01W0E7lmX+WOW 29ulVI7LXPGCQikvkCrX9nzCFYCknhCWUtb3WBvyQq2zBbPY5QCH7TJ0jn6cPbsvLIX/ 6Msw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CZFN82uN; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e7si85377edq.202.2020.12.14.15.44.11; Mon, 14 Dec 2020 15:44:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CZFN82uN; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725948AbgLNXmw (ORCPT + 8 others); Mon, 14 Dec 2020 18:42:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727134AbgLNXlJ (ORCPT ); Mon, 14 Dec 2020 18:41:09 -0500 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C7B0C0611CC for ; Mon, 14 Dec 2020 15:40:05 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id k10so15285881wmi.3 for ; Mon, 14 Dec 2020 15:40:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PSByTdwbrz5R7qZA9VLp4ym5fJNRgGAvRPN2xEy9pYc=; b=CZFN82uNsZFeVmQ53zeRrnt1l/X2Jj8+DX5FzlDXKpXWD3WuApL+vW3EEsM+94jZXL +WetBXnywuq+Nhw9bDEicP7d+eAT/qyxjWmF3WAjpriilMWOta7OnkgnPgOhubaBPUnR pzw53cjcVpw1gTxsLR99aAPIhlwtLljL5N0KcGepVJ5OR6Ong/Hwsvy/lwnWJYUBv4fA A0T3C1fVowfp53e7/uYgiW0VTaDdMP3UTwxg2A/x0Wtel7BRu+op7E+MzcjqCqVtHW93 MkrBtSZNAISG1UDb6Cm0dNj4sGN9P+lUrocJb9pQF0/6CK80iL2OLwwvK31g2nsWsSyA EUIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PSByTdwbrz5R7qZA9VLp4ym5fJNRgGAvRPN2xEy9pYc=; b=g011Dtx+Hkwbzi1jKsNWUZfNJxQzmcy8DLzN3LA7PAXoc0rcrobvs7EBqch9B7mHfe w66mVD7soaAtILUp//bABLIUGgokrtA3DFsfOkzINKqk+i9Sg8mn/fDMuHRtlJvuM+t+ VlSldNqucpWU3wRQxL6Wm5qmn7Xc1Ce8eKlxX6togfof7gA8CCeiHii4JstKYfK0Sf30 FOQqayrZRTPkssHzgILshjq56g2buVroPGMpoJnY2Enuq6SLa51seJZ15B9iwsbaE8Lc stercpKybe000uvCSOWv9MLGeL12RSMc6KMsrCcT+sekKvZtMtWUfS0P1YNuvT3CcOHh X4IA== X-Gm-Message-State: AOAM5331nZNWM7Bx9fRV8oEETE1sDTz+TEE0J9YWu4V5OwRZPxYrEGQR 02Qv5JdQYqW+ZilHcIecpfIFuibxfK4L9Q== X-Received: by 2002:a7b:cd91:: with SMTP id y17mr29358339wmj.171.1607989203664; Mon, 14 Dec 2020 15:40:03 -0800 (PST) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:e842:4086:6f24:55a6]) by smtp.gmail.com with ESMTPSA id h3sm34145075wmm.4.2020.12.14.15.40.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 15:40:02 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: mjg59@codon.org.uk, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, amitk@kernel.org, thara.gopinath@linaro.org Subject: [PATCH 5/6] thermal/core: Remove THERMAL_TRIPS_NONE test Date: Tue, 15 Dec 2020 00:38:08 +0100 Message-Id: <20201214233811.485669-5-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201214233811.485669-1-daniel.lezcano@linaro.org> References: <20201214233811.485669-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The last site calling the thermal_zone_bind_cooling_device() function with the THERMAL_TRIPS_NONE parameter was removed. We can get rid of this test as no user of this function is calling this function with this parameter. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 Reviewed-by: Thara Gopinath diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index a0f0c33c8d9c..bcc2ea4f5482 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -710,7 +710,7 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz, unsigned long max_state; int result, ret; - if (trip >= tz->trips || (trip < 0 && trip != THERMAL_TRIPS_NONE)) + if (trip >= tz->trips || trip < 0) return -EINVAL; list_for_each_entry(pos1, &thermal_tz_list, node) { From patchwork Mon Dec 14 23:38:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 343589 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3432520jai; Mon, 14 Dec 2020 15:41:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzg1vd6efocF8dU9dm6WIIo2Qms2d6yDUa4KaSpZRpLTQIiy0iHTVeYY7icWlSHm7Fa1JPI X-Received: by 2002:a50:fe87:: with SMTP id d7mr27028644edt.381.1607989311032; Mon, 14 Dec 2020 15:41:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607989311; cv=none; d=google.com; s=arc-20160816; b=QRAMUqDbSknfA7qRuK4rfWm1d8qoIRQoAUlFmK9+qVo8IPht3/HIqHNu3OLmtCRfoC wojgwTXK9Ck6uy3QMriJrqTKsPtr2fqYiobf0oGPf5hw5H2U7tzA/V1d7TPzz1wkCazX 5NcpoEYE9rJ9beft023B0U4zu3qICX9T1Uh3OKAJ0pXfNG9j6/plftMDlteo7+O5C86B wGOJy+Tzo95Pteu6j/z3dQm6VO6Q989qb2j52FuTPuYfaQQnzgS+VDwrcOUH5nwFPr0g fd/ph0ZuzlIDiHe+eMBKt5fQi51ggabSHUsITVm3Pa9fM13cf73nylfNquIkQcC5n5bK mDew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AjsclEsqT88jpSQ7xfg3w1NdJS1z7YOg80HC0xXR68s=; b=I76L6uheM6i6E41gcq9V1O4+Xp1hcjGO/oZhVz0GXO92S46Pbahk5wm7e3di2Lh1Wb HIJDCzE4P48bugxGgjJiYKuRsLwBHPghd1e7HEvMQttQt9MIKeRfFqEgbrAtnQgaR4Qh zJiycg9a1xHk35/7FguUm7oivbq2FKXLIBCYavZFp7OiJhqKSOYcCt6r3d+PzjcJ2re5 wiLR6bF4Y1iRMkVBarkZC2dQObh2UcNBAtOFRwEtQyGFwDAE3bRk5rB7lCNSantviaYc zCQE2GgDS3R1Zr6LZfQT/KCMLB4I6ttvsAMg+LrvdVQ7TWr0/LJ61Eo5TM6hG4EgoGaB kKxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Yhypwya/"; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r3si19101ejc.166.2020.12.14.15.41.50; Mon, 14 Dec 2020 15:41:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Yhypwya/"; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727228AbgLNXl1 (ORCPT + 8 others); Mon, 14 Dec 2020 18:41:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727136AbgLNXlJ (ORCPT ); Mon, 14 Dec 2020 18:41:09 -0500 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 597B6C0611CD for ; Mon, 14 Dec 2020 15:40:06 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id 190so5044345wmz.0 for ; Mon, 14 Dec 2020 15:40:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AjsclEsqT88jpSQ7xfg3w1NdJS1z7YOg80HC0xXR68s=; b=Yhypwya/g0XFvAC4yF97ofNejTZRbDAMPY6R5qH7pFRe2VEtAvsN3ZMtHKnjIXapNO XPeUEGcNll8vn1LjHAEBpljNv4jLfxle0gMFoSDHEMzFjl9GqTgxunbevV6CjZ7ZI/2E ywP5U13diSRGlrJHkbYwmHFMzP7MSLmOygLiBBtmnYFGCYK1smRUlC+Xp9yxLbaGYqup e4JPMH5ac/9fYLUkXEb9qCr3ETN74hYLnxIfRLBjdE4efkH9qOVug0Gr3x8lZqFFHjn+ FYg9hVfnEh0qKxOzHIpP0fiWoO4QlKvUVPdYeQ22ouRz7Y7L/MpTIV7795yW8S/ntYRn flyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AjsclEsqT88jpSQ7xfg3w1NdJS1z7YOg80HC0xXR68s=; b=Q1Gu5953XHaeYXKIz3KidPEI0GNVoXoGs++FdExeJHiFA42CmsuLlyveHwehuR6Gp7 jzD7JdCuwcdQS8BnSCS2aH02PZZrufxsZIX/5bDqSPRDd+7zfbD6XZFxjkJLuRuCXMoz Bfg62iiVuZdtmE4ktEq0QHsUZ+oGopToqeWcIaEypyzQbjsFpEeYqvV3Way08k/EOWm7 dbT2w1VqnR+ym5D0r9YxCtLVdan/tvR6HqOOItlNFW58kmASlsP9Az+Akyh62mScA9GR HqzuNz4FSrndgxLbl9xk6QAkupJPNZ2xBS/X4N3fAPBHU+NDgO2anXZhuyklsP6KwAKA w99w== X-Gm-Message-State: AOAM530qc9KjFwwiY47UGkbbdQgGXplEkTKps7pojdU8x8yKT1KKLmVU 5C5cG01kqWfJeByCHINigkKafA== X-Received: by 2002:a1c:e084:: with SMTP id x126mr29921117wmg.109.1607989205027; Mon, 14 Dec 2020 15:40:05 -0800 (PST) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:e842:4086:6f24:55a6]) by smtp.gmail.com with ESMTPSA id h3sm34145075wmm.4.2020.12.14.15.40.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 15:40:04 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: mjg59@codon.org.uk, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, amitk@kernel.org, thara.gopinath@linaro.org Subject: [PATCH 6/6] thermal/core: Remove unused macro THERMAL_TRIPS_NONE Date: Tue, 15 Dec 2020 00:38:09 +0100 Message-Id: <20201214233811.485669-6-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201214233811.485669-1-daniel.lezcano@linaro.org> References: <20201214233811.485669-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The macro THERMAL_TRIPS_NONE is no longer used, remove it. Signed-off-by: Daniel Lezcano --- include/linux/thermal.h | 1 - 1 file changed, 1 deletion(-) -- 2.25.1 Reviewed-by: Thara Gopinath diff --git a/include/linux/thermal.h b/include/linux/thermal.h index a57232a9a6f9..060a2160add4 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -17,7 +17,6 @@ #include #include -#define THERMAL_TRIPS_NONE -1 #define THERMAL_MAX_TRIPS 12 /* invalid cooling state */