]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
x86, ioapic: Avoid writing io_apic id if already correct
authorYinghai Lu <yinghai@kernel.org>
Tue, 7 Dec 2010 08:59:49 +0000 (00:59 -0800)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 9 Dec 2010 20:52:05 +0000 (21:52 +0100)
For 32bit mptable path, setup_ids_from_mpc() always writes the io_apic
id register, even there is no change needed.

Skip the write, when readout and mptable match.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
LKML-Reference: <4CFDF785.7010401@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/apic/io_apic.c

index 4abf08aab3d45b062d0c32b575acb51191afb80a..8a0215042a5f081133cab50f5b0ea0857f19ccbe 100644 (file)
@@ -2007,9 +2007,12 @@ void __init setup_ioapic_ids_from_mpc_nocheck(void)
                                                = mp_ioapics[apic_id].apicid;
 
                /*
-                * Read the right value from the MPC table and
-                * write it into the ID register.
+                * Update the ID register according to the right value
+                * from the MPC table if they are different.
                 */
+               if (mp_ioapics[apic_id].apicid == reg_00.bits.ID)
+                       continue;
+
                apic_printk(APIC_VERBOSE, KERN_INFO
                        "...changing IO-APIC physical APIC ID to %d ...",
                        mp_ioapics[apic_id].apicid);