Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp4778931rwb; Wed, 17 Aug 2022 06:06:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR4iPvb00zDEYR99gzHUC1msW3uGyHuyjz5ZHHu1Qu5Fk8J3hnoaEwBkWau/l6xnG8bIo/oH X-Received: by 2002:a17:902:7e45:b0:172:8c47:ff2e with SMTP id a5-20020a1709027e4500b001728c47ff2emr5843113pln.24.1660741581504; Wed, 17 Aug 2022 06:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660741581; cv=none; d=google.com; s=arc-20160816; b=jGTSClqeBMpnHHOiEh+fBtq1ZneD3ldiFYHWlc17RBEgRHFc1L4wZlLEiQ5EI0W16p Zd/FAquxGowuTn8WgSkJVxLHH9AiehFLoOInm+XWs30yLfwm/4WfE9d3lNe5EsXHgHK4 iy+FR7gh86tWo5L5HCdaQRQQB5YDteV4YpYXpSTUFyCJvZj3+oiVYcuRhlOEIzE99WPV X3yg8b41sX22HFeXB0mJc+nXjilio11HV6YZ2piMjqaZxJjXMft5aHjX+h9fDNGfU5N3 kK2E9Vpw86gzmtpzrOmYlxfB8X+JUGgZ12eXFgohA7JvdkE2vXrvU+m25pUv7/Py5y+5 PhTQ== 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=cevyYAZt+dxQcHlPC3XN0GuOe1QkXMz82sZwwqq5w6E=; b=uXfTBU1tyf/vWlP0GY5wPOXFK4meee4EpYXoLjhx6tzWr+jHcgfvniSzThjv2N1IHG dze0YlHVjBdW7qeMQp60qLM4SOEaU2HVX0xjw9g6tQVUiSOGIfGahlX72j2Ws051cSt1 tIhk+8pVEM2TkMZkWGx7hIRrzJqazC3lxzsbo8bd/sT2OmNMWpjKNHW4dbugTT6iJWCd a7hUXN+lnm38ki0Vq5JiKta1DlGJD9+Xf7uLzGHQZHkkuRNg7xnQ5bbE8UvNYRhipVcx MqKnK14vg7dYBwUOeSCjLjGenuK6SPzYGEhVT4UPrpn4vpbH4Yv9xysPo5h7DaiAhqod MFVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wy4h554N; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e17-20020a056a001a9100b005186df822dfsi17223068pfv.378.2022.08.17.06.06.02; Wed, 17 Aug 2022 06:06:21 -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; dkim=pass header.i=@linaro.org header.s=google header.b=wy4h554N; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239454AbiHQNC7 (ORCPT + 99 others); Wed, 17 Aug 2022 09:02:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239492AbiHQNC4 (ORCPT ); Wed, 17 Aug 2022 09:02:56 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C81E852FE7 for ; Wed, 17 Aug 2022 06:02:54 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id m17-20020a7bce11000000b003a5bedec07bso987529wmc.0 for ; Wed, 17 Aug 2022 06:02:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=cevyYAZt+dxQcHlPC3XN0GuOe1QkXMz82sZwwqq5w6E=; b=wy4h554NSrItIUYkhyPJvyc8SB0Gne1UM0/mv6oEZWGmmn0JEst2Z3WFgZQySKmuG0 EdgcGv/fDTEWjcrXpeKZ35mufrqkGBlMc73/2JxtteMFUywO1WQPTMlxSDGsr824gBL5 BlhvBEj2odYhwi7n2/B+EAp5JsUXcbZ1ZhFjc+cujXbgJpfvs6ZfWP/SfWNMgpBYTQHA Pd7EawC77rpES/6Y/5so932i1kGuBsCr/Rf8MiN/LjPM0ZcDsk9dF3TyRKdBQA0CveAn D60TtOqknyagcux3nMVUOUP+36iXzAEyIxZj1tua0jg1yUV09IPz/UbLuDgVUHeEREpL 71/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=cevyYAZt+dxQcHlPC3XN0GuOe1QkXMz82sZwwqq5w6E=; b=YVww8YHOsBoeHVFgMh5rYIbKLW/hapyy547K3pob/kYNZyZn6mTA8AOVxs629KhVgI Hs6FHkgHU0TvL1LGVhSJbx5fTLai4xmPiDusvrUr/ZE1WVHM/D+7AbvyJouMxf0EB2Is kjeuJjzy78a/M+cSCs1nbk5Vj0t6JylkkGECPvMFYDByJY87+rulEtw9yHnQpvQwmwK9 sfRs7YP10IyFPZ6k+l8/CtJWmLQ4fkOVG0FiPTs3b4BbnbcaNkfv8u78uyNjRwYaDICQ iS2BBWKcRMJvLpqv/p8XvqMQCf4QhzHZfbc1dChZRZjLY8ZAXsU/3QbydKBZP2j0TRHS ArTg== X-Gm-Message-State: ACgBeo26PCi8EYuRzIApjkKs+OgpbCdUoHWuFkkKyhh1S9t1mRcWEY61 GI6YL3rWCMbVdHLkBTgjeutAFw== X-Received: by 2002:a05:600c:384c:b0:3a3:744d:8dd2 with SMTP id s12-20020a05600c384c00b003a3744d8dd2mr2117743wmr.117.1660741372883; Wed, 17 Aug 2022 06:02:52 -0700 (PDT) Received: from localhost.localdomain (146725694.box.freepro.com. [130.180.211.218]) by smtp.gmail.com with ESMTPSA id y11-20020a5d620b000000b00222cf973e8csm12878862wru.69.2022.08.17.06.02.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 06:02:52 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org Cc: rafael@kernel.org, linux-pm@vger.kernel.org, vadimp@mellanox.com, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, vadimp@nvidia.com, petrm@nvidia.com, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, Ido Schimmel Subject: [PATCH v3 1/2] Revert "mlxsw: core: Use different get_trend() callbacks for different thermal zones" Date: Wed, 17 Aug 2022 15:02:26 +0200 Message-Id: <20220817130227.2268127-1-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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 This reverts commit 2dc2f760052da4925482ecdcdc5c94d4a599153c. As discussed in the thread: https://lore.kernel.org/all/f3c62ebe-7d59-c537-a010-bff366c8aeba@linaro.org/ the feature provided by commits 2dc2f760052da and 6f73862fabd93 is actually already handled by the thermal framework via the cooling device state aggregation, thus all this code is pointless. No conflict happened when reverting the patch. Signed-off-by: Daniel Lezcano Tested-by: Vadim Pasternak --- .../ethernet/mellanox/mlxsw/core_thermal.c | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index 3548fe1df7c8..0eb52665b994 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -352,7 +352,8 @@ static int mlxsw_thermal_set_trip_hyst(struct thermal_zone_device *tzdev, static int mlxsw_thermal_trend_get(struct thermal_zone_device *tzdev, int trip, enum thermal_trend *trend) { - struct mlxsw_thermal *thermal = tzdev->devdata; + struct mlxsw_thermal_module *tz = tzdev->devdata; + struct mlxsw_thermal *thermal = tz->parent; if (trip < 0 || trip >= MLXSW_THERMAL_NUM_TRIPS) return -EINVAL; @@ -546,22 +547,6 @@ mlxsw_thermal_module_trip_hyst_set(struct thermal_zone_device *tzdev, int trip, return 0; } -static int mlxsw_thermal_module_trend_get(struct thermal_zone_device *tzdev, - int trip, enum thermal_trend *trend) -{ - struct mlxsw_thermal_module *tz = tzdev->devdata; - struct mlxsw_thermal *thermal = tz->parent; - - if (trip < 0 || trip >= MLXSW_THERMAL_NUM_TRIPS) - return -EINVAL; - - if (tzdev == thermal->tz_highest_dev) - return 1; - - *trend = THERMAL_TREND_STABLE; - return 0; -} - static struct thermal_zone_device_ops mlxsw_thermal_module_ops = { .bind = mlxsw_thermal_module_bind, .unbind = mlxsw_thermal_module_unbind, @@ -571,7 +556,7 @@ static struct thermal_zone_device_ops mlxsw_thermal_module_ops = { .set_trip_temp = mlxsw_thermal_module_trip_temp_set, .get_trip_hyst = mlxsw_thermal_module_trip_hyst_get, .set_trip_hyst = mlxsw_thermal_module_trip_hyst_set, - .get_trend = mlxsw_thermal_module_trend_get, + .get_trend = mlxsw_thermal_trend_get, }; static int mlxsw_thermal_gearbox_temp_get(struct thermal_zone_device *tzdev, @@ -608,7 +593,7 @@ static struct thermal_zone_device_ops mlxsw_thermal_gearbox_ops = { .set_trip_temp = mlxsw_thermal_module_trip_temp_set, .get_trip_hyst = mlxsw_thermal_module_trip_hyst_get, .set_trip_hyst = mlxsw_thermal_module_trip_hyst_set, - .get_trend = mlxsw_thermal_module_trend_get, + .get_trend = mlxsw_thermal_trend_get, }; static int mlxsw_thermal_get_max_state(struct thermal_cooling_device *cdev, -- 2.34.1