diff options
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/Kconfig | 5 | ||||
-rw-r--r-- | arch/x86_64/kernel/pci-calgary.c | 11 | ||||
-rw-r--r-- | arch/x86_64/kernel/process.c | 6 |
3 files changed, 15 insertions, 7 deletions
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig index d4275537b25..ef667245569 100644 --- a/arch/x86_64/Kconfig +++ b/arch/x86_64/Kconfig @@ -480,14 +480,13 @@ config CALGARY_IOMMU config CALGARY_IOMMU_ENABLED_BY_DEFAULT bool "Should Calgary be enabled by default?" - default y depends on CALGARY_IOMMU help - Should Calgary be enabled by default? if you choose 'y', Calgary + Should Calgary be enabled by default? If you choose 'y', Calgary will be used (if it exists). If you choose 'n', Calgary will not be used even if it exists. If you choose 'n' and would like to use Calgary anyway, pass 'iommu=calgary' on the kernel command line. - If unsure, say Y. + If unsure, say N. # need this always selected by IOMMU for the VIA workaround config SWIOTLB diff --git a/arch/x86_64/kernel/pci-calgary.c b/arch/x86_64/kernel/pci-calgary.c index 3215675ab12..87d90cb68a7 100644 --- a/arch/x86_64/kernel/pci-calgary.c +++ b/arch/x86_64/kernel/pci-calgary.c @@ -1052,7 +1052,7 @@ void __init detect_calgary(void) void *tbl; int calgary_found = 0; unsigned long ptr; - int offset; + unsigned int offset, prev_offset; int ret; /* @@ -1071,15 +1071,20 @@ void __init detect_calgary(void) ptr = (unsigned long)phys_to_virt(get_bios_ebda()); rio_table_hdr = NULL; + prev_offset = 0; offset = 0x180; - while (offset) { + /* + * The next offset is stored in the 1st word. + * Only parse up until the offset increases: + */ + while (offset > prev_offset) { /* The block id is stored in the 2nd word */ if (*((unsigned short *)(ptr + offset + 2)) == 0x4752){ /* set the pointer past the offset & block id */ rio_table_hdr = (struct rio_table_hdr *)(ptr + offset + 4); break; } - /* The next offset is stored in the 1st word. 0 means no more */ + prev_offset = offset; offset = *((unsigned short *)(ptr + offset)); } if (!rio_table_hdr) { diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c index a418ee4c8c6..cbbc6adc1a9 100644 --- a/arch/x86_64/kernel/process.c +++ b/arch/x86_64/kernel/process.c @@ -109,7 +109,11 @@ void exit_idle(void) static void default_idle(void) { current_thread_info()->status &= ~TS_POLLING; - smp_mb__after_clear_bit(); + /* + * TS_POLLING-cleared state must be visible before we + * test NEED_RESCHED: + */ + smp_mb(); local_irq_disable(); if (!need_resched()) { /* Enables interrupts one instruction before HLT. |