Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2316270rwb; Mon, 15 Aug 2022 03:13:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR6T0yOon7Gn+qVv96mn5CxTRIrd4VnH0xO2bk9VSRJGXYxH2/sPrNQ1yOwQpG9eFrH4GkLX X-Received: by 2002:a17:903:22c7:b0:171:516d:d2a4 with SMTP id y7-20020a17090322c700b00171516dd2a4mr16467167plg.98.1660558393890; Mon, 15 Aug 2022 03:13:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660558393; cv=none; d=google.com; s=arc-20160816; b=zINRvdHqAhsVOMm5YzFZt+IfW3nw29EcOnyuukGVepMyldnNlP0lUy9ZLRI6S1moo/ 2P3AdYZfrI3DK4dFADznfdkqmmfudxQqO5SgHCFL1dqMD/pog7HR0COfe7xUnoaybef0 T4zJQ2V7AX20K9pMRr7VwoZzuEpq8HaRbdU8qK/iLrt/JdPkQvfCLzTHk4bum3HIbSbY cQvISUCTqyx5KhjFLbsG+546ZVDCoRvwTwtsD8qpToAV1qO4foi39q+15/KFuBuLivY+ Kt4ZWT0LtEfnlTRYz8vDu4wnX5RFW8H+a548O2hsZAnNkY29y3KHE9UlkHNkM9aUgRRu I2vQ== 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=8ewKaBruBG4Wdy+dVaWLH7mTF4mGASpuGqd2KHdz1ds=; b=0Rf06qBF2bnqCt7vp6Oey9NwRVDjLACqx94rjepEc8HuGg5gMHxxL9QYlv27NoJNi+ PiBBPEmu9hov4R8Ht+HP+oimdhTDjqnclLVx79CGDgCeh4L8rgqhRv7/hy0mMv78EhKl VHdMTh53bdtvKBL3URCjYmOq4qpIgwiFsvcxNV0zU2bzD1jPptLx0/wIum2WdF97+N4x NzWL78pkoy9r430EXovc/MBsv18LSWzX4Nv5ch765+EzdVl454fHd7yKHjzrhrSj2mO1 4LgJADeP2Tn3cxLZZbLMIuOX21q7ZwUbsqVD7EHTYNn8u4Dhy6+xQv5SiwNEO0yzQV2B g6qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HRqElRtk; 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 l1-20020a170902f68100b00153b2d16667si11337280plg.623.2022.08.15.03.13.03; Mon, 15 Aug 2022 03:13:13 -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=HRqElRtk; 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 S230410AbiHOJLP (ORCPT + 99 others); Mon, 15 Aug 2022 05:11:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233161AbiHOJLN (ORCPT ); Mon, 15 Aug 2022 05:11:13 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61F2F21E1D for ; Mon, 15 Aug 2022 02:11:12 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id n4so8327299wrp.10 for ; Mon, 15 Aug 2022 02:11:12 -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=8ewKaBruBG4Wdy+dVaWLH7mTF4mGASpuGqd2KHdz1ds=; b=HRqElRtk4xqVVcIyId3sDC0J06+n05mI5ThgsrfkfJzohWULUO3CaSqGd+bPWL+/jO b1ub3RF7RG4HrV4zAK7fKnhZNF8rzIdi+F/zIzsbhZ+AYuYha8SiTFpDvWRcgA+HyC4j WXtR7cOuOhz2l9keTa0xu9OSO0Tvz7oyx4PhEFWfzOlTsYnUabPKpnr3hmhUntGFWue9 xpiicS6YOzzhDL7JnBxOwYAs5ZMUOdHDnA8/ADM9Nu8nEOHXsBLPjP0+vVeYduz3AnlS fbG6yr+0AQQSlsQRtrWjB1CfOioxvxrJ7VLM0xkfjYuxsg6xUH5W4iCV4dBKQVvie5Sf UCeg== 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=8ewKaBruBG4Wdy+dVaWLH7mTF4mGASpuGqd2KHdz1ds=; b=fsWjkf314XY1jaB+SCKSvT0QUa0L/y4q6v8PE6uY/gbZ3oz4TePmiVicHKDauK5fpv Vc3DBknbvddcIfS5fQyEsLRXG+hdJHF4skoLioKU2hfoUMPTxMHYLNRw0Wnm20hhNs6J Zt+MJuS1t4siw+QWDEUDKUPgG76Z9nGxpQA9s0/RcQMjAYpwOeCkr0l91JZQWcKL1cOe DYWpKgxT6ImodKrl7XX58u/jQWcKxZTTDlVRhP6n2thxLeG+/ZvjVR0jRIJskNO52wqX B+1+IEi6bhFxLuZ+lzGWcyyYovGR29A+YN+zwlNonghDItcvp/yu+uvtqYzrcGLYfk68 niSw== X-Gm-Message-State: ACgBeo3zUflVzFPT82aEJ/+6Nnj0PudeAinreIsUsK+LzRKaOCD9CQhw PXLHun4pnuk/ZT+sutbuSewbKw== X-Received: by 2002:a5d:6da8:0:b0:223:60ee:6c33 with SMTP id u8-20020a5d6da8000000b0022360ee6c33mr8192498wrs.700.1660554670871; Mon, 15 Aug 2022 02:11:10 -0700 (PDT) Received: from localhost.localdomain (146725694.box.freepro.com. [130.180.211.218]) by smtp.gmail.com with ESMTPSA id n15-20020a7bcbcf000000b003a5ce167a68sm9025115wmi.7.2022.08.15.02.11.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 02:11:10 -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, Vadim Pasternak , Ido Schimmel , Petr Machata , Eric Dumazet , Jakub Kicinski , Paolo Abeni Subject: [PATCH v2 1/2] Revert "mlxsw: core: Use different get_trend() callbacks for different thermal zones" Date: Mon, 15 Aug 2022 11:10:31 +0200 Message-Id: <20220815091032.1731268-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 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 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.34.1