Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86, smpboot: Fix cores per node printing on boot
x86/amd-iommu: Fall back to GART if initialization fails
x86/amd-iommu: Fix crash when request_mem_region fails
x86/mm: Remove unused DBG() macro
arch/x86/kernel: Add missing spin_unlock

+27 -23
+9 -7
arch/x86/kernel/amd_iommu.c
··· 1487 1487 struct protection_domain *domain) 1488 1488 { 1489 1489 struct iommu_dev_data *dev_data, *alias_data; 1490 + int ret; 1490 1491 1491 1492 dev_data = get_dev_data(dev); 1492 1493 alias_data = get_dev_data(dev_data->alias); ··· 1499 1498 spin_lock(&domain->lock); 1500 1499 1501 1500 /* Some sanity checks */ 1501 + ret = -EBUSY; 1502 1502 if (alias_data->domain != NULL && 1503 1503 alias_data->domain != domain) 1504 - return -EBUSY; 1504 + goto out_unlock; 1505 1505 1506 1506 if (dev_data->domain != NULL && 1507 1507 dev_data->domain != domain) 1508 - return -EBUSY; 1508 + goto out_unlock; 1509 1509 1510 1510 /* Do real assignment */ 1511 1511 if (dev_data->alias != dev) { ··· 1522 1520 1523 1521 atomic_inc(&dev_data->bind); 1524 1522 1523 + ret = 0; 1524 + 1525 + out_unlock: 1526 + 1525 1527 /* ready */ 1526 1528 spin_unlock(&domain->lock); 1527 1529 1528 - return 0; 1530 + return ret; 1529 1531 } 1530 1532 1531 1533 /* ··· 2330 2324 2331 2325 iommu_detected = 1; 2332 2326 swiotlb = 0; 2333 - #ifdef CONFIG_GART_IOMMU 2334 - gart_iommu_aperture_disabled = 1; 2335 - gart_iommu_aperture = 0; 2336 - #endif 2337 2327 2338 2328 /* Make the driver finally visible to the drivers */ 2339 2329 dma_ops = &amd_iommu_dma_ops;
+17 -3
arch/x86/kernel/amd_iommu_init.c
··· 287 287 { 288 288 u8 *ret; 289 289 290 - if (!request_mem_region(address, MMIO_REGION_LENGTH, "amd_iommu")) 290 + if (!request_mem_region(address, MMIO_REGION_LENGTH, "amd_iommu")) { 291 + pr_err("AMD-Vi: Can not reserve memory region %llx for mmio\n", 292 + address); 293 + pr_err("AMD-Vi: This is a BIOS bug. Please contact your hardware vendor\n"); 291 294 return NULL; 295 + } 292 296 293 297 ret = ioremap_nocache(address, MMIO_REGION_LENGTH); 294 298 if (ret != NULL) ··· 1318 1314 ret = amd_iommu_init_dma_ops(); 1319 1315 1320 1316 if (ret) 1321 - goto free; 1317 + goto free_disable; 1322 1318 1323 1319 amd_iommu_init_api(); 1324 1320 ··· 1336 1332 out: 1337 1333 return ret; 1338 1334 1339 - free: 1335 + free_disable: 1340 1336 disable_iommus(); 1341 1337 1338 + free: 1342 1339 amd_iommu_uninit_devices(); 1343 1340 1344 1341 free_pages((unsigned long)amd_iommu_pd_alloc_bitmap, ··· 1357 1352 free_iommu_all(); 1358 1353 1359 1354 free_unity_maps(); 1355 + 1356 + #ifdef CONFIG_GART_IOMMU 1357 + /* 1358 + * We failed to initialize the AMD IOMMU - try fallback to GART 1359 + * if possible. 1360 + */ 1361 + gart_iommu_init(); 1362 + 1363 + #endif 1360 1364 1361 1365 goto out; 1362 1366 }
-6
arch/x86/kernel/setup_percpu.c
··· 21 21 #include <asm/cpu.h> 22 22 #include <asm/stackprotector.h> 23 23 24 - #ifdef CONFIG_DEBUG_PER_CPU_MAPS 25 - # define DBG(fmt, ...) pr_dbg(fmt, ##__VA_ARGS__) 26 - #else 27 - # define DBG(fmt, ...) do { if (0) pr_dbg(fmt, ##__VA_ARGS__); } while (0) 28 - #endif 29 - 30 24 DEFINE_PER_CPU(int, cpu_number); 31 25 EXPORT_PER_CPU_SYMBOL(cpu_number); 32 26
+1 -1
arch/x86/kernel/smpboot.c
··· 686 686 static void __cpuinit announce_cpu(int cpu, int apicid) 687 687 { 688 688 static int current_node = -1; 689 - int node = cpu_to_node(cpu); 689 + int node = early_cpu_to_node(cpu); 690 690 691 691 if (system_state == SYSTEM_BOOTING) { 692 692 if (node != current_node) {
-6
arch/x86/mm/numa.c
··· 3 3 #include <linux/module.h> 4 4 #include <linux/bootmem.h> 5 5 6 - #ifdef CONFIG_DEBUG_PER_CPU_MAPS 7 - # define DBG(x...) printk(KERN_DEBUG x) 8 - #else 9 - # define DBG(x...) 10 - #endif 11 - 12 6 /* 13 7 * Which logical CPUs are on which nodes 14 8 */