summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/sfi.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2010-06-08 18:44:32 (GMT)
committerH. Peter Anvin <hpa@linux.intel.com>2010-06-09 20:34:06 (GMT)
commita4384df3e24579d6292a1b3b41d500349948f30b (patch)
tree02325b2ff1523f5813eb17dce63dff1cdd6f47a2 /arch/x86/kernel/sfi.c
parentfc4ac7a5f5996712d9123ae4850948c640edb315 (diff)
downloadlinux-fsl-qoriq-a4384df3e24579d6292a1b3b41d500349948f30b.tar.xz
x86, irq: Rename gsi_end gsi_top, and fix off by one errors
When I introduced the global variable gsi_end I thought gsi_end on io_apics was one past the end of the gsi range for the io_apic. After it was pointed out the the range on io_apics was inclusive I changed my global variable to match. That was a big mistake. Inclusive semantics without a range start cannot describe the case when no gsi's are allocated. Describing the case where no gsi's are allocated is important in sfi.c and mpparse.c so that we can assign gsi numbers instead of blindly copying the gsi assignments the BIOS has done as we do in the acpi case. To keep from getting the global variable confused with the gsi range end rename it gsi_top. To allow describing the case where no gsi's are allocated have gsi_top be one place the highest gsi number seen in the system. This fixes an off by one bug in sfi.c: Reported-by: jacob pan <jacob.jun.pan@linux.intel.com> This fixes the same off by one bug in mpparse.c: This fixes an off unreachable by one bug in acpi/boot.c:irq_to_gsi Reported-by: Yinghai <yinghai.lu@oracle.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> LKML-Reference: <m17hm9jre7.fsf_-_@fess.ebiederm.org> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/kernel/sfi.c')
-rw-r--r--arch/x86/kernel/sfi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/sfi.c b/arch/x86/kernel/sfi.c
index 7ded578..cb22acf 100644
--- a/arch/x86/kernel/sfi.c
+++ b/arch/x86/kernel/sfi.c
@@ -93,7 +93,7 @@ static int __init sfi_parse_ioapic(struct sfi_table_header *table)
pentry = (struct sfi_apic_table_entry *)sb->pentry;
for (i = 0; i < num; i++) {
- mp_register_ioapic(i, pentry->phys_addr, gsi_end + 1);
+ mp_register_ioapic(i, pentry->phys_addr, gsi_top);
pentry++;
}