From patchwork Fri Oct 30 17:05:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 4916 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C253C3F147 for ; Fri, 30 Oct 2026 18:05:14 +0100 (CET) Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-48e17d30a79sf611012f8f.3 for ; Fri, 30 Oct 2026 10:05:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1793379914; cv=pass; d=google.com; s=arc-20260327; b=lCBdCwe0Lv+4pR0CaCa4iAEJhu6Gyy3LyWW1E7u1qEtypLhRY/jZugZZDcsYS+6n55 KR7G3xgRCxQhPbdJAybHiFcqqPhKLIFIgW6oyJxvcjP30qwH+XDXVqSm2gGoc8WO2bve niaV5TaKviFq/+/i/rKw7hwdEeftawTI8FV1r9yC1dS+YKX6Dy6z7rpqqyNadNGG0x72 Idq3saTw8VjfzEvRUoj/886J8crnLXDP1FpZtaY2FgTwiksTHbO0ANTY35t2qwDsE3FE oh/Gq4lH42mXEojl2M406G1Ktz8HNoRJjZlGXWO83DhtWEgNl8xTD1LuExM31aIJWwWO Ppgw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=CYjnkmjsTyhyuokUXzZoNeQW0gROc4b7xuB359Er9rY=; fh=LyvsXm0QwjGNkdziwzb4dlGyvdGclCqQMB3NTAHnMog=; b=NmsloUqwi634bPuElrG9gzgvJ46tmbI/kKiLh0U+gtaYOSfgkAaO4M2NMRjQ5ZGp+8 e6gNR0s8nHKz1D4DImBcXN8CzvbMbL4vseC9KWX03YkgBTp9XAs/h+H+crGH9fY07wyC Wscl9wCIshNkmPZyzp4h4Fi7OyVwUKxV4t6iifGkGdK6ik9cc6QILKf03UTiObqXViwy /sXmX5b04//5tFmAjhrrq28eZgTpzJg3Kt9VLjotTH+hK3aKk+GWopqmNemtZpzfgbrW 8yhEFkiw1x4PNqfQLhSuCuHNtEfT4zqBOzuZvpUCxczyPx9/dbR6hbqltZWS4O1mj1c2 nOQw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=c1wJarmf; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1793379914; x=1793984714; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-type :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=CYjnkmjsTyhyuokUXzZoNeQW0gROc4b7xuB359Er9rY=; b=r2D+KhZyo6oT5fpDfunMHXKl3+HLzd60kH5AtEvZOAocI2TFegrx3tjVgLymXvCkRJ n0ZrctI5XXKt+pbPLHn0j0MDq3p/zyJ1OmQLyA8AU1gReYFPVzGgi7NryKsK1bP4GN+a 55kMtVBeMu4RKt9c6aau7OmqbDYRUUCVb+DI0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793379914; x=1793984714; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :content-type:x-original-authentication-results:x-original-sender :mime-version:message-id:date:subject:cc:to:from:x-gm-gg:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=CYjnkmjsTyhyuokUXzZoNeQW0gROc4b7xuB359Er9rY=; b=JrLAaL+zg5Rv4ONB80WNqpyhyQFFf63rKO3pWdWF/DyeKe/5gS72hvOYdJ0wfoL0ar KpAYBB+7wo8KqmEoWWmc6rnzn9lXYhReFtksAhq7lPCWau/bXmKqn0ltCTOzTweFPPQb 51K1jsQEuOAOjljOMwuvGYRoBkzBtIEp3R93BWplAOs5DPfUHr+z/aHftpwepeaiIlm9 1BP3viDJvTJy0Ihai59LE6CTIVhfVF37prRp7/kDkbiWH7/XQYPDluHI1AD2y6BrplOk FkN667x1McmZOGUa55T7MGACd7S00EGTkijce99qwIAUSe7LMlq+bALJXVmxd/UqwmfW kA6g== X-Forwarded-Encrypted: i=2; AKwUvByqn1J6QTMiFIjnIDgaGYaK13q6+SBD7f+0WfgaaxA6hTg0K1RggWaqKY6dneWLneJ/jmnzWqSLXaby9ZbN@patchwork.amarulasolutions.com X-Gm-Message-State: AFq9FYKCXVI3ooClA3Gait8a7Fn/C17lB52rX2xq7kh3Iw9TCAA3e0gU MNcvM0f/dfXaSFQErvV6uu6hfRH4hfq91pBeDWFEbaKqP5DspeGq38jQAtOhbJ5PDFIUZQ== X-Received: by 2002:a05:600c:6089:b0:4a2:a8c:22b0 with SMTP id 5b1f17b1804b1-4ac14ec75fbmr62978335e9.1.1793379914148; Fri, 30 Oct 2026 10:05:14 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com; h="ATskLdew2wNKrd5CIwjzFXIllB0Iqn4/iTjKSNq2K0a7T2xISQ==" Received: by 2002:a05:600c:524d:b0:4a1:fd47:68d2 with SMTP id 5b1f17b1804b1-4abd209bb5als12353935e9.1.-pod-prod-08-eu; Fri, 30 Oct 2026 10:05:12 -0700 (PDT) X-Received: by 2002:a05:600c:4e14:b0:4a5:a5ca:de1d with SMTP id 5b1f17b1804b1-4ac187a80bfmr67018725e9.30.1793379912338; Fri, 30 Oct 2026 10:05:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1793379912; cv=none; d=google.com; s=arc-20260327; b=ErKrAHXA/KzzkBJ3uE6G3M5vaVr7s0NSUKJjYSwh/GMrup/72O+GdwY9DW70yX/uoc dZXx5/CUSII3pwtCEVAIG44ZmQtbFEw06CnyeGoiAH7MhFnlAec3B5Y+Nw4yfbC08xRp jPawrds0QeWaF9f1UpqSVnb7cPgwx0ADiGoZwydBRivi9Mjg0jlsV2XxSIXvNmnP2WEx Akv4NTgCx0JEWUqYft9EDoAtbUlp1RJhjFFryN15wwy1qMVY9D8IIVj2B4jI7yz7sgzV kwEo6oIBkgz8nKYZngU2xb986E/7dGacC+khmsNIlo1P3ZP6HdMknhL5KSZE2/2sxvyK UWMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=EPAAuCB0S3W/e2ML7p7PUAK+RLkEZogpuGdl8EvfImw=; fh=ftxxW7mWRw6wDjBr8B3wqSI2JAr8fod0sAcarUZhQdY=; b=SEMelcBB11+oLQj89mD7Um98a78lCZO9rCDpg9ARdq3fc5/7KrOsUP0Cafs1o5lU4p lhegD53IkX8rNFQo144it+9+bxj9KpMfCg0e90jER8PO8i3Z6bapRSJQRQRSccHBueId vuxO6KCVJX7nMHmHm8RYwzL62/rMizTUAgvqazcyqGbmmSYlP8eCBZLiULByU3pDEeX4 di3KorFo6d4IK7Ld1UN5CUlNCfb/tSOq3m91mAOZ4QI19ztJUDcyZOnAkGpyo7I0e0VD x8aW798tp1+tKT7FzOfi+iuaqHXucJlsA1BlkH9H1Uu+RS6KdHvWrVROSUdyLfLEsxdL pH2A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=c1wJarmf; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 5b1f17b1804b1-4ac230450a6sor6281325e9.12.2026.10.30.10.05.12 for (Google Transport Security); Fri, 30 Oct 2026 10:05:12 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Gm-Gg: AYBFou2LnuL7m2q7Eo0B6ArmWVubv0wpY/7hXXMyhxFeGrvrmP3DzQ74GMonNu1t4c/ Ik0rskhfHL+H857YSHChIhc4JVOvoVparcpy3MBt+3GSiJGy+4nkvuJRs8jjObnHjtIGzFoddai iegOMryew/UIVCjgRfoB6vXg8ejgznytg3ha6GhM7v5S+ii5pS/dP1fzKRJT36VO8QRsqo5MFk/ hOnRsYMiqA7M+KT16Z7EVB3U4zX3uKP32NDOZ+kz0ZDDdbo9z5mROxbJ8ld0kos6vwnHQonObgf Lya4OaDTakm+ABr6+AxhD2BP2fxy9igSCZGSn5hjzgqFEZ8UYhm/KNh7gWPaAC7o9qvapCBiVXc 0E1cjM3yufkUD8/jbajzcNC4giGl0fSCw0lvJ2gvMJevveo5WPxrgrMEO5ztEQDq2d8EgoDGEwX Lk5/T58IOk8KY2SxWi2fO+P8YBAwZjPHhr5vTmQhYVyvXQpj1yREnXtGnHriEF3HqhBdERCjyWv YKlj/XG18I4iNIZsHxgN6S11ceWHX/Yli4rOC5HOBW/kPx3lpd+fGME05NiH7fKk4HAZchkNlu8 S18aWzMdwuIz8tw57ZJKA5Cj88uiC3MN5upAYlYF8Rn/Bc2+xVFoNEeqh2mRTPE+RGgCL8VyBEF UtCzgMZse0R8dMBI1Q8Sy5KVdjVAFZGBRH7Vz5jDEuo/Ft1/lvgArSgGu2Zh2wqAoZKSQfLWPaP Thji8PvsS+KnNcsd9UtMCkVTpv6w== X-Received: by 2002:a05:600c:46d1:b0:4a1:825a:56fd with SMTP id 5b1f17b1804b1-4ac18a88fa6mr67955625e9.32.1793379911728; Fri, 30 Oct 2026 10:05:11 -0700 (PDT) Received: from dario-ThinkPad-P14s-Gen-5.homenet.telecomitalia.it (host-79-14-29-58.business.telecomitalia.it. [79.14.29.58]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4aa81b7fe80sm166602025e9.11.2026.10.30.10.05.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 10:05:11 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: linux-amarula@amarulasolutions.com, michael@amarulasolutions.com, Dario Binacchi , Fabio Estevam , Ilias Apalodimas , Marek Vasut , "NXP i.MX U-Boot Team" , Simon Glass , Stefano Babic , Tom Rini , u-boot@lists.u-boot-project.org Subject: [PATCH] imx: fdt: drop the cooling devices of the disabled cores Date: Fri, 30 Oct 2026 18:05:05 +0100 Message-ID: <20261030170508.2819620-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=c1wJarmf; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=neutral header.i=@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On i.MX8M Plus the cpu-thermal and soc-thermal cooling maps also list the GPU and NPU, but disable_thermal_cpu_nodes() only truncates the cpu-thermal one, dropping them, and leaves soc-thermal referencing the deleted cores of the Dual variant: OF: /thermal-zones/soc-thermal/cooling-maps/map0: could not find phandle 17 Remove from the cpu-thermal and soc-thermal cooling maps only the entries of the deleted nodes. Signed-off-by: Dario Binacchi --- arch/arm/mach-imx/fdt.c | 58 ++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 27 deletions(-) --- base-commit: 3973f3c4d24df75ca90d7c0a9f03e5e5c9b48f32 branch: imx-fdt-cooling-maps-minimal diff --git a/arch/arm/mach-imx/fdt.c b/arch/arm/mach-imx/fdt.c index 1ef267184634..f732eec2025f 100644 --- a/arch/arm/mach-imx/fdt.c +++ b/arch/arm/mach-imx/fdt.c @@ -9,49 +9,53 @@ #include #include -static void disable_thermal_cpu_nodes(void *blob, u32 num_disabled_cores, u32 max_cores) +static void disable_thermal_cpu_nodes(void *blob) { static const char * const thermal_path[] = { - "/thermal-zones/cpu-thermal/cooling-maps/map0" + "/thermal-zones/cpu-thermal/cooling-maps/map0", + "/thermal-zones/soc-thermal/cooling-maps/map0" }; - int nodeoff, cnt, i, ret, j; - u32 num_le32 = max_cores * 3; - u32 *cooling_dev = (u32 *)malloc(num_le32 * sizeof(__le32)); - - if (!cooling_dev) { - printf("failed to alloc cooling dev\n"); - return; - } + int nodeoff, len, i, ret, j, k; + const fdt32_t *prop; + fdt32_t *cooling_dev; for (i = 0; i < ARRAY_SIZE(thermal_path); i++) { nodeoff = fdt_path_offset(blob, thermal_path[i]); if (nodeoff < 0) continue; /* Not found, skip it */ - cnt = fdtdec_get_int_array_count(blob, nodeoff, "cooling-device", - cooling_dev, num_le32); - if (cnt < 0) + prop = fdt_getprop(blob, nodeoff, "cooling-device", &len); + if (!prop || len % (3 * sizeof(fdt32_t))) continue; - if (cnt != num_le32) - printf("Warning: %s, cooling-device count %d\n", thermal_path[i], cnt); + cooling_dev = malloc(len); + if (!cooling_dev) { + printf("failed to alloc cooling dev\n"); + return; + } - for (j = 0; j < cnt; j++) - cooling_dev[j] = cpu_to_fdt32(cooling_dev[j]); + /* Drop the entries referring to a deleted node */ + for (j = 0, k = 0; j < len / sizeof(fdt32_t); j += 3) { + if (fdt_node_offset_by_phandle(blob, fdt32_to_cpu(prop[j])) < 0) + continue; + cooling_dev[k++] = prop[j]; + cooling_dev[k++] = prop[j + 1]; + cooling_dev[k++] = prop[j + 2]; + } - ret = fdt_setprop(blob, nodeoff, "cooling-device", cooling_dev, - sizeof(__le32) * (num_le32 - num_disabled_cores * 3)); - if (ret < 0) { - printf("Warning: %s, cooling-device setprop failed %d\n", - thermal_path[i], ret); - continue; + if (k * sizeof(fdt32_t) != len) { + ret = fdt_setprop(blob, nodeoff, "cooling-device", cooling_dev, + k * sizeof(fdt32_t)); + if (ret < 0) + printf("Warning: %s, cooling-device setprop failed %d\n", + thermal_path[i], ret); + else + printf("Update node %s, cooling-device prop\n", thermal_path[i]); } - printf("Update node %s, cooling-device prop\n", thermal_path[i]); + free(cooling_dev); } - - free(cooling_dev); } int disable_cpu_nodes(void *blob, const char * const *nodes_path, u32 num_disabled_cores, @@ -82,7 +86,7 @@ int disable_cpu_nodes(void *blob, const char * const *nodes_path, u32 num_disabl } } - disable_thermal_cpu_nodes(blob, num_disabled_cores, max_cores); + disable_thermal_cpu_nodes(blob); return 0; }