From patchwork Thu Dec 10 12:15:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 341029 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp5580217ejs; Thu, 10 Dec 2020 04:19:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJzX6PmL8yzA+NTty1WvsOvksvxzgpmQ7NOKkFV8tNeeX8zdrfSCCwU5OMuP64I4+FRiF5VH X-Received: by 2002:a17:906:b104:: with SMTP id u4mr6090513ejy.121.1607602786551; Thu, 10 Dec 2020 04:19:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607602786; cv=none; d=google.com; s=arc-20160816; b=TnHk0KlMNW2+SgKSCVgDfRFmRhuF89oXmIWqv7HZccu0ExZTM/dp5Bt1/dRU6qarBM pYWBJrAEVaC2VuGUPrNHHYpHJzqdibyF8iDL0LxAm8JGbd6oykuA/FUtGX5ig6CoFiaa Hy1l/xBU1Hj8zU+e0UZYFkTZDBK5q0YBrgeEfCipiPTDUAmrfDMWTlyuiIHgod24Yc46 AcXPSIkTSWnYTlcxQSZVw+31ctSWu86V6y97Pyt4qF3L/GvLrlK3SKAzPCWa6Tp2TWEW uhj5B8VKtiTZE2tVsQ3IrHVJV6N8AHmdCmHrgOZGvyexhNN4QHX1UuBhVzDf84YbdTmB /+tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=wWauJdDE029YC8Y+yIe9jMzg8qCBhdzScMeoKibGnOs=; b=r2sgdMgh6L5uInyN+5L0JEDI1wqJG2MmwTSS3rC6ZHTItPdg7kBXMnARSDZEfsi1xQ 6y2vUNKxKBA928A8fdP3GbEz78O3TtBrwLudN08uk68Hw7KnuA3185oXrFkoUI9yS3zx alBAVLVH2fpWu8GtYxSQdwqYjhIESZLGk3DSLbuXY4iMoukV179YJ7q+eQ4IudOO4/G/ eO2SOJ4G+8diMsP2bKXECZFl3VJuWj9pspJaPkglX2XCm+yhQ5AQLjt8gpH4GtnBXSvR ns5x5qNDr2MxZhTrP+YCzmc8GhriyptZwHI0C5FieZ1E04Dhjz3M3jrktpTh42ehBpNV BBmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vgszwTHw; 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 v10si2497890ejh.387.2020.12.10.04.19.46; Thu, 10 Dec 2020 04:19:46 -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=vgszwTHw; 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 S2387406AbgLJMQ0 (ORCPT + 8 others); Thu, 10 Dec 2020 07:16:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731010AbgLJMQM (ORCPT ); Thu, 10 Dec 2020 07:16:12 -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 8A8BEC0617A6 for ; Thu, 10 Dec 2020 04:15:23 -0800 (PST) Received: by mail-wm1-x342.google.com with SMTP id a6so4459852wmc.2 for ; Thu, 10 Dec 2020 04:15:23 -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; bh=wWauJdDE029YC8Y+yIe9jMzg8qCBhdzScMeoKibGnOs=; b=vgszwTHwXKWqOF0ocWWs9BDB0fhJW0g/L4FInCzZg9O1Gn1XdVp6H3XNzsGzEkE3Ww qoJ8SLKt9uFFvp/v63bnE5ZDv4cO4j2C0uDBQVaSelhwfCqLNFikkDBcvT0s/6/etzow Ycy8rcq5QyPeyygBFoZS1vNUYSJG/Fm+84Pj3WBNHJJ/k20P2QaBqDd39i3tiidkbf6B 1KLOSAMBbBBQp/6mJfPr96yt/GyZn70bIkeFpBD8N/PRvgJmLbzCEtJBsvL0oh0HnxAD s0EqdB/FlCw/mL8rHvsrya2AK6I+h4CwTxGHqPMSU5+nEvzhgnHZ0gPqIjK+ohx+uFtX jmOw== 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; bh=wWauJdDE029YC8Y+yIe9jMzg8qCBhdzScMeoKibGnOs=; b=m490azx0P3BMY4BI4IQ8iEYwTfqDWK1R06Iu/iRlEFUfxkK+Fng6Crw4Wikkj3ZPig WdvTw2xUszD4O4YVQWWyiSmZVcWRxiyIT/u/4eEOZqMeM0eQY2yCde3uolOsjhFTpi4W SDPL7Wr5W+gTgnGXQX6zAIIF8ElFHKjih8GrtFIHllR7tXXClmq3ZDUbWz0Xj9ORz7zw X25srOh4e8l3CDm8fP5IeH81aMmG44TWa3fWAv+5Hjmq/O5qLyrWOR7VWs8WOrGPIyo3 ohX2+vYdqIEpKaudpP7Lj9yT37NvMDo/xxIZcxC6IluD2TlI2P3oNYd3rbwtn7lqXNZy +7gA== X-Gm-Message-State: AOAM531D/0g5bQN0f978O/64KqDowFjzmXWIdpgSvNJ7sPWTvDC8Crqz AgvlUeNulJhMFuLq5wGJeAbMQw== X-Received: by 2002:a1c:9949:: with SMTP id b70mr8014199wme.85.1607602522205; Thu, 10 Dec 2020 04:15:22 -0800 (PST) Received: from localhost.localdomain (lns-bzn-59-82-252-158-132.adsl.proxad.net. [82.252.158.132]) by smtp.gmail.com with ESMTPSA id k6sm8412863wmf.25.2020.12.10.04.15.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Dec 2020 04:15:21 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: kai.heng.feng@canonical.com, lukasz.luba@arm.com, srinivas.pandruvada@linux.intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Thara Gopinath , Amit Kucheria Subject: [PATCH 1/5] thermal/core: Emit a warning if the thermal zone is updated without ops Date: Thu, 10 Dec 2020 13:15:10 +0100 Message-Id: <20201210121514.25760-1-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The actual code is silently ignoring a thermal zone update when a driver is requesting it without a get_temp ops set. That looks not correct, as the caller should not have called this function if the thermal zone is unable to read the temperature. That makes the code less robust as the check won't detect the driver is inconsistently using the thermal API and that does not help to improve the framework as these circumvolutions hide the problem at the source. In order to detect the situation when it happens, let's add a warning when the update is requested without the get_temp() ops set. Any warning emitted will have to be fixed at the source of the problem: the caller must not call thermal_zone_device_update if there is not get_temp callback set. Cc: Thara Gopinath Cc: Amit Kucheria Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Lezcano Reviewed-by: Lukasz Luba --- drivers/thermal/thermal_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index dee40ff41177..e6771e5aeedb 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -548,7 +548,8 @@ void thermal_zone_device_update(struct thermal_zone_device *tz, if (atomic_read(&in_suspend)) return; - if (!tz->ops->get_temp) + if (WARN_ONCE(!tz->ops->get_temp, "'%s' must not be called without " + "'get_temp' ops set\n", __func__)) return; update_temperature(tz); From patchwork Thu Dec 10 12:15:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 341026 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp5578232ejs; Thu, 10 Dec 2020 04:16:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9ln4sr8t6E1+AMJCWzAGrNGLlojs6rh6BJgvzBYf/AUXvqPW3qUv4I9M0nKLTY8UCxXD/ X-Received: by 2002:a17:906:660b:: with SMTP id b11mr6115719ejp.190.1607602612492; Thu, 10 Dec 2020 04:16:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607602612; cv=none; d=google.com; s=arc-20160816; b=Wcz/stB/VHDeMOfTb5g6mOz6tibL4+cXAsesOeGin0Xm35KK3MmJySEZ/WMsxRvzOz xerV9nvPkChnt1Xixv6znpH0kZdESErv1tWMqGv80o9QE90pcTDYbl8r35PQjB38dI2Z LaV7OdnDCCaG+1UkV1vz4m/nKlLqyMQGFqgshwcNSdPIKulJ9ovi+uNLQNP5DzUAdrFn ORG79qT/bScAjV1jLR99qczvyc1wsujhNEVpGN10KdKSm9hTKlh7rfoV7M4ZIShBu5eI ny2Y2y0mhcp7NXJLDxoNZWVXjsluIXNBzgCNao2/0UoLrkjwlUlQtYy4ZC6N6qoxFG8u 5EHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=sIEMz7Oh+NWa+Qwh/WPljIwoa+Kn6l6xd1Uhgr069Qo=; b=OIE8OUM4OYjBMX5K02POi9KihK9DHpU80qh3eIG3bYYxyGmE5Il/Rskr9ZFDeLvRma KdQD5WE1pWYr2v7Iarz36tXDPn8P/DxzFf8c5wfZlWedGtPwqsYG1oUAcbQCDk/TBH2H 7yRRCawleAphCiUMR8TPew46RDmCFulKjqOnjQEOhjkVMBpmxIYPfa6Pm4mEyo+SnpPm 7wsRIgoq2C7XbApyH0LvqdFfmJIjmPe22eTWbOVYTXoRTBiR3F95wnGN77MCVzKY84fe pHMgL3CyWUFMcGKaWe39ia+J3lY7S9a8G22ZLZbkCSbHE8YPwUVjgy4o6lsKPjtuy/2X ro4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h+9IWBD0; 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 m26si2402535ejc.513.2020.12.10.04.16.52; Thu, 10 Dec 2020 04:16:52 -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=h+9IWBD0; 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 S2387959AbgLJMQO (ORCPT + 8 others); Thu, 10 Dec 2020 07:16:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732802AbgLJMQM (ORCPT ); Thu, 10 Dec 2020 07:16:12 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 578CBC0617A7 for ; Thu, 10 Dec 2020 04:15:25 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id w5so1497767wrm.11 for ; Thu, 10 Dec 2020 04:15:25 -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; bh=sIEMz7Oh+NWa+Qwh/WPljIwoa+Kn6l6xd1Uhgr069Qo=; b=h+9IWBD0VCOj0c+WRowkqukSHO6NNcODBxCwwcCLw+o947GXqI8T58UrtbqQDr69tj eX1ApUWPCVwnah1uWIVdb0RpPROdeLKUw9j9++JB1YjkKDWfcjD7Fvv1d1FCnmvmHZx1 MH7WI6Qfmg1Gc1RRntSDA6yqyzOPJPlqZN9Mq3fsFH0K2USK3SXrCadcxTl7NuNvcQWn KJRWmAhAaZJm0paD6PzpuVUDEKTyNecD/Rm01g6GrjBln2Ik2AAelJHyg8SHXau4XrGr fpN1lz8PWdWSG91Qy3o1lgkA8tV3mAdTkQy6WlRlE0j1TVcZmNgcxCpMzeOQVNYaq8wK 11tA== 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; bh=sIEMz7Oh+NWa+Qwh/WPljIwoa+Kn6l6xd1Uhgr069Qo=; b=ZyLYCMj9fhLfvrndQMi1WOQdOdho2mk5qyzIJuNZHt1hePKQeJwpW5mGthTrtsYYhK FmB322zE7oV9h4hGksPsvCOwpwnGUgSRUT+3Ve4TZSHq0EQBmueuSy9kJVzuoPFTeF5Q bfckA5IIwVBk88/lN4S7+DumNppN2Kovc1lrbs/HtXOGRI0sakOqf+/IjH+zxIjgiWAj kLcmamJEy+T23n4NgcOG/+7JMUAxynvAx8rB5+sUsmVdI3CeIg+obicQ9yyhT+QV8D0z dlq80YiAFoOyNU9ZHwWpUAzz1vhAFBDnN66y6u1rqFn1zszNQmCszOCoN+yjUj33bBzR B+DA== X-Gm-Message-State: AOAM532cDdtfPf0XOr1wmXzipTriYPjVCZnc0/DMfP/4FzvezGVFOC0b IbQCzSM4kilJdQykDNSeszlztg== X-Received: by 2002:a5d:4209:: with SMTP id n9mr7787886wrq.128.1607602524017; Thu, 10 Dec 2020 04:15:24 -0800 (PST) Received: from localhost.localdomain (lns-bzn-59-82-252-158-132.adsl.proxad.net. [82.252.158.132]) by smtp.gmail.com with ESMTPSA id k6sm8412863wmf.25.2020.12.10.04.15.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Dec 2020 04:15:23 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: kai.heng.feng@canonical.com, lukasz.luba@arm.com, srinivas.pandruvada@linux.intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria Subject: [PATCH 2/5] thermal/core: Add critical and hot ops Date: Thu, 10 Dec 2020 13:15:11 +0100 Message-Id: <20201210121514.25760-2-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201210121514.25760-1-daniel.lezcano@linaro.org> References: <20201210121514.25760-1-daniel.lezcano@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Currently there is no way to the sensors to directly call an ops in interrupt mode without calling thermal_zone_device_update assuming all the trip points are defined. A sensor may want to do something special if a trip point is hot or critical. This patch adds the critical and hot ops to the thermal zone device, so a sensor can directly invoke them or let the thermal framework to call the sensor specific ones. Tested-by: Kai-Heng Feng Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.c | 43 +++++++++++++++++++++------------- include/linux/thermal.h | 3 +++ 2 files changed, 30 insertions(+), 16 deletions(-) -- 2.17.1 Reviewed-by: Lukasz Luba diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index e6771e5aeedb..cee0b31b5cd7 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -375,6 +375,25 @@ static void thermal_emergency_poweroff(void) msecs_to_jiffies(poweroff_delay_ms)); } +void thermal_zone_device_critical(struct thermal_zone_device *tz) +{ + dev_emerg(&tz->device, "%s: critical temperature reached, " + "shutting down\n", tz->type); + + mutex_lock(&poweroff_lock); + if (!power_off_triggered) { + /* + * Queue a backup emergency shutdown in the event of + * orderly_poweroff failure + */ + thermal_emergency_poweroff(); + orderly_poweroff(true); + power_off_triggered = true; + } + mutex_unlock(&poweroff_lock); +} +EXPORT_SYMBOL(thermal_zone_device_critical); + static void handle_critical_trips(struct thermal_zone_device *tz, int trip, enum thermal_trip_type trip_type) { @@ -391,22 +410,10 @@ static void handle_critical_trips(struct thermal_zone_device *tz, if (tz->ops->notify) tz->ops->notify(tz, trip, trip_type); - if (trip_type == THERMAL_TRIP_CRITICAL) { - dev_emerg(&tz->device, - "critical temperature reached (%d C), shutting down\n", - tz->temperature / 1000); - mutex_lock(&poweroff_lock); - if (!power_off_triggered) { - /* - * Queue a backup emergency shutdown in the event of - * orderly_poweroff failure - */ - thermal_emergency_poweroff(); - orderly_poweroff(true); - power_off_triggered = true; - } - mutex_unlock(&poweroff_lock); - } + if (trip_type == THERMAL_TRIP_HOT && tz->ops->hot) + tz->ops->hot(tz); + else if (trip_type == THERMAL_TRIP_CRITICAL) + tz->ops->critical(tz); } static void handle_thermal_trip(struct thermal_zone_device *tz, int trip) @@ -1331,6 +1338,10 @@ thermal_zone_device_register(const char *type, int trips, int mask, tz->id = id; strlcpy(tz->type, type, sizeof(tz->type)); + + if (!ops->critical) + ops->critical = thermal_zone_device_critical; + tz->ops = ops; tz->tzp = tzp; tz->device.class = &thermal_class; diff --git a/include/linux/thermal.h b/include/linux/thermal.h index f23a388ded15..125c8a4d52e6 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -79,6 +79,8 @@ struct thermal_zone_device_ops { enum thermal_trend *); int (*notify) (struct thermal_zone_device *, int, enum thermal_trip_type); + void (*hot)(struct thermal_zone_device *); + void (*critical)(struct thermal_zone_device *); }; struct thermal_cooling_device_ops { @@ -399,6 +401,7 @@ void thermal_cdev_update(struct thermal_cooling_device *); void thermal_notify_framework(struct thermal_zone_device *, int); int thermal_zone_device_enable(struct thermal_zone_device *tz); int thermal_zone_device_disable(struct thermal_zone_device *tz); +void thermal_zone_device_critical(struct thermal_zone_device *tz); #else static inline struct thermal_zone_device *thermal_zone_device_register( const char *type, int trips, int mask, void *devdata, From patchwork Thu Dec 10 12:15:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 341027 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp5578247ejs; Thu, 10 Dec 2020 04:16:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJx66NxvSmZBWdv1QkSkIA6t7AVK34QzNj89Mab1GxcrWSnBMVA2+VZ8taxq+rQU4684y1Wa X-Received: by 2002:a17:906:1408:: with SMTP id p8mr6189279ejc.213.1607602613481; Thu, 10 Dec 2020 04:16:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607602613; cv=none; d=google.com; s=arc-20160816; b=I9voHi5ym3/hO/n/NAguyAjlR6/G51qNsJ1st6pqEnF9lhlPgkaT4TV1R5nxdaqnKW rND2Ulp2KXiJTS5e3GHPtRm7tTSk9ikD5ljf2nyQeaNq+epg/TnTOY9JzBUj5RrA4NDy EbyrZhdkkLGIj8XkRJdeeMe+age++1ABmJvV8AL/UOwMJ5gYQdstvW1Zf+oXnI0bpwDP MbzC348ZtcvZKblB7y5exyE/Rv8wLhoA4Lp4ywdYt2TVMBcGTDJ5I+UF8wDl+8br23fi iM6VxrpAliB6zdAqbLNFaReaCWr5LsCQDfXLGpqUbf2Pu6M2FMJp0GQ8NEtfU1R8uKVi ImXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=RFh2OYp1AIw9+1gIuk13B075+zUU8XY1s7bawa7LB6o=; b=KvXVIGUziIMHjUZU1grn4q/0iu8I3y6Nkgsjp6evuMGq85fNH7S2rkyrlKlIeBf5Su WJSG+v/tbj/KVYGASpWq+ItzO988l0gj8KfJ5wBZwapW2fxQYXKM/bP+altOtmWH0o3r 03abNJOVWbRCLlZNbAU/zpq2OVVGANiKlDvI9iYwvSC8Cas7Wv6LL/NXQG692m2/r9wF o1zKQzz9NFvwZA9b7PFVcDqgWX6CkqkzyfgHOr/+ikcye0ERYeC0DMETG+4W228AoGEg 1EAO/ecydX68q7uGYc8kSA97fK/kh2AgKx6K/keGl43EaJrCElHo4JF25da/+phF7Uab b2Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LqyOHEu5; 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 m26si2402535ejc.513.2020.12.10.04.16.53; Thu, 10 Dec 2020 04:16:53 -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=LqyOHEu5; 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 S1731010AbgLJMQ3 (ORCPT + 8 others); Thu, 10 Dec 2020 07:16:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388019AbgLJMQU (ORCPT ); Thu, 10 Dec 2020 07:16:20 -0500 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EBE1C0611C5 for ; Thu, 10 Dec 2020 04:15:29 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id r14so5245254wrn.0 for ; Thu, 10 Dec 2020 04:15:28 -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; bh=RFh2OYp1AIw9+1gIuk13B075+zUU8XY1s7bawa7LB6o=; b=LqyOHEu5V+z03no0UW7ifZb3Jmi421rFx6DMwHbniRYbl42RKA29HPo8aLy1gNicy3 dViH025BgwnFuh9C9GrZUJRQ5XF8vXxyBeOmqbYR9f1NgN2QKb9rhVHCIlGQY1YOsg9a 1faZunKLsQpUaZIVZ6n0xnENErVN2t6vWbFnpIjHzZ/h0XREoD9QtgNqDE3dhb2zADEG Vh3F8O6JpQDSBqJqzSD/6P1w/UG5Mkg9SUxMsfQDi2CX5Ab2ir8Ilsf0PoyGOIhItVq7 CeFWq+8hTEJN8/cYNjjbs42QjgVGhc4VcTeOEP1+ja58DHCnf2yaWaSLp5sWcUJEuxz9 4WWg== 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; bh=RFh2OYp1AIw9+1gIuk13B075+zUU8XY1s7bawa7LB6o=; b=IYAJEKX9eYELDkC5a4h4m8yrER6/OySM7NYbq0PVDlmNYGaUAwzfUZMlfRl9hYdhcF OKYwGf3aLFUmqUe3suaZa+A1SRZkbF90XcV4easMEjM3l4vH0eyZ8leVrDYt1JPliOW4 s5rY4BvqgtPyHl4i0uhogmorzYRgPCMzmUTtagD+I2f4SK7TzCMGdMRoavNN9HLr5sNO ArAXCp3XTN5/1edeG8wp9Ez47QPya3q8PuAtpJX+rk/fJXyr95S/1SFdbfr18F7ZNOvj K+wq9l2/uBmrx2/xUMh5fCrKlfX9U1amHHb8LDxZmHkGPlup7kOiELCjr69cNc7r7+q+ b1bQ== X-Gm-Message-State: AOAM533AE5rc+3CXCz50fx+dFn4uhlhN/ogSSc3GPw7uhq42R+fDz2Fi yFuqdZVBYysX9nSRek7lse1BuA== X-Received: by 2002:adf:fc90:: with SMTP id g16mr8162873wrr.40.1607602527723; Thu, 10 Dec 2020 04:15:27 -0800 (PST) Received: from localhost.localdomain (lns-bzn-59-82-252-158-132.adsl.proxad.net. [82.252.158.132]) by smtp.gmail.com with ESMTPSA id k6sm8412863wmf.25.2020.12.10.04.15.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Dec 2020 04:15:27 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: kai.heng.feng@canonical.com, lukasz.luba@arm.com, srinivas.pandruvada@linux.intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= , Amit Kucheria , linux-renesas-soc@vger.kernel.org (open list:RENESAS R-CAR THERMAL DRIVERS) Subject: [PATCH 4/5] thermal/drivers/rcar: Remove notification usage Date: Thu, 10 Dec 2020 13:15:13 +0100 Message-Id: <20201210121514.25760-4-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201210121514.25760-1-daniel.lezcano@linaro.org> References: <20201210121514.25760-1-daniel.lezcano@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The ops is only showing a trace telling a critical trip point is crossed. The same information is given by the thermal framework. This is redundant, remove the code. Signed-off-by: Daniel Lezcano --- drivers/thermal/rcar_thermal.c | 19 ------------------- 1 file changed, 19 deletions(-) -- 2.17.1 Reviewed-by: Niklas Söderlund diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index 6ae757d66f46..b49f04daaf47 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -323,24 +323,6 @@ static int rcar_thermal_get_trip_temp(struct thermal_zone_device *zone, return 0; } -static int rcar_thermal_notify(struct thermal_zone_device *zone, - int trip, enum thermal_trip_type type) -{ - struct rcar_thermal_priv *priv = rcar_zone_to_priv(zone); - struct device *dev = rcar_priv_to_dev(priv); - - switch (type) { - case THERMAL_TRIP_CRITICAL: - /* FIXME */ - dev_warn(dev, "Thermal reached to critical temperature\n"); - break; - default: - break; - } - - return 0; -} - static const struct thermal_zone_of_device_ops rcar_thermal_zone_of_ops = { .get_temp = rcar_thermal_of_get_temp, }; @@ -349,7 +331,6 @@ static struct thermal_zone_device_ops rcar_thermal_zone_ops = { .get_temp = rcar_thermal_get_temp, .get_trip_type = rcar_thermal_get_trip_type, .get_trip_temp = rcar_thermal_get_trip_temp, - .notify = rcar_thermal_notify, }; /* From patchwork Thu Dec 10 12:15:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 341028 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp5578253ejs; Thu, 10 Dec 2020 04:16:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+IVJpXeeSzG9DNS2puafCxeJqH1OstoPR+EG2TrMuqRdmYMgymtushmpks720yMIg9PYf X-Received: by 2002:a50:b264:: with SMTP id o91mr6466226edd.7.1607602613910; Thu, 10 Dec 2020 04:16:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607602613; cv=none; d=google.com; s=arc-20160816; b=gpUEzpYCpINGsc9jrLHUyCTuEUNODno68b0wZWJpMgWKzQgU3OVsj4DGlQBv6H31ej GhUJSVhyzLlhRou60oMfWEjVvbfcpISnaSU2foR4ftciFpD/g0n+jC/iN1PV7y7UWODB 2Co2NJ44vBUhPTiuiXDYzNHa83p2TP5XSbSZKBeJVhyMJaVovKa2rLRbzWzvL46xy+Hy G0yTSIT9OpWqxb5ilBr4W7wvXJE2CfzKzLq7k/gzouzmprdWFaKednLwoteMbN+3f6Zg PEg+v+S3l23BDRIsVE8vh1xS/0nXfEXW9WWseXpo+Z5Rvt3T7uDfN6Z7dEKpoOVQSXX/ QSyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=SL5r1XlZ94aUm2Qc3ziNrEN/y8mm4mqU/uGHBbVacJ4=; b=iTIRV5Pm3UHkxmWsZKWwUxUTreX2+pjhA4eO43lz5IkA8xwe3geQJe/zEb1VOQTqL5 QVbe0ipaHY4NTAuPadjmDDdCD9IJqq3YnzSw2UdB+heaoGO3chQIuYrl81foR0aAUCHe rZgyLMH3BVfG44e7IJeeKVHJWELma8kNAsOTUlVyRAaXR9y0aL9OsNOnOyJE29T+JkZR jzYNjgUu7JlsBa1f02c5K0Xdm8xIsqXZ8ZpRvR/b9uJQy8oIGL3o7dvzenZZ+L9PjnZx 79NwL+J2lEHAy0I0pBNhxD0xhMmibh9daDNtLNdgFKiO1WBwDHo3B8yiGTu3gh4GwomC U5aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="i4zw3sa/"; 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 m26si2402535ejc.513.2020.12.10.04.16.53; Thu, 10 Dec 2020 04:16:53 -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="i4zw3sa/"; 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 S2388019AbgLJMQa (ORCPT + 8 others); Thu, 10 Dec 2020 07:16:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733239AbgLJMQ2 (ORCPT ); Thu, 10 Dec 2020 07:16:28 -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 D69DBC0611CC for ; Thu, 10 Dec 2020 04:15:30 -0800 (PST) Received: by mail-wm1-x342.google.com with SMTP id y23so5092199wmi.1 for ; Thu, 10 Dec 2020 04:15:30 -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; bh=SL5r1XlZ94aUm2Qc3ziNrEN/y8mm4mqU/uGHBbVacJ4=; b=i4zw3sa/dq3c28aSZyi5OnHK34vamDUVVSCV6CY8XxrU+XUdO3RT+mpYnXsaXu1bu5 a80zutXQ/Y1muZPG7gR1tk++vAo0E3WV8tQQXbMm4hpm67i1/kh/K/zmwc16nm9/ipk8 gce7ve5V0smygbfR6piPk7qGAacAABdma9Qu0h08wWhkj20YJSAIOl4LZBRt9cYk6up+ nmgZF+QSi6vTUZ/qmk8Iv4vgv4MYLUi0x4JJrIA4fTMRZXGa2pkdRJhZ04JT+sZoisl/ HlSACKXv0O5oDId7y0iXEPegmqvJXiRDCkZV2DbFgYUweySQyyTJ9OBaAblj7LNyxDuk LEYA== 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; bh=SL5r1XlZ94aUm2Qc3ziNrEN/y8mm4mqU/uGHBbVacJ4=; b=dBfU6l2CkzFCR3ECb99l+tuM5EnG3hm6lgAwK756VaRHjRsERpxmBjIm8ZQ/trZgbC DTLnWDAI05TaekTTEIcnOwyhzkslZJI25nBCUsn82VxqbLTkfBt1LcPyDfNmGCMYSPCs Fv2I7EiZk6TOx4FoUCqNqlNlgYf2jvmp3/izs3Q7KgKHUA3iqM/hF/fkPmvJ8WxpanQc vCZoKGBuAYuAy8Rt23IYTvqygRB38zi/orlV9O9On6nMZOl2M0mPjebXE5u5/ROjuksW vMMfkThrWbTCG9qFDy2tqXxoN/xetJfHXtsJ+bBDDT6U8Jf5mYb68+l0h0dcxp/CQlTW 3GLQ== X-Gm-Message-State: AOAM530UMSlz7dZE4c8DGF7r16NW1BUCIYZMQtJ0c9K85B4a5m6B4A6U 5DtZV6GvkEFYLhKl8TFHqbzb7Rrujs3W2Q== X-Received: by 2002:a1c:a583:: with SMTP id o125mr7787239wme.91.1607602529494; Thu, 10 Dec 2020 04:15:29 -0800 (PST) Received: from localhost.localdomain (lns-bzn-59-82-252-158-132.adsl.proxad.net. [82.252.158.132]) by smtp.gmail.com with ESMTPSA id k6sm8412863wmf.25.2020.12.10.04.15.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Dec 2020 04:15:28 -0800 (PST) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rui.zhang@intel.com Cc: kai.heng.feng@canonical.com, lukasz.luba@arm.com, srinivas.pandruvada@linux.intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria Subject: [PATCH 5/5] thermal/core: Remove notify ops Date: Thu, 10 Dec 2020 13:15:14 +0100 Message-Id: <20201210121514.25760-5-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201210121514.25760-1-daniel.lezcano@linaro.org> References: <20201210121514.25760-1-daniel.lezcano@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org With the remove of the notify user in a previous patch, the ops is no longer needed, remove it. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.c | 3 --- include/linux/thermal.h | 2 -- 2 files changed, 5 deletions(-) -- 2.17.1 Reviewed-by: Lukasz Luba diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index cee0b31b5cd7..d7481fdf4e4c 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -407,9 +407,6 @@ static void handle_critical_trips(struct thermal_zone_device *tz, trace_thermal_zone_trip(tz, trip, trip_type); - if (tz->ops->notify) - tz->ops->notify(tz, trip, trip_type); - if (trip_type == THERMAL_TRIP_HOT && tz->ops->hot) tz->ops->hot(tz); else if (trip_type == THERMAL_TRIP_CRITICAL) diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 125c8a4d52e6..7e051b4cf715 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -77,8 +77,6 @@ struct thermal_zone_device_ops { int (*set_emul_temp) (struct thermal_zone_device *, int); int (*get_trend) (struct thermal_zone_device *, int, enum thermal_trend *); - int (*notify) (struct thermal_zone_device *, int, - enum thermal_trip_type); void (*hot)(struct thermal_zone_device *); void (*critical)(struct thermal_zone_device *); };