Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4847114pxu; Thu, 10 Dec 2020 06:58:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzy52SaysZPmNBfopAoMQyiAkzGM6cuxwj5R2PXbuLJtGhDWFVdt0GtDmagYhmXrzjm4b9l X-Received: by 2002:a17:906:af83:: with SMTP id mj3mr6553798ejb.243.1607612296041; Thu, 10 Dec 2020 06:58:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607612296; cv=none; d=google.com; s=arc-20160816; b=lEUNgzM1fPoRJibcVtVbw7MbCMveWatjweB1xJrfDplscpll4Djbhke4ajaWfLxii6 5cNLyqeGC3Dxz19C0vXtmh+pXrGDHrmnpxvCphez5Rt1O4ql3BheU1NzezoM+QX1/2yc nFUp1uVb8dgTAiChxBcraXaTErQPGzGCAGDCjR0KPQY3/dK4+Jg9ZZwItqqbrC62/51d nIZqn9nSsnaewXWzeI4corDWGlyUYjJ/pmmYvgvTsATHZFxhcFSgXAEd/4IokgjNjt+x lh1ARxpLMsKGwdAxkDq4oiuy2NJO57tcYv80ZV2uHEBZDOOjxCVNkjZUAi4M6hbeOmuQ ZKRQ== 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=AfFmYlDUq990VhRnxpYoKhCrY5/sWUQht2ol3RX6enI=; b=V26YM29I8o7LLXFW99ecnvUnGdaI/PX5RJMwErTzOuYM9Lf/kRGz0vnBW+yJCcZb8R 3qYkUrhFNcL+EqptpsLQQ6VhLXdbDrY4JXR2MEHwjRU5dg1jbA1rxxbMuckGJa1NCo9P h+aJuI9rirBaEmWhJ8QnvNp8XX/a9SW4AlpPTfX2u58+DH9gAPXPT7NeRTH5wTp7Nqb7 AH+jN5NX6brTFzCDHWXWRZStqBIO57ZJ9nw4HbhLfnu/5elaQ08N9OzSwLntyFG9JLvE IXzP7NvktMNe6iWD1v8bRAaWmTlTDqfBWMFCpox0m+DJ9+fsnP5dYYlOxI6Hvt9vd8Js Bi2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=efS2DEQL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hh2si1892770ejb.627.2020.12.10.06.57.52; Thu, 10 Dec 2020 06:58:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=efS2DEQL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389903AbgLJOXp (ORCPT + 99 others); Thu, 10 Dec 2020 09:23:45 -0500 Received: from mx2.suse.de ([195.135.220.15]:57150 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389034AbgLJOXg (ORCPT ); Thu, 10 Dec 2020 09:23:36 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1607610169; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=AfFmYlDUq990VhRnxpYoKhCrY5/sWUQht2ol3RX6enI=; b=efS2DEQLXvjpbJOjGAuA0HZJSjkX/2Mpa31mqJ0QvF61sU1F3y01VtX2rhnXfmAcozOnVI fCg16UngQWUj5WjWgNTZR5yYZynUitY6kRkw7Ry50BXOTNoZi/dBJ3Hzy2s3WuZl1eL3eK UVajl02XKP9i1dJj0nZJDbScCWaJ6Pk= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 983E3AC6A; Thu, 10 Dec 2020 14:22:49 +0000 (UTC) From: Mian Yousaf Kaukab To: rjw@rjwysocki.net, lenb@kernel.org, viresh.kumar@linaro.org, ionela.voinescu@arm.com Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Mian Yousaf Kaukab , Petr Cervinka Subject: [PATCH 1/2] acpi: cppc: add cpufreq device Date: Thu, 10 Dec 2020 15:21:38 +0100 Message-Id: <20201210142139.20490-1-yousaf.kaukab@suse.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mian Yousaf Kaukab Since commit 28f06f770454 ("cppc_cpufreq: replace per-cpu structures with lists"), cppc-cpufreq driver doesn't check availability of PSD data before registering with cpufreq core. As a result on a ThunderX2 platform when CPPC is disabled from BIOS, kernel log is spammed with following messages: [ 180.974166] CPPC Cpufreq: Error in acquiring _CPC/_PSD data for CPUxx acpi_cppc_processor_probe() never succeed in this case because acpi_evaluate_object_typed("_CPC") always returns AE_NOT_FOUND. When cpufreq core calls cppc_cpufreq_cpu_init(), driver fails to obtain PSD data and print error messages. Convert cppc-cpufreq driver to a platform driver (done in a separate patch) and add cppc-cpufreq device when acpi_cppc_processor_probe() succeeds. Fixes: 28f06f770454 ("cppc_cpufreq: replace per-cpu structures with lists") Reported-by: Petr Cervinka Signed-off-by: Mian Yousaf Kaukab --- drivers/acpi/cppc_acpi.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 4e478f751ff7..adf9ca3be9fe 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -39,6 +39,7 @@ #include #include #include +#include #include @@ -606,6 +607,23 @@ static bool is_cppc_supported(int revision, int num_ent) return true; } +static void add_cppc_cpufreq_dev(void) +{ + static bool already_added; + + if (!already_added) { + struct platform_device *pdev; + + pdev = platform_device_register_simple("cppc-cpufreq", -1, + NULL, 0); + if (IS_ERR(pdev)) + pr_err("Couldn't register cppc-cpufreq err=%ld\n", + PTR_ERR(pdev)); + else + already_added = true; + } +} + /* * An example CPC table looks like the following. * @@ -815,6 +833,9 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) } kfree(output.pointer); + + add_cppc_cpufreq_dev(); + return 0; out_free: -- 2.26.2