Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1729740rwr; Fri, 28 Apr 2023 00:35:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ65KZyPEbqNyGn9AQOBDSLtipoQ+Ry4I3M4MRlrD4r6KopLbIYRWrhvXOZw/68X9Ys01z3e X-Received: by 2002:a05:6a00:234b:b0:63d:254a:3918 with SMTP id j11-20020a056a00234b00b0063d254a3918mr7601568pfj.29.1682667320237; Fri, 28 Apr 2023 00:35:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682667320; cv=none; d=google.com; s=arc-20160816; b=ldmLUJszI9xgdwx6qTqn/aagJBOwxcI0ELHF6Htch2+DzNy9WfS/fU2UGNcADZETZP WD1fZicxDreV71cX5sNx+XiCt0VPTfdSjWGMb6Y6fsZ4+S5Rl4VVFauTyw7iVbKgqs/L jJu4/XKEcSQTdu5zv3hMFx1lWpUwjZsYwVVrKmYvqm2jsrvHBCjMcLIMFOUlSkd5bROA 02r8CN5Ti8XDjHUvqhxx2hRmdS3Bf7Z0lh3rx/xwErQrfjnnHxvj2sadpoJSijRdckzm fkAkTy4JRTDIWzsMEoYtt55QWFq1r1KidH4wa6Cp3bPSvKy031BeNXLqKXjEU+GG+kJn JRIQ== 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=3n/5pi3UktdMdOC7PL3+qtIEfToIjoCQnLGC8cIVVEc=; b=H/jIK8hbG78zX8Ke8sdNFlrkVmI1upuSwHi+Cm06s8E1KQW8kxA94v6YCyfsLkli7d 67xz0ryD/DJZ1cxCbLzEWURwKMQwka4GPZUl/gZ1yYC4iY30JRg1JrxYI1CNtrvtO1EV HgJfRLIrg6DxFiVNOmlS8pxKi5qRwGYr5IDsTbXONR+T0NeJ45cyl9QEBaXU9FBO1pIE y15CnfnUuFOtOJ/Kx//MPVxlGcpm11c1DHSiOKNIMNwA2QAoolNqP2JdFX/P++ov6kNC dC5xZMPLILQ/UFJWnOLYzVQ9/w1fRdErllysZlZfXjy6z8OKo0IJg+mNsKR3KCBbfIPP SQ4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@126.com header.s=s110527 header.b=MvcPxGPu; 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=126.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x24-20020aa78f18000000b0062a450c329dsi20949492pfr.93.2023.04.28.00.35.07; Fri, 28 Apr 2023 00:35:20 -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=@126.com header.s=s110527 header.b=MvcPxGPu; 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=126.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345497AbjD1HT1 (ORCPT + 99 others); Fri, 28 Apr 2023 03:19:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345485AbjD1HTW (ORCPT ); Fri, 28 Apr 2023 03:19:22 -0400 X-Greylist: delayed 918 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 28 Apr 2023 00:19:08 PDT Received: from m126.mail.126.com (m126.mail.126.com [220.181.12.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A2EAB4203; Fri, 28 Apr 2023 00:19:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=3n/5p i3UktdMdOC7PL3+qtIEfToIjoCQnLGC8cIVVEc=; b=MvcPxGPuqb1gxBynrMeoR cNvLwi6VPUcS3QQW0k1sadnaNmHESh2tfqqY04tAl/f9li6iKslx8YgkCflzwB7H IRkmgsHc6TaARjo//iNkZyeXKJjjWpZ2T2FMRXQDYxorQMYREWr6mkqxl5prrnLH q7tWnqD6XmVTHDqge/IMYg= Received: from king.lan (unknown [103.163.180.43]) by zwqz-smtp-mta-g3-1 (Coremail) with SMTP id _____wBn7_i0b0tkcltkAA--.5787S2; Fri, 28 Apr 2023 15:03:18 +0800 (CST) From: wangyouwan@126.com To: rafael@kernel.org, viresh.kumar@linaro.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, youwan Wang Subject: [PATCH] cpufreq: create cooling device based on ACPI Date: Fri, 28 Apr 2023 15:03:14 +0800 Message-Id: <20230428070314.225560-1-wangyouwan@126.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wBn7_i0b0tkcltkAA--.5787S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrZF1kWry8Zw1kWw13KF47XFb_yoWkZwb_Cr 9Ygr9rXr45C3WIqF13Gr40vFn0vw47Wr1xXF10qa9xtFyUArZakr4kXr1UXrWrGw4rGF9r AryjyF4Skr1UGjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRRKZX3UUUUU== X-Originating-IP: [103.163.180.43] X-CM-SenderInfo: 5zdqw5prxzt0a6rslhhfrp/1tbi5RhfFVpD+ETrDwAAs2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_MSPIKE_H2, 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 From: youwan Wang When using the "scpi_cpufreq" driver, an error occurs:cpufreq_cooling: OF node not available for cpu*. The current computer motherboard is using ACPI firmware. Go to see that the error is caused by calling the "of_cpufreq_cooling_register" interface. comment:create cpufreq cooling device based on DT. Signed-off-by: youwan Wang --- drivers/cpufreq/cpufreq.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 6b52ebe5a890..3418c68959d5 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1528,8 +1528,13 @@ static int cpufreq_online(unsigned int cpu) if (cpufreq_driver->ready) cpufreq_driver->ready(policy); - if (cpufreq_thermal_control_enabled(cpufreq_driver)) + if (cpufreq_thermal_control_enabled(cpufreq_driver)) { +#ifdef CONFIG_ACPI + policy->cdev = cpufreq_cooling_register(policy); +#else policy->cdev = of_cpufreq_cooling_register(policy); +#endif + } pr_debug("initialization complete\n"); -- 2.25.1