Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1879458imn; Mon, 1 Aug 2022 03:42:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uEiZYW6Y8CMM0fZH2x0kUz5zpgpKMxFjpOgRtDDJi6D1tInZ3emOXRNrlpqVtrzDPwCKf+ X-Received: by 2002:a63:d54:0:b0:416:73d:d5cf with SMTP id 20-20020a630d54000000b00416073dd5cfmr13043491pgn.579.1659350578329; Mon, 01 Aug 2022 03:42:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659350578; cv=none; d=google.com; s=arc-20160816; b=TKRFt08NTLHGuxOVjiIuMhCoknTDCYo4vI1+D26icIHbMhQav7/mR10UunwtMeUI0t TqpbHm9yt7y1BDrt7QGmNfzi2tbN3gsgtFmqJwJLd0cuWQhAh0SwQEIEFmW17ksdPCnB EdVr19pktcSgzRc26urRIRORs4c0fZIF1eyvH1YX/4SpZWaRexod2dir3lsyrJg9XOTi MRgLJqmSOwAgHHaWjtgJ4dN7vqJYySmV6ZDm5yaVsRoKah3KJeu+PbxQje0pANyR3tRO RSYYNAugeZJUs70tOl/OMD28F2HW4PnZm+B/FTvUr6sA8j+th2wdXN+QbFBu4WYTfm6o sxGQ== 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=2FuACtaCS0L8dCebZDq4RRCEXB3kt6E3Inml0wlV6gg=; b=V5lEihzzdiROYWzLr3kV6myn0uGMfWOBOF/Qu4wJvQEqNATJ0cabVu+0saYABW2v8u UKRw3r0RkiYbn0R+efXanoQenPkYyNtyOJYvuMFqCmZUuj47KwamtQnu0cRrlUudIteF 2ySk1rHnDKKxoHg8rp/UHqXBZcGDvLVrJchvfs5cPHNX22QSL1FdyNQTqjgubH+IYUFK AjdpbBJQE7c7vivZ+6Q+GfK5dd5ZHNozWCNL+3w3+WGN/ThFPSPij/hw02RzTzx4K+Lj 9Q5EbpHF50ybsvH1rf+Q3guxNlVE9zXC9WgpyO5+zrm9imXgeGwwJJHNGelFwH2N+rIF ynSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KDTn7Mup; 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 n3-20020a170902f60300b0016dc318a9dfsi6743938plg.522.2022.08.01.03.42.44; Mon, 01 Aug 2022 03:42:58 -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=KDTn7Mup; 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 S230527AbiHAJ4i (ORCPT + 99 others); Mon, 1 Aug 2022 05:56:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230240AbiHAJ4g (ORCPT ); Mon, 1 Aug 2022 05:56:36 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C95332BA7 for ; Mon, 1 Aug 2022 02:56:33 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id p10so9251689wru.8 for ; Mon, 01 Aug 2022 02:56:33 -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=2FuACtaCS0L8dCebZDq4RRCEXB3kt6E3Inml0wlV6gg=; b=KDTn7Mup8NyF9qvcEMDqDfbVO2sbgiHPBc4jBKd8h+ncGfBZcDWsKsW90yNAOA4i9F 1X7g37grnvEnO3ePr5Oa22V1G3p/1UsB+mrONfDsfgZ3ZjlTy7a3GbYpdyFNryYBAS6J OsRXwDfl4bwzlqZBA+SuugJZh8vcHlKagX063SlJsRcEs8coyUJJVdxRR/CmOpa5FFW4 MondDpwWVbhyQB2qYJZYLi9YrXXsxdGjT712KyGd2UaQwVLqkrRAe//rpkVXkGUxg1wd Sw9NGXwPl+AOddashnMdhi43W8EJa9yAXudzKqndtaoxz88nXHDghoYExfIHh4k4va2H FZdQ== 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=2FuACtaCS0L8dCebZDq4RRCEXB3kt6E3Inml0wlV6gg=; b=DSqnnWQAzBPgeuySsYW1Ab8zvsinNJnZuAUCJaZR5m6Mk8b76l7YKFYKKSb72E+K9O dmmWY1HaRrNklc0XnTtgA+/Ne/byM0/SMGWgOT6Xy3pyz1nO0I9JMNdhR89ApQ1sVr4w Vo9bMsQcY8ZjOsu9rtwtMTKMBVL5faCL4tiqnfdya/r1cCHvieyF31VWiWdLVLHfYIBE bmu5RSzUYUF55uMnzYr4MNGxbFumU1800MzdfszfCkgh0Jp+9bmeAHAy7l13s+tit5rV bKlT/aYO/Dlc6PvuLwuVOT/AIdOOgAGylDBEECIsOzuNUHOYsRVnNp7zesUswMFlFIXM zmmw== X-Gm-Message-State: ACgBeo01XwybcfPyH02j20p63dg2aMeLDfy4LdWjrlwz6c7YzjeSAkMd HETxzxqbtfv+SOeimo4bhCNnMg== X-Received: by 2002:a05:6000:2a8:b0:220:6893:4ff6 with SMTP id l8-20020a05600002a800b0022068934ff6mr1108386wry.170.1659347792321; Mon, 01 Aug 2022 02:56:32 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:b04a:b59f:f2d8:e65c]) by smtp.gmail.com with ESMTPSA id d14-20020adfef8e000000b0021d6dad334bsm11430204wro.4.2022.08.01.02.56.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 02:56:32 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: vadimp@mellanox.com, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Ido Schimmel , Petr Machata , Eric Dumazet , Jakub Kicinski , Paolo Abeni Subject: [PATCH 1/2] Revert "mlxsw: core: Use different get_trend() callbacks for different thermal zones" Date: Mon, 1 Aug 2022 11:56:21 +0200 Message-Id: <20220801095622.949079-1-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.25.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 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 --- .../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 05f54bd982c0..f5751242653b 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -345,7 +345,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; @@ -537,22 +538,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, @@ -562,7 +547,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, @@ -599,7 +584,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.25.1