[PATCH v2] x86, ioapic: Skip looking for ioapic overrides when ioapics are not present

From: Florian Mickler
Date: Thu Mar 31 2011 - 21:25:23 EST


From: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>

Avinash Kurup reported:

|
| ÂÂÂ I get the following errors while booting into 2.6.35-rc1. I did not
| get these in 2.6.34. The computer however boots and works fine, so its not
| serious but the following errors are displayed in dmesg:
|
| [ÂÂÂ 0.089969] ERROR: Unable to locate IOAPIC for GSI 13
| [ÂÂÂ 0.090556] ERROR: Unable to locate IOAPIC for GSI 8
| [ÂÂÂ 0.091104] ERROR: Unable to locate IOAPIC for GSI 12
| [ÂÂÂ 0.091375] ERROR: Unable to locate IOAPIC for GSI 1
| [ÂÂÂ 0.093195] ERROR: Unable to locate IOAPIC for GSI 4
| [ÂÂÂ 0.094342] ERROR: Unable to locate IOAPIC for GSI 10
| [ÂÂÂ 0.096335] ERROR: Unable to locate IOAPIC for GSI 6
|

The new warning originates from acpi_get_override_irq(), which I
recently changed to use helper functions:

9a0a91bb56d2: x86, acpi/irq: Teach acpi_get_override_irq to take a gsi not an isa_irq

These helper functions have the side-effect that they warn when
they fail harmlessly.

When IOAPICs and ACPI are enabled in a kernel and run on ACPI
hardware that doesn't use the ioapics the pnp acpi code calls
this function, looking for ACPI irq overrides. ACPI irq
overrides exist only in the ioapic case so this function will
never succeed.

So make the function fail quickly and silently so we don't call
into help functions that legitimately complain when they fail.

Reference: https://bugzilla.kernel.org/show_bug.cgi?id=17772
Reported-and-Tested-by: Avinash Kurup <kurup.avinash@xxxxxxxxx>
Tested-by: zersaa@xxxxxxxxx
Signed-off-by: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>
Signed-off-by: Florian Mickler <florian@xxxxxxxxxxx>
[ #ifdef's added, revert of 678301ecadec squashed -Florian]
Cc: kurup_avinash@xxxxxxxxx
Cc: maciej.rutecki@xxxxxxxxx
Cc: rjw@xxxxxxx
Cc: sedat.dilek@xxxxxxxxx
Cc: <stable@xxxxxxxxxx> # .34+
LKML-Reference: <1301558489-4198-1-git-send-email-florian@xxxxxxxxxxx>
---
Hi Ingo,

here is the revised patch. I squashed the revert of 678301ecadec into this
and put ifdefs around it to avoid breaking the build...

Regards,
Flo

arch/x86/kernel/apic/io_apic.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 68df09b..edf86ca 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3789,6 +3789,10 @@ int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity)
{
int ioapic, pin, idx;

+#ifdef CONFIG_ACPI
+ if (acpi_irq_model != ACPI_IRQ_MODEL_IOAPIC)
+ return -1;
+#endif
if (skip_ioapic_setup)
return -1;

@@ -3951,9 +3955,6 @@ int mp_find_ioapic(u32 gsi)
{
int i = 0;

- if (nr_ioapics == 0)
- return -1;
-
/* Find the IOAPIC that manages this GSI. */
for (i = 0; i < nr_ioapics; i++) {
if ((gsi >= mp_gsi_routing[i].gsi_base)
--
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/