Received: by 2002:ac0:de83:0:0:0:0:0 with SMTP id b3csp895960imk; Sun, 3 Jul 2022 11:32:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tdyhaYYF1wulBrJ6TCEc5g1y7zNDZ+n7GAY9prZVH2DMWi9j1xHc3nRi4H/h/xZ1cQz0lM X-Received: by 2002:a17:90a:e7c5:b0:1ec:9bf3:7c06 with SMTP id kb5-20020a17090ae7c500b001ec9bf37c06mr30721538pjb.212.1656873133271; Sun, 03 Jul 2022 11:32:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656873133; cv=none; d=google.com; s=arc-20160816; b=cRL9JbHFfKTL8DGAtMOjJyQB77sXJzOg674LsVeiORbfFaSwka8e824o5TLEVAt/zl NO2hOolW9M8N/FcFD24ou2LWCVo+yuf43eJXE4a9XkqwqerxI44N7ReIsaqz2Vkhmv+W a/xIhY5kgIEAz2/UYNsBMMAugAqw+L3x3IGuPXAzrCWYWnVDKFFIwCzAJrf2Swqg883M bXBgFLCu7oRjp2wL8IEANnMoEJMo3pe4tntJb33s1DQ5W1vw23UfMB8ZBPzGJzk70KUN Vcz5DnqltTHWFbV05lketuAoBWWoi7d30u6VdaJRwP4mg5pJNtWp2oL33PZKSFQ4p4wj 4qWQ== 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=g/dQAlLb9v0K7wDs4Mx74hQuc1qbwjyUP7a9c6lw8sM=; b=XyG5OJLpoxJcCt4s6IfeT/UKCiukVgy4VRHgu+zXWOZxtCatyKRvSv2SJjLUMcrpej 1HoE+bou+Ai9fAfNTto5rac3wciWTocOY0LD38y1tSb7idgRMocK4U2xPdSvZnfJpQ5z poSpyFdkhieDKIckklwGm0OwrFNg5j7hlAyhMxsn/ruChDVopRaOmaS+ieP/jighY4xh dfl+andqdbE96G9ycsH49kbeuk71hz9jsL7bny16DKm7Tnk9gnDe1RdpFfC3eRnjsHRN NQlKVMDVhYZGJYhoOq76hgkX4vNChtdGMyywfAoJLeIJKl9R0bqxaVI9axuuUZ28KA7c jXmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=oLbUcXtB; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f127-20020a636a85000000b004119dedcbf1si15699419pgc.255.2022.07.03.11.31.59; Sun, 03 Jul 2022 11:32: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=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=oLbUcXtB; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231902AbiGCSb3 (ORCPT + 99 others); Sun, 3 Jul 2022 14:31:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230420AbiGCSb2 (ORCPT ); Sun, 3 Jul 2022 14:31:28 -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 A9EDB2BDF for ; Sun, 3 Jul 2022 11:31:27 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id n4so3036337wru.11 for ; Sun, 03 Jul 2022 11:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linexp-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=g/dQAlLb9v0K7wDs4Mx74hQuc1qbwjyUP7a9c6lw8sM=; b=oLbUcXtBpX6fAcaggVlgw4WsyVqOvXWDZfNFeyC1D5CM+bU4wrGCIlTXmTopAqKVu5 DHG2acHSVNYWC0PQPZxanNly/re9NfDqxwTO3riBCsRdTvJuweYgQk5KHXva7naCMR3l W8wdsEuGMn4MG9fjqTVgggXnJNE8oxH6sPU40ItFA2Ddw/g2vA4ZOxfJcaworoeMxmvH HF7sCSX3MkE/Ido3ToP3c8qBTgyi3mDG256YpoPes2DlaL3zaB4kyQhRjSdUW64+ySw0 fzJ06lb/ftjPSzjimXTXpLOjaOSGnvXogoqIdEYsP0B0bou5Ji2KpYydPeBwXJvYqUe0 1jZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=g/dQAlLb9v0K7wDs4Mx74hQuc1qbwjyUP7a9c6lw8sM=; b=11zMMU4iluFfXA5hjbPs9Jlke2438VIeJSzpbMI+wgH1sA2S85DiUrq2cA13gG9w4l iD/1l62abXJhYMpDXaB7pt+HEuLbOKj5rMdlAqPXu88r1mEdGH7z+psVndyJk/t3soaP IaUd6KMvA2h0LhQ7c2sFn6Jud+OR3yHyfkVEqSpPtMHNU+mNPY0b0NpuG2b9ikX0Sq9T pvzyEHMjeM/1upBeIni5c+Zjb1n7Up/x35/RuYyWkG8Zan1/CG6tP7bfUOjsBowa1maG OZzn5GqP9hF3lrdLa0WGgcdo5oj6/oB3kJ78OobseDTo6iyPpnhI5TaX9jySZfy5ZXJO pZ1A== X-Gm-Message-State: AJIora+Rx4spum1pucE7JE/Ktdy/mZqyPHtw8CI+GAGLdhAmcJoR+S6R ofFNenV+PExjsEdLnvQ30sRJUA== X-Received: by 2002:a05:6000:ca:b0:21b:8082:7518 with SMTP id q10-20020a05600000ca00b0021b80827518mr22429233wrx.124.1656873086232; Sun, 03 Jul 2022 11:31:26 -0700 (PDT) Received: from localhost.localdomain (146725694.box.freepro.com. [130.180.211.218]) by smtp.gmail.com with ESMTPSA id x10-20020a5d54ca000000b0021b85664636sm27504258wrv.16.2022.07.03.11.31.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jul 2022 11:31:25 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, khilman@baylibre.com, abailon@baylibre.com Subject: [PATCH v3 00/12] thermal OF rework Date: Sun, 3 Jul 2022 20:30:47 +0200 Message-Id: <20220703183059.4133659-1-daniel.lezcano@linexp.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 The thermal framework initialization with the device tree appears to be complicated and hard to make it to evolve. It contains duplication of almost the same thermal generic structures and has an assymetric initialization making hard any kind of serious changes for more complex features. One of them is the multiple sensors support per thermal zone. In order to set the scene for the aforementioned feature with generic code, we need to cleanup and rework the device tree initialization. However this rework is not obvious because of the multiple components entering in the composition of a thermal zone and being initialized at different moments. For instance, a cooling device can be initialized before a sensor, so the thermal zones must exist before the cooling device as well as the sensor. This asynchronous initialization forces the thermal zone to be created with fake ops because they are mandotory and build a list of cooling devices which is used to lookup afterwards when the cooling device driver is registering itself. As there could be a large number of changes, this first series provide some steps forward for a simpler device tree initialization. Changelog: - V3: - Removed patch 1 and 2 from the V2 which consist in renaming the thermal_zone_device_ops to thermal_sensor_ops and separating the structure. I'll do a separate proposal for that after the incoming cleanups - V2: - Drop patch 1/15 which contains too many changes for a simple structure renaming. This could be addressed in a separate series as it is not necessary for the OF rework - Fixed of_node_put with gchild not initialized as reported by kbuild and Dan Carpenter - V1: - Initial post Daniel Lezcano (12): thermal/core: Remove duplicate information when an error occurs thermal/of: Replace device node match with device node search thermal/of: Remove the device node pointer for thermal_trip thermal/of: Move thermal_trip structure to thermal.h thermal/core: Remove unneeded EXPORT_SYMBOLS thermal/core: Move thermal_set_delay_jiffies to static thermal/core: Rename trips to ntrips thermal/core: Add thermal_trip in thermal_zone thermal/core: Register with the trip points thermal/of: Store the trips in the thermal zone thermal/of: Use thermal trips stored in the thermal zone thermal/of: Initialize trip points separately drivers/thermal/gov_fair_share.c | 6 +- drivers/thermal/gov_power_allocator.c | 4 +- drivers/thermal/tegra/tegra30-tsensor.c | 2 +- drivers/thermal/thermal_core.c | 53 +++++-- drivers/thermal/thermal_core.h | 25 ++- drivers/thermal/thermal_helpers.c | 13 +- drivers/thermal/thermal_netlink.c | 2 +- drivers/thermal/thermal_of.c | 201 +++++++++++++----------- drivers/thermal/thermal_sysfs.c | 22 +-- include/linux/thermal.h | 21 ++- 10 files changed, 197 insertions(+), 152 deletions(-) -- 2.25.1