public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roman Kisel <romank@linux.microsoft.com>
To: bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com,
	ilpo.jarvinen@linux.intel.com, mingo@redhat.com, robh@kernel.org,
	sboyd@kernel.org, ssengar@linux.microsoft.com,
	tglx@linutronix.de, usamaarif642@gmail.com, x86@kernel.org,
	linux-kernel@vger.kernel.org
Cc: apais@microsoft.com, benhill@microsoft.com,
	ssengar@microsoft.com, sunilmut@microsoft.com, vdso@hexbites.dev
Subject: [PATCH] x86/of: Don't log error on the missing IO-APIC unconditionally
Date: Thu,  9 Jan 2025 10:40:15 -0800	[thread overview]
Message-ID: <20250109184015.1674388-1-romank@linux.microsoft.com> (raw)

The x86 OF code reports the missing IO-APIC wihtout any
checks whether the IO-APIC presence is required or not.
That is due to that part of the code being dovetailed to
the Intel MID platform.

Check if the IO-APIC must be available. Log the error only
when the IO-APIC is expected to be present.

Signed-off-by: Roman Kisel <romank@linux.microsoft.com>
---
 arch/x86/kernel/devicetree.c | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
index 59d23cdf4ed0..5b3b47930d1c 100644
--- a/arch/x86/kernel/devicetree.c
+++ b/arch/x86/kernel/devicetree.c
@@ -47,6 +47,15 @@ static struct of_device_id __initdata ce4100_ids[] = {
 	{},
 };
 
+static bool falconfalls_compatible(void)
+{
+	if (!of_have_populated_dt())
+		return false;
+
+	return of_flat_dt_is_compatible(
+			of_get_flat_dt_root(), "intel,falconfalls");
+}
+
 static int __init add_bus_probe(void)
 {
 	if (!of_have_populated_dt())
@@ -259,12 +268,20 @@ static void __init dtb_ioapic_setup(void)
 
 	for_each_compatible_node(dn, NULL, "intel,ce4100-ioapic")
 		dtb_add_ioapic(dn);
+	if (!nr_ioapics && falconfalls_compatible())
+		pr_err("Error: No information about IO-APIC in OF.\n");
 
-	if (nr_ioapics) {
+	if (nr_ioapics)
 		of_ioapic = 1;
-		return;
-	}
-	pr_err("Error: No information about IO-APIC in OF.\n");
+
+	/*
+	 * At this point, it might so happen that no IO-APIC has been discovered.
+	 *
+	 * A general assumption would be that most x86 boards have IO-APIC,
+	 * yet that is not something the kernel should report as a firmware
+	 * bug unconditionally as there are setups (VMs would be an easy example)
+	 * that are able to employ other means of interrupt routing.
+	 */
 }
 #else
 static void __init dtb_ioapic_setup(void) {}

base-commit: eea6e4b4dfb8859446177c32961c96726d0117be
-- 
2.34.1


             reply	other threads:[~2025-01-09 18:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-09 18:40 Roman Kisel [this message]
2025-01-10 19:57 ` [PATCH] x86/of: Don't log error on the missing IO-APIC unconditionally kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250109184015.1674388-1-romank@linux.microsoft.com \
    --to=romank@linux.microsoft.com \
    --cc=apais@microsoft.com \
    --cc=benhill@microsoft.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=ssengar@linux.microsoft.com \
    --cc=ssengar@microsoft.com \
    --cc=sunilmut@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=usamaarif642@gmail.com \
    --cc=vdso@hexbites.dev \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox