diff options
34 files changed, 248 insertions, 259 deletions
diff --git a/arch/Kconfig b/arch/Kconfig index e6ab550bceb3..8977d99987cb 100644 --- a/arch/Kconfig +++ b/arch/Kconfig | |||
| @@ -21,7 +21,7 @@ config OPROFILE_IBS | |||
| 21 | Instruction-Based Sampling (IBS) is a new profiling | 21 | Instruction-Based Sampling (IBS) is a new profiling |
| 22 | technique that provides rich, precise program performance | 22 | technique that provides rich, precise program performance |
| 23 | information. IBS is introduced by AMD Family10h processors | 23 | information. IBS is introduced by AMD Family10h processors |
| 24 | (AMD Opteron Quad-Core processor “Barcelona”) to overcome | 24 | (AMD Opteron Quad-Core processor "Barcelona") to overcome |
| 25 | the limitations of conventional performance counter | 25 | the limitations of conventional performance counter |
| 26 | sampling. | 26 | sampling. |
| 27 | 27 | ||
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 27eec71429b0..6bd91ed7cd03 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
| @@ -148,6 +148,7 @@ config IA64_GENERIC | |||
| 148 | select ACPI_NUMA | 148 | select ACPI_NUMA |
| 149 | select SWIOTLB | 149 | select SWIOTLB |
| 150 | select PCI_MSI | 150 | select PCI_MSI |
| 151 | select DMAR | ||
| 151 | help | 152 | help |
| 152 | This selects the system type of your hardware. A "generic" kernel | 153 | This selects the system type of your hardware. A "generic" kernel |
| 153 | will run on any supported IA-64 system. However, if you configure | 154 | will run on any supported IA-64 system. However, if you configure |
| @@ -585,7 +586,7 @@ source "fs/Kconfig.binfmt" | |||
| 585 | 586 | ||
| 586 | endmenu | 587 | endmenu |
| 587 | 588 | ||
| 588 | menu "Power management and ACPI" | 589 | menu "Power management and ACPI options" |
| 589 | 590 | ||
| 590 | source "kernel/power/Kconfig" | 591 | source "kernel/power/Kconfig" |
| 591 | 592 | ||
| @@ -641,6 +642,8 @@ source "net/Kconfig" | |||
| 641 | 642 | ||
| 642 | source "drivers/Kconfig" | 643 | source "drivers/Kconfig" |
| 643 | 644 | ||
| 645 | source "arch/ia64/hp/sim/Kconfig" | ||
| 646 | |||
| 644 | config MSPEC | 647 | config MSPEC |
| 645 | tristate "Memory special operations driver" | 648 | tristate "Memory special operations driver" |
| 646 | depends on IA64 | 649 | depends on IA64 |
| @@ -652,6 +655,12 @@ config MSPEC | |||
| 652 | 655 | ||
| 653 | source "fs/Kconfig" | 656 | source "fs/Kconfig" |
| 654 | 657 | ||
| 658 | source "arch/ia64/Kconfig.debug" | ||
| 659 | |||
| 660 | source "security/Kconfig" | ||
| 661 | |||
| 662 | source "crypto/Kconfig" | ||
| 663 | |||
| 655 | source "arch/ia64/kvm/Kconfig" | 664 | source "arch/ia64/kvm/Kconfig" |
| 656 | 665 | ||
| 657 | source "lib/Kconfig" | 666 | source "lib/Kconfig" |
| @@ -678,11 +687,3 @@ config IRQ_PER_CPU | |||
| 678 | 687 | ||
| 679 | config IOMMU_HELPER | 688 | config IOMMU_HELPER |
| 680 | def_bool (IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_GENERIC || SWIOTLB) | 689 | def_bool (IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_GENERIC || SWIOTLB) |
| 681 | |||
| 682 | source "arch/ia64/hp/sim/Kconfig" | ||
| 683 | |||
| 684 | source "arch/ia64/Kconfig.debug" | ||
| 685 | |||
| 686 | source "security/Kconfig" | ||
| 687 | |||
| 688 | source "crypto/Kconfig" | ||
diff --git a/arch/ia64/hp/common/hwsw_iommu.c b/arch/ia64/hp/common/hwsw_iommu.c index 88b6e6f3fd88..2769dbfd03bf 100644 --- a/arch/ia64/hp/common/hwsw_iommu.c +++ b/arch/ia64/hp/common/hwsw_iommu.c | |||
| @@ -13,19 +13,12 @@ | |||
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #include <linux/device.h> | 15 | #include <linux/device.h> |
| 16 | #include <linux/swiotlb.h> | ||
| 16 | 17 | ||
| 17 | #include <asm/machvec.h> | 18 | #include <asm/machvec.h> |
| 18 | 19 | ||
| 19 | /* swiotlb declarations & definitions: */ | 20 | /* swiotlb declarations & definitions: */ |
| 20 | extern int swiotlb_late_init_with_default_size (size_t size); | 21 | extern int swiotlb_late_init_with_default_size (size_t size); |
| 21 | extern ia64_mv_dma_alloc_coherent swiotlb_alloc_coherent; | ||
| 22 | extern ia64_mv_dma_free_coherent swiotlb_free_coherent; | ||
| 23 | extern ia64_mv_dma_map_single_attrs swiotlb_map_single_attrs; | ||
| 24 | extern ia64_mv_dma_unmap_single_attrs swiotlb_unmap_single_attrs; | ||
| 25 | extern ia64_mv_dma_map_sg_attrs swiotlb_map_sg_attrs; | ||
| 26 | extern ia64_mv_dma_unmap_sg_attrs swiotlb_unmap_sg_attrs; | ||
| 27 | extern ia64_mv_dma_supported swiotlb_dma_supported; | ||
| 28 | extern ia64_mv_dma_mapping_error swiotlb_dma_mapping_error; | ||
| 29 | 22 | ||
| 30 | /* hwiommu declarations & definitions: */ | 23 | /* hwiommu declarations & definitions: */ |
| 31 | 24 | ||
diff --git a/arch/ia64/include/asm/io.h b/arch/ia64/include/asm/io.h index 7f257507cd86..0d9d16e2d949 100644 --- a/arch/ia64/include/asm/io.h +++ b/arch/ia64/include/asm/io.h | |||
| @@ -434,28 +434,4 @@ extern void memset_io(volatile void __iomem *s, int c, long n); | |||
| 434 | 434 | ||
| 435 | # endif /* __KERNEL__ */ | 435 | # endif /* __KERNEL__ */ |
| 436 | 436 | ||
| 437 | /* | ||
| 438 | * Enabling BIO_VMERGE_BOUNDARY forces us to turn off I/O MMU bypassing. It is said that | ||
| 439 | * BIO-level virtual merging can give up to 4% performance boost (not verified for ia64). | ||
| 440 | * On the other hand, we know that I/O MMU bypassing gives ~8% performance improvement on | ||
| 441 | * SPECweb-like workloads on zx1-based machines. Thus, for now we favor I/O MMU bypassing | ||
| 442 | * over BIO-level virtual merging. | ||
| 443 | */ | ||
| 444 | extern unsigned long ia64_max_iommu_merge_mask; | ||
| 445 | #if 1 | ||
| 446 | #define BIO_VMERGE_BOUNDARY 0 | ||
| 447 | #else | ||
| 448 | /* | ||
| 449 | * It makes no sense at all to have this BIO_VMERGE_BOUNDARY macro here. Should be | ||
| 450 | * replaced by dma_merge_mask() or something of that sort. Note: the only way | ||
| 451 | * BIO_VMERGE_BOUNDARY is used is to mask off bits. Effectively, our definition gets | ||
| 452 | * expanded into: | ||
| 453 | * | ||
| 454 | * addr & ((ia64_max_iommu_merge_mask + 1) - 1) == (addr & ia64_max_iommu_vmerge_mask) | ||
| 455 | * | ||
| 456 | * which is precisely what we want. | ||
| 457 | */ | ||
| 458 | #define BIO_VMERGE_BOUNDARY (ia64_max_iommu_merge_mask + 1) | ||
| 459 | #endif | ||
| 460 | |||
| 461 | #endif /* _ASM_IA64_IO_H */ | 437 | #endif /* _ASM_IA64_IO_H */ |
diff --git a/arch/ia64/include/asm/machvec.h b/arch/ia64/include/asm/machvec.h index 1ea28bcee33b..59c17e446683 100644 --- a/arch/ia64/include/asm/machvec.h +++ b/arch/ia64/include/asm/machvec.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #define _ASM_IA64_MACHVEC_H | 11 | #define _ASM_IA64_MACHVEC_H |
| 12 | 12 | ||
| 13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
| 14 | #include <linux/swiotlb.h> | ||
| 14 | 15 | ||
| 15 | /* forward declarations: */ | 16 | /* forward declarations: */ |
| 16 | struct device; | 17 | struct device; |
| @@ -298,27 +299,6 @@ extern void machvec_init_from_cmdline(const char *cmdline); | |||
| 298 | # endif /* CONFIG_IA64_GENERIC */ | 299 | # endif /* CONFIG_IA64_GENERIC */ |
| 299 | 300 | ||
| 300 | /* | 301 | /* |
| 301 | * Declare default routines which aren't declared anywhere else: | ||
| 302 | */ | ||
| 303 | extern ia64_mv_dma_init swiotlb_init; | ||
| 304 | extern ia64_mv_dma_alloc_coherent swiotlb_alloc_coherent; | ||
| 305 | extern ia64_mv_dma_free_coherent swiotlb_free_coherent; | ||
| 306 | extern ia64_mv_dma_map_single swiotlb_map_single; | ||
| 307 | extern ia64_mv_dma_map_single_attrs swiotlb_map_single_attrs; | ||
| 308 | extern ia64_mv_dma_unmap_single swiotlb_unmap_single; | ||
| 309 | extern ia64_mv_dma_unmap_single_attrs swiotlb_unmap_single_attrs; | ||
| 310 | extern ia64_mv_dma_map_sg swiotlb_map_sg; | ||
| 311 | extern ia64_mv_dma_map_sg_attrs swiotlb_map_sg_attrs; | ||
| 312 | extern ia64_mv_dma_unmap_sg swiotlb_unmap_sg; | ||
| 313 | extern ia64_mv_dma_unmap_sg_attrs swiotlb_unmap_sg_attrs; | ||
| 314 | extern ia64_mv_dma_sync_single_for_cpu swiotlb_sync_single_for_cpu; | ||
| 315 | extern ia64_mv_dma_sync_sg_for_cpu swiotlb_sync_sg_for_cpu; | ||
| 316 | extern ia64_mv_dma_sync_single_for_device swiotlb_sync_single_for_device; | ||
| 317 | extern ia64_mv_dma_sync_sg_for_device swiotlb_sync_sg_for_device; | ||
| 318 | extern ia64_mv_dma_mapping_error swiotlb_dma_mapping_error; | ||
| 319 | extern ia64_mv_dma_supported swiotlb_dma_supported; | ||
| 320 | |||
| 321 | /* | ||
| 322 | * Define default versions so we can extend machvec for new platforms without having | 302 | * Define default versions so we can extend machvec for new platforms without having |
| 323 | * to update the machvec files for all existing platforms. | 303 | * to update the machvec files for all existing platforms. |
| 324 | */ | 304 | */ |
diff --git a/arch/ia64/include/asm/meminit.h b/arch/ia64/include/asm/meminit.h index 6bc96ee54327..c0cea375620a 100644 --- a/arch/ia64/include/asm/meminit.h +++ b/arch/ia64/include/asm/meminit.h | |||
| @@ -48,7 +48,6 @@ extern int reserve_elfcorehdr(unsigned long *start, unsigned long *end); | |||
| 48 | */ | 48 | */ |
| 49 | #define GRANULEROUNDDOWN(n) ((n) & ~(IA64_GRANULE_SIZE-1)) | 49 | #define GRANULEROUNDDOWN(n) ((n) & ~(IA64_GRANULE_SIZE-1)) |
| 50 | #define GRANULEROUNDUP(n) (((n)+IA64_GRANULE_SIZE-1) & ~(IA64_GRANULE_SIZE-1)) | 50 | #define GRANULEROUNDUP(n) (((n)+IA64_GRANULE_SIZE-1) & ~(IA64_GRANULE_SIZE-1)) |
| 51 | #define ORDERROUNDDOWN(n) ((n) & ~((PAGE_SIZE<<MAX_ORDER)-1)) | ||
| 52 | 51 | ||
| 53 | #ifdef CONFIG_NUMA | 52 | #ifdef CONFIG_NUMA |
| 54 | extern void call_pernode_memory (unsigned long start, unsigned long len, void *func); | 53 | extern void call_pernode_memory (unsigned long start, unsigned long len, void *func); |
diff --git a/arch/ia64/include/asm/sal.h b/arch/ia64/include/asm/sal.h index ea310c0812aa..966797a97c94 100644 --- a/arch/ia64/include/asm/sal.h +++ b/arch/ia64/include/asm/sal.h | |||
| @@ -337,11 +337,24 @@ typedef struct sal_log_record_header { | |||
| 337 | #define sal_log_severity_fatal 1 | 337 | #define sal_log_severity_fatal 1 |
| 338 | #define sal_log_severity_corrected 2 | 338 | #define sal_log_severity_corrected 2 |
| 339 | 339 | ||
| 340 | /* | ||
| 341 | * Error Recovery Info (ERI) bit decode. From SAL Spec section B.2.2 Table B-3 | ||
| 342 | * Error Section Error_Recovery_Info Field Definition. | ||
| 343 | */ | ||
| 344 | #define ERI_NOT_VALID 0x0 /* Error Recovery Field is not valid */ | ||
| 345 | #define ERI_NOT_ACCESSIBLE 0x30 /* Resource not accessible */ | ||
| 346 | #define ERI_CONTAINMENT_WARN 0x22 /* Corrupt data propagated */ | ||
| 347 | #define ERI_UNCORRECTED_ERROR 0x20 /* Uncorrected error */ | ||
| 348 | #define ERI_COMPONENT_RESET 0x24 /* Component must be reset */ | ||
| 349 | #define ERI_CORR_ERROR_LOG 0x21 /* Corrected error, needs logging */ | ||
| 350 | #define ERI_CORR_ERROR_THRESH 0x29 /* Corrected error threshold exceeded */ | ||
| 351 | |||
| 340 | /* Definition of log section header structures */ | 352 | /* Definition of log section header structures */ |
| 341 | typedef struct sal_log_sec_header { | 353 | typedef struct sal_log_sec_header { |
| 342 | efi_guid_t guid; /* Unique Section ID */ | 354 | efi_guid_t guid; /* Unique Section ID */ |
| 343 | sal_log_revision_t revision; /* Major and Minor revision of Section */ | 355 | sal_log_revision_t revision; /* Major and Minor revision of Section */ |
| 344 | u16 reserved; | 356 | u8 error_recovery_info; /* Platform error recovery status */ |
| 357 | u8 reserved; | ||
| 345 | u32 len; /* Section length */ | 358 | u32 len; /* Section length */ |
| 346 | } sal_log_section_hdr_t; | 359 | } sal_log_section_hdr_t; |
| 347 | 360 | ||
diff --git a/arch/ia64/include/asm/sn/sn_sal.h b/arch/ia64/include/asm/sn/sn_sal.h index 57e649d388b8..e310fc0135dc 100644 --- a/arch/ia64/include/asm/sn/sn_sal.h +++ b/arch/ia64/include/asm/sn/sn_sal.h | |||
| @@ -90,6 +90,8 @@ | |||
| 90 | #define SN_SAL_SET_CPU_NUMBER 0x02000068 | 90 | #define SN_SAL_SET_CPU_NUMBER 0x02000068 |
| 91 | 91 | ||
| 92 | #define SN_SAL_KERNEL_LAUNCH_EVENT 0x02000069 | 92 | #define SN_SAL_KERNEL_LAUNCH_EVENT 0x02000069 |
| 93 | #define SN_SAL_WATCHLIST_ALLOC 0x02000070 | ||
| 94 | #define SN_SAL_WATCHLIST_FREE 0x02000071 | ||
| 93 | 95 | ||
| 94 | /* | 96 | /* |
| 95 | * Service-specific constants | 97 | * Service-specific constants |
| @@ -1185,4 +1187,47 @@ ia64_sn_kernel_launch_event(void) | |||
| 1185 | SAL_CALL_NOLOCK(rv, SN_SAL_KERNEL_LAUNCH_EVENT, 0, 0, 0, 0, 0, 0, 0); | 1187 | SAL_CALL_NOLOCK(rv, SN_SAL_KERNEL_LAUNCH_EVENT, 0, 0, 0, 0, 0, 0, 0); |
| 1186 | return rv.status; | 1188 | return rv.status; |
| 1187 | } | 1189 | } |
| 1190 | |||
| 1191 | union sn_watchlist_u { | ||
| 1192 | u64 val; | ||
| 1193 | struct { | ||
| 1194 | u64 blade : 16, | ||
| 1195 | size : 32, | ||
| 1196 | filler : 16; | ||
| 1197 | }; | ||
| 1198 | }; | ||
| 1199 | |||
| 1200 | static inline int | ||
| 1201 | sn_mq_watchlist_alloc(int blade, void *mq, unsigned int mq_size, | ||
| 1202 | unsigned long *intr_mmr_offset) | ||
| 1203 | { | ||
| 1204 | struct ia64_sal_retval rv; | ||
| 1205 | unsigned long addr; | ||
| 1206 | union sn_watchlist_u size_blade; | ||
| 1207 | int watchlist; | ||
| 1208 | |||
| 1209 | addr = (unsigned long)mq; | ||
| 1210 | size_blade.size = mq_size; | ||
| 1211 | size_blade.blade = blade; | ||
| 1212 | |||
| 1213 | /* | ||
| 1214 | * bios returns watchlist number or negative error number. | ||
| 1215 | */ | ||
| 1216 | ia64_sal_oemcall_nolock(&rv, SN_SAL_WATCHLIST_ALLOC, addr, | ||
| 1217 | size_blade.val, (u64)intr_mmr_offset, | ||
| 1218 | (u64)&watchlist, 0, 0, 0); | ||
| 1219 | if (rv.status < 0) | ||
| 1220 | return rv.status; | ||
| 1221 | |||
| 1222 | return watchlist; | ||
| 1223 | } | ||
| 1224 | |||
| 1225 | static inline int | ||
| 1226 | sn_mq_watchlist_free(int blade, int watchlist_num) | ||
| 1227 | { | ||
| 1228 | struct ia64_sal_retval rv; | ||
| 1229 | ia64_sal_oemcall_nolock(&rv, SN_SAL_WATCHLIST_FREE, blade, | ||
| 1230 | watchlist_num, 0, 0, 0, 0, 0); | ||
| 1231 | return rv.status; | ||
| 1232 | } | ||
| 1188 | #endif /* _ASM_IA64_SN_SN_SAL_H */ | 1233 | #endif /* _ASM_IA64_SN_SN_SAL_H */ |
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 0635015d0aaa..bd7acc71e8a9 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
| @@ -678,6 +678,30 @@ static int __init acpi_parse_fadt(struct acpi_table_header *table) | |||
| 678 | return 0; | 678 | return 0; |
| 679 | } | 679 | } |
| 680 | 680 | ||
| 681 | int __init early_acpi_boot_init(void) | ||
| 682 | { | ||
| 683 | int ret; | ||
| 684 | |||
| 685 | /* | ||
| 686 | * do a partial walk of MADT to determine how many CPUs | ||
| 687 | * we have including offline CPUs | ||
| 688 | */ | ||
| 689 | if (acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt)) { | ||
| 690 | printk(KERN_ERR PREFIX "Can't find MADT\n"); | ||
| 691 | return 0; | ||
| 692 | } | ||
| 693 | |||
| 694 | ret = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_SAPIC, | ||
| 695 | acpi_parse_lsapic, NR_CPUS); | ||
| 696 | if (ret < 1) | ||
| 697 | printk(KERN_ERR PREFIX | ||
| 698 | "Error parsing MADT - no LAPIC entries\n"); | ||
| 699 | |||
| 700 | return 0; | ||
| 701 | } | ||
| 702 | |||
| 703 | |||
| 704 | |||
| 681 | int __init acpi_boot_init(void) | 705 | int __init acpi_boot_init(void) |
| 682 | { | 706 | { |
| 683 | 707 | ||
| @@ -701,11 +725,6 @@ int __init acpi_boot_init(void) | |||
| 701 | printk(KERN_ERR PREFIX | 725 | printk(KERN_ERR PREFIX |
| 702 | "Error parsing LAPIC address override entry\n"); | 726 | "Error parsing LAPIC address override entry\n"); |
| 703 | 727 | ||
| 704 | if (acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_SAPIC, acpi_parse_lsapic, NR_CPUS) | ||
| 705 | < 1) | ||
| 706 | printk(KERN_ERR PREFIX | ||
| 707 | "Error parsing MADT - no LAPIC entries\n"); | ||
| 708 | |||
| 709 | if (acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_NMI, acpi_parse_lapic_nmi, 0) | 728 | if (acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_NMI, acpi_parse_lapic_nmi, 0) |
| 710 | < 0) | 729 | < 0) |
| 711 | printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); | 730 | printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); |
diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c index 031abbf9c875..dbdb778efa05 100644 --- a/arch/ia64/kernel/pci-dma.c +++ b/arch/ia64/kernel/pci-dma.c | |||
| @@ -12,13 +12,11 @@ | |||
| 12 | #include <asm/machvec.h> | 12 | #include <asm/machvec.h> |
| 13 | #include <linux/dma-mapping.h> | 13 | #include <linux/dma-mapping.h> |
| 14 | 14 | ||
| 15 | #include <asm/machvec.h> | ||
| 16 | #include <asm/system.h> | 15 | #include <asm/system.h> |
| 17 | 16 | ||
| 18 | #ifdef CONFIG_DMAR | 17 | #ifdef CONFIG_DMAR |
| 19 | 18 | ||
| 20 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
| 21 | #include <linux/string.h> | ||
| 22 | 20 | ||
| 23 | #include <asm/page.h> | 21 | #include <asm/page.h> |
| 24 | #include <asm/iommu.h> | 22 | #include <asm/iommu.h> |
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index ae7911702bf8..865af27c7737 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
| @@ -359,7 +359,7 @@ reserve_memory (void) | |||
| 359 | } | 359 | } |
| 360 | #endif | 360 | #endif |
| 361 | 361 | ||
| 362 | #ifdef CONFIG_CRASH_KERNEL | 362 | #ifdef CONFIG_CRASH_DUMP |
| 363 | if (reserve_elfcorehdr(&rsvd_region[n].start, | 363 | if (reserve_elfcorehdr(&rsvd_region[n].start, |
| 364 | &rsvd_region[n].end) == 0) | 364 | &rsvd_region[n].end) == 0) |
| 365 | n++; | 365 | n++; |
| @@ -561,8 +561,12 @@ setup_arch (char **cmdline_p) | |||
| 561 | #ifdef CONFIG_ACPI | 561 | #ifdef CONFIG_ACPI |
| 562 | /* Initialize the ACPI boot-time table parser */ | 562 | /* Initialize the ACPI boot-time table parser */ |
| 563 | acpi_table_init(); | 563 | acpi_table_init(); |
| 564 | early_acpi_boot_init(); | ||
| 564 | # ifdef CONFIG_ACPI_NUMA | 565 | # ifdef CONFIG_ACPI_NUMA |
| 565 | acpi_numa_init(); | 566 | acpi_numa_init(); |
| 567 | #ifdef CONFIG_ACPI_HOTPLUG_CPU | ||
| 568 | prefill_possible_map(); | ||
| 569 | #endif | ||
| 566 | per_cpu_scan_finalize((cpus_weight(early_cpu_possible_map) == 0 ? | 570 | per_cpu_scan_finalize((cpus_weight(early_cpu_possible_map) == 0 ? |
| 567 | 32 : cpus_weight(early_cpu_possible_map)), | 571 | 32 : cpus_weight(early_cpu_possible_map)), |
| 568 | additional_cpus > 0 ? additional_cpus : 0); | 572 | additional_cpus > 0 ? additional_cpus : 0); |
| @@ -853,9 +857,6 @@ void __init | |||
| 853 | setup_per_cpu_areas (void) | 857 | setup_per_cpu_areas (void) |
| 854 | { | 858 | { |
| 855 | /* start_kernel() requires this... */ | 859 | /* start_kernel() requires this... */ |
| 856 | #ifdef CONFIG_ACPI_HOTPLUG_CPU | ||
| 857 | prefill_possible_map(); | ||
| 858 | #endif | ||
| 859 | } | 860 | } |
| 860 | 861 | ||
| 861 | /* | 862 | /* |
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c index d8c5fcd89e5b..d85ba98d9008 100644 --- a/arch/ia64/mm/discontig.c +++ b/arch/ia64/mm/discontig.c | |||
| @@ -635,7 +635,6 @@ static __init int count_node_pages(unsigned long start, unsigned long len, int n | |||
| 635 | (min(end, __pa(MAX_DMA_ADDRESS)) - start) >>PAGE_SHIFT; | 635 | (min(end, __pa(MAX_DMA_ADDRESS)) - start) >>PAGE_SHIFT; |
| 636 | #endif | 636 | #endif |
| 637 | start = GRANULEROUNDDOWN(start); | 637 | start = GRANULEROUNDDOWN(start); |
| 638 | start = ORDERROUNDDOWN(start); | ||
| 639 | end = GRANULEROUNDUP(end); | 638 | end = GRANULEROUNDUP(end); |
| 640 | mem_data[node].max_pfn = max(mem_data[node].max_pfn, | 639 | mem_data[node].max_pfn = max(mem_data[node].max_pfn, |
| 641 | end >> PAGE_SHIFT); | 640 | end >> PAGE_SHIFT); |
diff --git a/arch/ia64/uv/kernel/setup.c b/arch/ia64/uv/kernel/setup.c index cf5f28ae96c4..7a5ae633198b 100644 --- a/arch/ia64/uv/kernel/setup.c +++ b/arch/ia64/uv/kernel/setup.c | |||
| @@ -19,6 +19,12 @@ EXPORT_PER_CPU_SYMBOL_GPL(__uv_hub_info); | |||
| 19 | 19 | ||
| 20 | #ifdef CONFIG_IA64_SGI_UV | 20 | #ifdef CONFIG_IA64_SGI_UV |
| 21 | int sn_prom_type; | 21 | int sn_prom_type; |
| 22 | long sn_partition_id; | ||
| 23 | EXPORT_SYMBOL(sn_partition_id); | ||
| 24 | long sn_coherency_id; | ||
| 25 | EXPORT_SYMBOL_GPL(sn_coherency_id); | ||
| 26 | long sn_region_size; | ||
| 27 | EXPORT_SYMBOL(sn_region_size); | ||
| 22 | #endif | 28 | #endif |
| 23 | 29 | ||
| 24 | struct redir_addr { | 30 | struct redir_addr { |
diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c index 0620d6d45f7d..3f1b81a83e2e 100644 --- a/arch/x86/oprofile/op_model_ppro.c +++ b/arch/x86/oprofile/op_model_ppro.c | |||
| @@ -27,8 +27,7 @@ static int num_counters = 2; | |||
| 27 | static int counter_width = 32; | 27 | static int counter_width = 32; |
| 28 | 28 | ||
| 29 | #define CTR_IS_RESERVED(msrs, c) (msrs->counters[(c)].addr ? 1 : 0) | 29 | #define CTR_IS_RESERVED(msrs, c) (msrs->counters[(c)].addr ? 1 : 0) |
| 30 | #define CTR_READ(l, h, msrs, c) do {rdmsr(msrs->counters[(c)].addr, (l), (h)); } while (0) | 30 | #define CTR_OVERFLOWED(n) (!((n) & (1ULL<<(counter_width-1)))) |
| 31 | #define CTR_OVERFLOWED(n) (!((n) & (1U<<(counter_width-1)))) | ||
| 32 | 31 | ||
| 33 | #define CTRL_IS_RESERVED(msrs, c) (msrs->controls[(c)].addr ? 1 : 0) | 32 | #define CTRL_IS_RESERVED(msrs, c) (msrs->controls[(c)].addr ? 1 : 0) |
| 34 | #define CTRL_READ(l, h, msrs, c) do {rdmsr((msrs->controls[(c)].addr), (l), (h)); } while (0) | 33 | #define CTRL_READ(l, h, msrs, c) do {rdmsr((msrs->controls[(c)].addr), (l), (h)); } while (0) |
| @@ -124,14 +123,14 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs) | |||
| 124 | static int ppro_check_ctrs(struct pt_regs * const regs, | 123 | static int ppro_check_ctrs(struct pt_regs * const regs, |
| 125 | struct op_msrs const * const msrs) | 124 | struct op_msrs const * const msrs) |
| 126 | { | 125 | { |
| 127 | unsigned int low, high; | 126 | u64 val; |
| 128 | int i; | 127 | int i; |
| 129 | 128 | ||
| 130 | for (i = 0 ; i < num_counters; ++i) { | 129 | for (i = 0 ; i < num_counters; ++i) { |
| 131 | if (!reset_value[i]) | 130 | if (!reset_value[i]) |
| 132 | continue; | 131 | continue; |
| 133 | CTR_READ(low, high, msrs, i); | 132 | rdmsrl(msrs->counters[i].addr, val); |
| 134 | if (CTR_OVERFLOWED(low)) { | 133 | if (CTR_OVERFLOWED(val)) { |
| 135 | oprofile_add_sample(regs, i); | 134 | oprofile_add_sample(regs, i); |
| 136 | wrmsrl(msrs->counters[i].addr, -reset_value[i]); | 135 | wrmsrl(msrs->counters[i].addr, -reset_value[i]); |
| 137 | } | 136 | } |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index b61534c7a4c4..5e4686d70f62 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
| @@ -863,15 +863,16 @@ static void xen_alloc_ptpage(struct mm_struct *mm, unsigned long pfn, unsigned l | |||
| 863 | if (PagePinned(virt_to_page(mm->pgd))) { | 863 | if (PagePinned(virt_to_page(mm->pgd))) { |
| 864 | SetPagePinned(page); | 864 | SetPagePinned(page); |
| 865 | 865 | ||
| 866 | vm_unmap_aliases(); | ||
| 866 | if (!PageHighMem(page)) { | 867 | if (!PageHighMem(page)) { |
| 867 | make_lowmem_page_readonly(__va(PFN_PHYS((unsigned long)pfn))); | 868 | make_lowmem_page_readonly(__va(PFN_PHYS((unsigned long)pfn))); |
| 868 | if (level == PT_PTE && USE_SPLIT_PTLOCKS) | 869 | if (level == PT_PTE && USE_SPLIT_PTLOCKS) |
| 869 | pin_pagetable_pfn(MMUEXT_PIN_L1_TABLE, pfn); | 870 | pin_pagetable_pfn(MMUEXT_PIN_L1_TABLE, pfn); |
| 870 | } else | 871 | } else { |
| 871 | /* make sure there are no stray mappings of | 872 | /* make sure there are no stray mappings of |
| 872 | this page */ | 873 | this page */ |
| 873 | kmap_flush_unused(); | 874 | kmap_flush_unused(); |
| 874 | vm_unmap_aliases(); | 875 | } |
| 875 | } | 876 | } |
| 876 | } | 877 | } |
| 877 | 878 | ||
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index aba77b2b7d18..688936044dc9 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
| @@ -850,13 +850,16 @@ static int xen_pin_page(struct mm_struct *mm, struct page *page, | |||
| 850 | read-only, and can be pinned. */ | 850 | read-only, and can be pinned. */ |
| 851 | static void __xen_pgd_pin(struct mm_struct *mm, pgd_t *pgd) | 851 | static void __xen_pgd_pin(struct mm_struct *mm, pgd_t *pgd) |
| 852 | { | 852 | { |
| 853 | vm_unmap_aliases(); | ||
| 854 | |||
| 853 | xen_mc_batch(); | 855 | xen_mc_batch(); |
| 854 | 856 | ||
| 855 | if (xen_pgd_walk(mm, xen_pin_page, USER_LIMIT)) { | 857 | if (xen_pgd_walk(mm, xen_pin_page, USER_LIMIT)) { |
| 856 | /* re-enable interrupts for kmap_flush_unused */ | 858 | /* re-enable interrupts for flushing */ |
| 857 | xen_mc_issue(0); | 859 | xen_mc_issue(0); |
| 860 | |||
| 858 | kmap_flush_unused(); | 861 | kmap_flush_unused(); |
| 859 | vm_unmap_aliases(); | 862 | |
| 860 | xen_mc_batch(); | 863 | xen_mc_batch(); |
| 861 | } | 864 | } |
| 862 | 865 | ||
| @@ -874,7 +877,7 @@ static void __xen_pgd_pin(struct mm_struct *mm, pgd_t *pgd) | |||
| 874 | #else /* CONFIG_X86_32 */ | 877 | #else /* CONFIG_X86_32 */ |
| 875 | #ifdef CONFIG_X86_PAE | 878 | #ifdef CONFIG_X86_PAE |
| 876 | /* Need to make sure unshared kernel PMD is pinnable */ | 879 | /* Need to make sure unshared kernel PMD is pinnable */ |
| 877 | xen_pin_page(mm, virt_to_page(pgd_page(pgd[pgd_index(TASK_SIZE)])), | 880 | xen_pin_page(mm, pgd_page(pgd[pgd_index(TASK_SIZE)]), |
| 878 | PT_PMD); | 881 | PT_PMD); |
| 879 | #endif | 882 | #endif |
| 880 | xen_do_pin(MMUEXT_PIN_L3_TABLE, PFN_DOWN(__pa(pgd))); | 883 | xen_do_pin(MMUEXT_PIN_L3_TABLE, PFN_DOWN(__pa(pgd))); |
| @@ -991,7 +994,7 @@ static void __xen_pgd_unpin(struct mm_struct *mm, pgd_t *pgd) | |||
| 991 | 994 | ||
| 992 | #ifdef CONFIG_X86_PAE | 995 | #ifdef CONFIG_X86_PAE |
| 993 | /* Need to make sure unshared kernel PMD is unpinned */ | 996 | /* Need to make sure unshared kernel PMD is unpinned */ |
| 994 | xen_unpin_page(mm, virt_to_page(pgd_page(pgd[pgd_index(TASK_SIZE)])), | 997 | xen_unpin_page(mm, pgd_page(pgd[pgd_index(TASK_SIZE)]), |
| 995 | PT_PMD); | 998 | PT_PMD); |
| 996 | #endif | 999 | #endif |
| 997 | 1000 | ||
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index 3e526b6d00cb..8daf4793ac32 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c | |||
| @@ -81,9 +81,9 @@ static void dmi_table(u8 *buf, int len, int num, | |||
| 81 | const struct dmi_header *dm = (const struct dmi_header *)data; | 81 | const struct dmi_header *dm = (const struct dmi_header *)data; |
| 82 | 82 | ||
| 83 | /* | 83 | /* |
| 84 | * We want to know the total length (formated area and strings) | 84 | * We want to know the total length (formatted area and |
| 85 | * before decoding to make sure we won't run off the table in | 85 | * strings) before decoding to make sure we won't run off the |
| 86 | * dmi_decode or dmi_string | 86 | * table in dmi_decode or dmi_string |
| 87 | */ | 87 | */ |
| 88 | data += dm->length; | 88 | data += dm->length; |
| 89 | while ((data - buf < len - 1) && (data[0] || data[1])) | 89 | while ((data - buf < len - 1) && (data[0] || data[1])) |
diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c index a1abf95cf751..603ffd008c73 100644 --- a/drivers/message/fusion/mptlan.c +++ b/drivers/message/fusion/mptlan.c | |||
| @@ -77,12 +77,6 @@ MODULE_VERSION(my_VERSION); | |||
| 77 | * Fusion MPT LAN private structures | 77 | * Fusion MPT LAN private structures |
| 78 | */ | 78 | */ |
| 79 | 79 | ||
| 80 | struct NAA_Hosed { | ||
| 81 | u16 NAA; | ||
| 82 | u8 ieee[FC_ALEN]; | ||
| 83 | struct NAA_Hosed *next; | ||
| 84 | }; | ||
| 85 | |||
| 86 | struct BufferControl { | 80 | struct BufferControl { |
| 87 | struct sk_buff *skb; | 81 | struct sk_buff *skb; |
| 88 | dma_addr_t dma; | 82 | dma_addr_t dma; |
| @@ -159,11 +153,6 @@ static u8 LanCtx = MPT_MAX_PROTOCOL_DRIVERS; | |||
| 159 | static u32 max_buckets_out = 127; | 153 | static u32 max_buckets_out = 127; |
| 160 | static u32 tx_max_out_p = 127 - 16; | 154 | static u32 tx_max_out_p = 127 - 16; |
| 161 | 155 | ||
| 162 | #ifdef QLOGIC_NAA_WORKAROUND | ||
| 163 | static struct NAA_Hosed *mpt_bad_naa = NULL; | ||
| 164 | DEFINE_RWLOCK(bad_naa_lock); | ||
| 165 | #endif | ||
| 166 | |||
| 167 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 156 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
| 168 | /** | 157 | /** |
| 169 | * lan_reply - Handle all data sent from the hardware. | 158 | * lan_reply - Handle all data sent from the hardware. |
| @@ -780,30 +769,6 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev) | |||
| 780 | // ctx, skb, skb->data)); | 769 | // ctx, skb, skb->data)); |
| 781 | 770 | ||
| 782 | mac = skb_mac_header(skb); | 771 | mac = skb_mac_header(skb); |
| 783 | #ifdef QLOGIC_NAA_WORKAROUND | ||
| 784 | { | ||
| 785 | struct NAA_Hosed *nh; | ||
| 786 | |||
| 787 | /* Munge the NAA for Tx packets to QLogic boards, which don't follow | ||
| 788 | RFC 2625. The longer I look at this, the more my opinion of Qlogic | ||
| 789 | drops. */ | ||
| 790 | read_lock_irq(&bad_naa_lock); | ||
| 791 | for (nh = mpt_bad_naa; nh != NULL; nh=nh->next) { | ||
| 792 | if ((nh->ieee[0] == mac[0]) && | ||
| 793 | (nh->ieee[1] == mac[1]) && | ||
| 794 | (nh->ieee[2] == mac[2]) && | ||
| 795 | (nh->ieee[3] == mac[3]) && | ||
| 796 | (nh->ieee[4] == mac[4]) && | ||
| 797 | (nh->ieee[5] == mac[5])) { | ||
| 798 | cur_naa = nh->NAA; | ||
| 799 | dlprintk ((KERN_INFO "mptlan/sdu_send: using NAA value " | ||
| 800 | "= %04x.\n", cur_naa)); | ||
| 801 | break; | ||
| 802 | } | ||
| 803 | } | ||
| 804 | read_unlock_irq(&bad_naa_lock); | ||
| 805 | } | ||
| 806 | #endif | ||
| 807 | 772 | ||
| 808 | pTrans->TransactionDetails[0] = cpu_to_le32((cur_naa << 16) | | 773 | pTrans->TransactionDetails[0] = cpu_to_le32((cur_naa << 16) | |
| 809 | (mac[0] << 8) | | 774 | (mac[0] << 8) | |
| @@ -1572,79 +1537,6 @@ mpt_lan_type_trans(struct sk_buff *skb, struct net_device *dev) | |||
| 1572 | 1537 | ||
| 1573 | fcllc = (struct fcllc *)skb->data; | 1538 | fcllc = (struct fcllc *)skb->data; |
| 1574 | 1539 | ||
| 1575 | #ifdef QLOGIC_NAA_WORKAROUND | ||
| 1576 | { | ||
| 1577 | u16 source_naa = fch->stype, found = 0; | ||
| 1578 | |||
| 1579 | /* Workaround for QLogic not following RFC 2625 in regards to the NAA | ||
| 1580 | value. */ | ||
| 1581 | |||
| 1582 | if ((source_naa & 0xF000) == 0) | ||
| 1583 | source_naa = swab16(source_naa); | ||
| 1584 | |||
| 1585 | if (fcllc->ethertype == htons(ETH_P_ARP)) | ||
| 1586 | dlprintk ((KERN_INFO "mptlan/type_trans: got arp req/rep w/ naa of " | ||
| 1587 | "%04x.\n", source_naa)); | ||
| 1588 | |||
| 1589 | if ((fcllc->ethertype == htons(ETH_P_ARP)) && | ||
| 1590 | ((source_naa >> 12) != MPT_LAN_NAA_RFC2625)){ | ||
| 1591 | struct NAA_Hosed *nh, *prevnh; | ||
| 1592 | int i; | ||
| 1593 | |||
| 1594 | dlprintk ((KERN_INFO "mptlan/type_trans: ARP Req/Rep from " | ||
| 1595 | "system with non-RFC 2625 NAA value (%04x).\n", | ||
| 1596 | source_naa)); | ||
| 1597 | |||
| 1598 | write_lock_irq(&bad_naa_lock); | ||
| 1599 | for (prevnh = nh = mpt_bad_naa; nh != NULL; | ||
| 1600 | prevnh=nh, nh=nh->next) { | ||
| 1601 | if ((nh->ieee[0] == fch->saddr[0]) && | ||
| 1602 | (nh->ieee[1] == fch->saddr[1]) && | ||
| 1603 | (nh->ieee[2] == fch->saddr[2]) && | ||
| 1604 | (nh->ieee[3] == fch->saddr[3]) && | ||
| 1605 | (nh->ieee[4] == fch->saddr[4]) && | ||
| 1606 | (nh->ieee[5] == fch->saddr[5])) { | ||
| 1607 | found = 1; | ||
| 1608 | dlprintk ((KERN_INFO "mptlan/type_trans: ARP Re" | ||
| 1609 | "q/Rep w/ bad NAA from system already" | ||
| 1610 | " in DB.\n")); | ||
| 1611 | break; | ||
| 1612 | } | ||
| 1613 | } | ||
| 1614 | |||
| 1615 | if ((!found) && (nh == NULL)) { | ||
| 1616 | |||
| 1617 | nh = kmalloc(sizeof(struct NAA_Hosed), GFP_KERNEL); | ||
| 1618 | dlprintk ((KERN_INFO "mptlan/type_trans: ARP Req/Rep w/" | ||
| 1619 | " bad NAA from system not yet in DB.\n")); | ||
| 1620 | |||
| 1621 | if (nh != NULL) { | ||
| 1622 | nh->next = NULL; | ||
| 1623 | if (!mpt_bad_naa) | ||
| 1624 | mpt_bad_naa = nh; | ||
| 1625 | if (prevnh) | ||
| 1626 | prevnh->next = nh; | ||
| 1627 | |||
| 1628 | nh->NAA = source_naa; /* Set the S_NAA value. */ | ||
| 1629 | for (i = 0; i < FC_ALEN; i++) | ||
| 1630 | nh->ieee[i] = fch->saddr[i]; | ||
| 1631 | dlprintk ((KERN_INFO "Got ARP from %02x:%02x:%02x:%02x:" | ||
| 1632 | "%02x:%02x with non-compliant S_NAA value.\n", | ||
| 1633 | fch->saddr[0], fch->saddr[1], fch->saddr[2], | ||
| 1634 | fch->saddr[3], fch->saddr[4],fch->saddr[5])); | ||
| 1635 | } else { | ||
| 1636 | printk (KERN_ERR "mptlan/type_trans: Unable to" | ||
| 1637 | " kmalloc a NAA_Hosed struct.\n"); | ||
| 1638 | } | ||
| 1639 | } else if (!found) { | ||
| 1640 | printk (KERN_ERR "mptlan/type_trans: found not" | ||
| 1641 | " set, but nh isn't null. Evil " | ||
| 1642 | "funkiness abounds.\n"); | ||
| 1643 | } | ||
| 1644 | write_unlock_irq(&bad_naa_lock); | ||
| 1645 | } | ||
| 1646 | } | ||
| 1647 | #endif | ||
| 1648 | 1540 | ||
| 1649 | /* Strip the SNAP header from ARP packets since we don't | 1541 | /* Strip the SNAP header from ARP packets since we don't |
| 1650 | * pass them through to the 802.2/SNAP layers. | 1542 | * pass them through to the 802.2/SNAP layers. |
diff --git a/drivers/oprofile/event_buffer.c b/drivers/oprofile/event_buffer.c index d962ba0dd87a..191a3202cecc 100644 --- a/drivers/oprofile/event_buffer.c +++ b/drivers/oprofile/event_buffer.c | |||
| @@ -105,7 +105,7 @@ static int event_buffer_open(struct inode *inode, struct file *file) | |||
| 105 | if (!capable(CAP_SYS_ADMIN)) | 105 | if (!capable(CAP_SYS_ADMIN)) |
| 106 | return -EPERM; | 106 | return -EPERM; |
| 107 | 107 | ||
| 108 | if (test_and_set_bit(0, &buffer_opened)) | 108 | if (test_and_set_bit_lock(0, &buffer_opened)) |
| 109 | return -EBUSY; | 109 | return -EBUSY; |
| 110 | 110 | ||
| 111 | /* Register as a user of dcookies | 111 | /* Register as a user of dcookies |
| @@ -129,7 +129,7 @@ static int event_buffer_open(struct inode *inode, struct file *file) | |||
| 129 | fail: | 129 | fail: |
| 130 | dcookie_unregister(file->private_data); | 130 | dcookie_unregister(file->private_data); |
| 131 | out: | 131 | out: |
| 132 | clear_bit(0, &buffer_opened); | 132 | __clear_bit_unlock(0, &buffer_opened); |
| 133 | return err; | 133 | return err; |
| 134 | } | 134 | } |
| 135 | 135 | ||
| @@ -141,7 +141,7 @@ static int event_buffer_release(struct inode *inode, struct file *file) | |||
| 141 | dcookie_unregister(file->private_data); | 141 | dcookie_unregister(file->private_data); |
| 142 | buffer_pos = 0; | 142 | buffer_pos = 0; |
| 143 | atomic_set(&buffer_ready, 0); | 143 | atomic_set(&buffer_ready, 0); |
| 144 | clear_bit(0, &buffer_opened); | 144 | __clear_bit_unlock(0, &buffer_opened); |
| 145 | return 0; | 145 | return 0; |
| 146 | } | 146 | } |
| 147 | 147 | ||
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 110022d78689..5d72866897a8 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
| @@ -575,7 +575,7 @@ static int pci_mmap_fits(struct pci_dev *pdev, int resno, struct vm_area_struct | |||
| 575 | 575 | ||
| 576 | nr = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; | 576 | nr = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; |
| 577 | start = vma->vm_pgoff; | 577 | start = vma->vm_pgoff; |
| 578 | size = pci_resource_len(pdev, resno) >> PAGE_SHIFT; | 578 | size = ((pci_resource_len(pdev, resno) - 1) >> PAGE_SHIFT) + 1; |
| 579 | if (start < size && size - start >= nr) | 579 | if (start < size && size - start >= nr) |
| 580 | return 1; | 580 | return 1; |
| 581 | WARN(1, "process \"%s\" tried to map 0x%08lx-0x%08lx on %s BAR %d (size 0x%08lx)\n", | 581 | WARN(1, "process \"%s\" tried to map 0x%08lx-0x%08lx on %s BAR %d (size 0x%08lx)\n", |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index bbf66ea8fd87..5049a47030ac 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
| @@ -1692,24 +1692,24 @@ static void __devinit quirk_brcm_570x_limit_vpd(struct pci_dev *dev) | |||
| 1692 | } | 1692 | } |
| 1693 | } | 1693 | } |
| 1694 | 1694 | ||
| 1695 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, | 1695 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, |
| 1696 | PCI_DEVICE_ID_NX2_5706, | 1696 | PCI_DEVICE_ID_NX2_5706, |
| 1697 | quirk_brcm_570x_limit_vpd); | 1697 | quirk_brcm_570x_limit_vpd); |
| 1698 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, | 1698 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, |
| 1699 | PCI_DEVICE_ID_NX2_5706S, | 1699 | PCI_DEVICE_ID_NX2_5706S, |
| 1700 | quirk_brcm_570x_limit_vpd); | 1700 | quirk_brcm_570x_limit_vpd); |
| 1701 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, | 1701 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, |
| 1702 | PCI_DEVICE_ID_NX2_5708, | 1702 | PCI_DEVICE_ID_NX2_5708, |
| 1703 | quirk_brcm_570x_limit_vpd); | 1703 | quirk_brcm_570x_limit_vpd); |
| 1704 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, | 1704 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, |
| 1705 | PCI_DEVICE_ID_NX2_5708S, | 1705 | PCI_DEVICE_ID_NX2_5708S, |
| 1706 | quirk_brcm_570x_limit_vpd); | 1706 | quirk_brcm_570x_limit_vpd); |
| 1707 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, | 1707 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, |
| 1708 | PCI_DEVICE_ID_NX2_5709, | 1708 | PCI_DEVICE_ID_NX2_5709, |
| 1709 | quirk_brcm_570x_limit_vpd); | 1709 | quirk_brcm_570x_limit_vpd); |
| 1710 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, | 1710 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, |
| 1711 | PCI_DEVICE_ID_NX2_5709S, | 1711 | PCI_DEVICE_ID_NX2_5709S, |
| 1712 | quirk_brcm_570x_limit_vpd); | 1712 | quirk_brcm_570x_limit_vpd); |
| 1713 | 1713 | ||
| 1714 | #ifdef CONFIG_PCI_MSI | 1714 | #ifdef CONFIG_PCI_MSI |
| 1715 | /* Some chipsets do not support MSI. We cannot easily rely on setting | 1715 | /* Some chipsets do not support MSI. We cannot easily rely on setting |
diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c index 1f5f6143f35c..132a78159b60 100644 --- a/drivers/pci/rom.c +++ b/drivers/pci/rom.c | |||
| @@ -100,7 +100,8 @@ size_t pci_get_rom_size(void __iomem *rom, size_t size) | |||
| 100 | * pci_map_rom - map a PCI ROM to kernel space | 100 | * pci_map_rom - map a PCI ROM to kernel space |
| 101 | * @pdev: pointer to pci device struct | 101 | * @pdev: pointer to pci device struct |
| 102 | * @size: pointer to receive size of pci window over ROM | 102 | * @size: pointer to receive size of pci window over ROM |
| 103 | * @return: kernel virtual pointer to image of ROM | 103 | * |
| 104 | * Return: kernel virtual pointer to image of ROM | ||
| 104 | * | 105 | * |
| 105 | * Map a PCI ROM into kernel space. If ROM is boot video ROM, | 106 | * Map a PCI ROM into kernel space. If ROM is boot video ROM, |
| 106 | * the shadow BIOS copy will be returned instead of the | 107 | * the shadow BIOS copy will be returned instead of the |
| @@ -167,7 +168,8 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size) | |||
| 167 | * pci_map_rom_copy - map a PCI ROM to kernel space, create a copy | 168 | * pci_map_rom_copy - map a PCI ROM to kernel space, create a copy |
| 168 | * @pdev: pointer to pci device struct | 169 | * @pdev: pointer to pci device struct |
| 169 | * @size: pointer to receive size of pci window over ROM | 170 | * @size: pointer to receive size of pci window over ROM |
| 170 | * @return: kernel virtual pointer to image of ROM | 171 | * |
| 172 | * Return: kernel virtual pointer to image of ROM | ||
| 171 | * | 173 | * |
| 172 | * Map a PCI ROM into kernel space. If ROM is boot video ROM, | 174 | * Map a PCI ROM into kernel space. If ROM is boot video ROM, |
| 173 | * the shadow BIOS copy will be returned instead of the | 175 | * the shadow BIOS copy will be returned instead of the |
diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig index e1654f59eb70..0a49cd788a75 100644 --- a/drivers/staging/Kconfig +++ b/drivers/staging/Kconfig | |||
| @@ -21,7 +21,23 @@ menuconfig STAGING | |||
| 21 | 21 | ||
| 22 | If in doubt, say N here. | 22 | If in doubt, say N here. |
| 23 | 23 | ||
| 24 | if STAGING | 24 | |
| 25 | config STAGING_EXCLUDE_BUILD | ||
| 26 | bool "Exclude Staging drivers from being built" | ||
| 27 | default y | ||
| 28 | ---help--- | ||
| 29 | Are you sure you really want to build the staging drivers? | ||
| 30 | They taint your kernel, don't live up to the normal Linux | ||
| 31 | kernel quality standards, are a bit crufty around the edges, | ||
| 32 | and might go off and kick your dog when you aren't paying | ||
| 33 | attention. | ||
| 34 | |||
| 35 | Say N here to be able to select and build the Staging drivers. | ||
| 36 | This option is primarily here to prevent them from being built | ||
| 37 | when selecting 'make allyesconfg' and 'make allmodconfig' so | ||
| 38 | don't be all that put off, your dog will be just fine. | ||
| 39 | |||
| 40 | if !STAGING_EXCLUDE_BUILD | ||
| 25 | 41 | ||
| 26 | source "drivers/staging/et131x/Kconfig" | 42 | source "drivers/staging/et131x/Kconfig" |
| 27 | 43 | ||
| @@ -45,4 +61,4 @@ source "drivers/staging/at76_usb/Kconfig" | |||
| 45 | 61 | ||
| 46 | source "drivers/staging/poch/Kconfig" | 62 | source "drivers/staging/poch/Kconfig" |
| 47 | 63 | ||
| 48 | endif # STAGING | 64 | endif # !STAGING_EXCLUDE_BUILD |
diff --git a/drivers/staging/usbip/Kconfig b/drivers/staging/usbip/Kconfig index 7426235ccc44..217fb7e62c2f 100644 --- a/drivers/staging/usbip/Kconfig +++ b/drivers/staging/usbip/Kconfig | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | config USB_IP_COMMON | 1 | config USB_IP_COMMON |
| 2 | tristate "USB IP support (EXPERIMENTAL)" | 2 | tristate "USB IP support (EXPERIMENTAL)" |
| 3 | depends on USB && EXPERIMENTAL | 3 | depends on USB && NET && EXPERIMENTAL |
| 4 | default N | 4 | default N |
| 5 | ---help--- | 5 | ---help--- |
| 6 | This enables pushing USB packets over IP to allow remote | 6 | This enables pushing USB packets over IP to allow remote |
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index fe34d74cfb19..2a117e286e54 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
| @@ -718,6 +718,8 @@ got: | |||
| 718 | gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT); | 718 | gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT); |
| 719 | free = ext4_free_blocks_after_init(sb, group, gdp); | 719 | free = ext4_free_blocks_after_init(sb, group, gdp); |
| 720 | gdp->bg_free_blocks_count = cpu_to_le16(free); | 720 | gdp->bg_free_blocks_count = cpu_to_le16(free); |
| 721 | gdp->bg_checksum = ext4_group_desc_csum(sbi, group, | ||
| 722 | gdp); | ||
| 721 | } | 723 | } |
| 722 | spin_unlock(sb_bgl_lock(sbi, group)); | 724 | spin_unlock(sb_bgl_lock(sbi, group)); |
| 723 | 725 | ||
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 8dbf6953845b..be21a5ae33cb 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
| @@ -2329,6 +2329,8 @@ static int ext4_da_writepage(struct page *page, | |||
| 2329 | unlock_page(page); | 2329 | unlock_page(page); |
| 2330 | return 0; | 2330 | return 0; |
| 2331 | } | 2331 | } |
| 2332 | /* now mark the buffer_heads as dirty and uptodate */ | ||
| 2333 | block_commit_write(page, 0, PAGE_CACHE_SIZE); | ||
| 2332 | } | 2334 | } |
| 2333 | 2335 | ||
| 2334 | if (test_opt(inode->i_sb, NOBH) && ext4_should_writeback_data(inode)) | 2336 | if (test_opt(inode->i_sb, NOBH) && ext4_should_writeback_data(inode)) |
| @@ -4580,9 +4582,10 @@ static int ext4_indirect_trans_blocks(struct inode *inode, int nrblocks, | |||
| 4580 | static int ext4_index_trans_blocks(struct inode *inode, int nrblocks, int chunk) | 4582 | static int ext4_index_trans_blocks(struct inode *inode, int nrblocks, int chunk) |
| 4581 | { | 4583 | { |
| 4582 | if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL)) | 4584 | if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL)) |
| 4583 | return ext4_indirect_trans_blocks(inode, nrblocks, 0); | 4585 | return ext4_indirect_trans_blocks(inode, nrblocks, chunk); |
| 4584 | return ext4_ext_index_trans_blocks(inode, nrblocks, 0); | 4586 | return ext4_ext_index_trans_blocks(inode, nrblocks, chunk); |
| 4585 | } | 4587 | } |
| 4588 | |||
| 4586 | /* | 4589 | /* |
| 4587 | * Account for index blocks, block groups bitmaps and block group | 4590 | * Account for index blocks, block groups bitmaps and block group |
| 4588 | * descriptor blocks if modify datablocks and index blocks | 4591 | * descriptor blocks if modify datablocks and index blocks |
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index dfe17a134052..444ad998f72e 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
| @@ -4441,6 +4441,7 @@ ext4_mb_free_metadata(handle_t *handle, struct ext4_buddy *e4b, | |||
| 4441 | else if (block >= (entry->start_blk + entry->count)) | 4441 | else if (block >= (entry->start_blk + entry->count)) |
| 4442 | n = &(*n)->rb_right; | 4442 | n = &(*n)->rb_right; |
| 4443 | else { | 4443 | else { |
| 4444 | ext4_unlock_group(sb, group); | ||
| 4444 | ext4_error(sb, __func__, | 4445 | ext4_error(sb, __func__, |
| 4445 | "Double free of blocks %d (%d %d)\n", | 4446 | "Double free of blocks %d (%d %d)\n", |
| 4446 | block, entry->start_blk, entry->count); | 4447 | block, entry->start_blk, entry->count); |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 994859df010e..e4a241c65dbe 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
| @@ -1458,9 +1458,8 @@ static int ext4_fill_flex_info(struct super_block *sb) | |||
| 1458 | 1458 | ||
| 1459 | /* We allocate both existing and potentially added groups */ | 1459 | /* We allocate both existing and potentially added groups */ |
| 1460 | flex_group_count = ((sbi->s_groups_count + groups_per_flex - 1) + | 1460 | flex_group_count = ((sbi->s_groups_count + groups_per_flex - 1) + |
| 1461 | ((sbi->s_es->s_reserved_gdt_blocks +1 ) << | 1461 | ((le16_to_cpu(sbi->s_es->s_reserved_gdt_blocks) + 1) << |
| 1462 | EXT4_DESC_PER_BLOCK_BITS(sb))) / | 1462 | EXT4_DESC_PER_BLOCK_BITS(sb))) / groups_per_flex; |
| 1463 | groups_per_flex; | ||
| 1464 | sbi->s_flex_groups = kzalloc(flex_group_count * | 1463 | sbi->s_flex_groups = kzalloc(flex_group_count * |
| 1465 | sizeof(struct flex_groups), GFP_KERNEL); | 1464 | sizeof(struct flex_groups), GFP_KERNEL); |
| 1466 | if (sbi->s_flex_groups == NULL) { | 1465 | if (sbi->s_flex_groups == NULL) { |
| @@ -2885,12 +2884,9 @@ int ext4_force_commit(struct super_block *sb) | |||
| 2885 | /* | 2884 | /* |
| 2886 | * Ext4 always journals updates to the superblock itself, so we don't | 2885 | * Ext4 always journals updates to the superblock itself, so we don't |
| 2887 | * have to propagate any other updates to the superblock on disk at this | 2886 | * have to propagate any other updates to the superblock on disk at this |
| 2888 | * point. Just start an async writeback to get the buffers on their way | 2887 | * point. (We can probably nuke this function altogether, and remove |
| 2889 | * to the disk. | 2888 | * any mention to sb->s_dirt in all of fs/ext4; eventual cleanup...) |
| 2890 | * | ||
| 2891 | * This implicitly triggers the writebehind on sync(). | ||
| 2892 | */ | 2889 | */ |
| 2893 | |||
| 2894 | static void ext4_write_super(struct super_block *sb) | 2890 | static void ext4_write_super(struct super_block *sb) |
| 2895 | { | 2891 | { |
| 2896 | if (mutex_trylock(&sb->s_lock) != 0) | 2892 | if (mutex_trylock(&sb->s_lock) != 0) |
| @@ -2900,15 +2896,15 @@ static void ext4_write_super(struct super_block *sb) | |||
| 2900 | 2896 | ||
| 2901 | static int ext4_sync_fs(struct super_block *sb, int wait) | 2897 | static int ext4_sync_fs(struct super_block *sb, int wait) |
| 2902 | { | 2898 | { |
| 2903 | tid_t target; | 2899 | int ret = 0; |
| 2904 | 2900 | ||
| 2905 | trace_mark(ext4_sync_fs, "dev %s wait %d", sb->s_id, wait); | 2901 | trace_mark(ext4_sync_fs, "dev %s wait %d", sb->s_id, wait); |
| 2906 | sb->s_dirt = 0; | 2902 | sb->s_dirt = 0; |
| 2907 | if (jbd2_journal_start_commit(EXT4_SB(sb)->s_journal, &target)) { | 2903 | if (wait) |
| 2908 | if (wait) | 2904 | ret = ext4_force_commit(sb); |
| 2909 | jbd2_log_wait_commit(EXT4_SB(sb)->s_journal, target); | 2905 | else |
| 2910 | } | 2906 | jbd2_journal_start_commit(EXT4_SB(sb)->s_journal, NULL); |
| 2911 | return 0; | 2907 | return ret; |
| 2912 | } | 2908 | } |
| 2913 | 2909 | ||
| 2914 | /* | 2910 | /* |
diff --git a/fs/jbd/checkpoint.c b/fs/jbd/checkpoint.c index 1bd8d4acc6f2..61f32f3868cd 100644 --- a/fs/jbd/checkpoint.c +++ b/fs/jbd/checkpoint.c | |||
| @@ -115,7 +115,7 @@ static int __try_to_free_cp_buf(struct journal_head *jh) | |||
| 115 | */ | 115 | */ |
| 116 | void __log_wait_for_space(journal_t *journal) | 116 | void __log_wait_for_space(journal_t *journal) |
| 117 | { | 117 | { |
| 118 | int nblocks; | 118 | int nblocks, space_left; |
| 119 | assert_spin_locked(&journal->j_state_lock); | 119 | assert_spin_locked(&journal->j_state_lock); |
| 120 | 120 | ||
| 121 | nblocks = jbd_space_needed(journal); | 121 | nblocks = jbd_space_needed(journal); |
| @@ -128,25 +128,42 @@ void __log_wait_for_space(journal_t *journal) | |||
| 128 | /* | 128 | /* |
| 129 | * Test again, another process may have checkpointed while we | 129 | * Test again, another process may have checkpointed while we |
| 130 | * were waiting for the checkpoint lock. If there are no | 130 | * were waiting for the checkpoint lock. If there are no |
| 131 | * outstanding transactions there is nothing to checkpoint and | 131 | * transactions ready to be checkpointed, try to recover |
| 132 | * we can't make progress. Abort the journal in this case. | 132 | * journal space by calling cleanup_journal_tail(), and if |
| 133 | * that doesn't work, by waiting for the currently committing | ||
| 134 | * transaction to complete. If there is absolutely no way | ||
| 135 | * to make progress, this is either a BUG or corrupted | ||
| 136 | * filesystem, so abort the journal and leave a stack | ||
| 137 | * trace for forensic evidence. | ||
| 133 | */ | 138 | */ |
| 134 | spin_lock(&journal->j_state_lock); | 139 | spin_lock(&journal->j_state_lock); |
| 135 | spin_lock(&journal->j_list_lock); | 140 | spin_lock(&journal->j_list_lock); |
| 136 | nblocks = jbd_space_needed(journal); | 141 | nblocks = jbd_space_needed(journal); |
| 137 | if (__log_space_left(journal) < nblocks) { | 142 | space_left = __log_space_left(journal); |
| 143 | if (space_left < nblocks) { | ||
| 138 | int chkpt = journal->j_checkpoint_transactions != NULL; | 144 | int chkpt = journal->j_checkpoint_transactions != NULL; |
| 145 | tid_t tid = 0; | ||
| 139 | 146 | ||
| 147 | if (journal->j_committing_transaction) | ||
| 148 | tid = journal->j_committing_transaction->t_tid; | ||
| 140 | spin_unlock(&journal->j_list_lock); | 149 | spin_unlock(&journal->j_list_lock); |
| 141 | spin_unlock(&journal->j_state_lock); | 150 | spin_unlock(&journal->j_state_lock); |
| 142 | if (chkpt) { | 151 | if (chkpt) { |
| 143 | log_do_checkpoint(journal); | 152 | log_do_checkpoint(journal); |
| 153 | } else if (cleanup_journal_tail(journal) == 0) { | ||
| 154 | /* We were able to recover space; yay! */ | ||
| 155 | ; | ||
| 156 | } else if (tid) { | ||
| 157 | log_wait_commit(journal, tid); | ||
| 144 | } else { | 158 | } else { |
| 145 | printk(KERN_ERR "%s: no transactions\n", | 159 | printk(KERN_ERR "%s: needed %d blocks and " |
| 146 | __func__); | 160 | "only had %d space available\n", |
| 161 | __func__, nblocks, space_left); | ||
| 162 | printk(KERN_ERR "%s: no way to get more " | ||
| 163 | "journal space\n", __func__); | ||
| 164 | WARN_ON(1); | ||
| 147 | journal_abort(journal, 0); | 165 | journal_abort(journal, 0); |
| 148 | } | 166 | } |
| 149 | |||
| 150 | spin_lock(&journal->j_state_lock); | 167 | spin_lock(&journal->j_state_lock); |
| 151 | } else { | 168 | } else { |
| 152 | spin_unlock(&journal->j_list_lock); | 169 | spin_unlock(&journal->j_list_lock); |
diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c index 9203c3332f17..9497718fe920 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c | |||
| @@ -116,7 +116,7 @@ static int __try_to_free_cp_buf(struct journal_head *jh) | |||
| 116 | */ | 116 | */ |
| 117 | void __jbd2_log_wait_for_space(journal_t *journal) | 117 | void __jbd2_log_wait_for_space(journal_t *journal) |
| 118 | { | 118 | { |
| 119 | int nblocks; | 119 | int nblocks, space_left; |
| 120 | assert_spin_locked(&journal->j_state_lock); | 120 | assert_spin_locked(&journal->j_state_lock); |
| 121 | 121 | ||
| 122 | nblocks = jbd_space_needed(journal); | 122 | nblocks = jbd_space_needed(journal); |
| @@ -129,25 +129,43 @@ void __jbd2_log_wait_for_space(journal_t *journal) | |||
| 129 | /* | 129 | /* |
| 130 | * Test again, another process may have checkpointed while we | 130 | * Test again, another process may have checkpointed while we |
| 131 | * were waiting for the checkpoint lock. If there are no | 131 | * were waiting for the checkpoint lock. If there are no |
| 132 | * outstanding transactions there is nothing to checkpoint and | 132 | * transactions ready to be checkpointed, try to recover |
| 133 | * we can't make progress. Abort the journal in this case. | 133 | * journal space by calling cleanup_journal_tail(), and if |
| 134 | * that doesn't work, by waiting for the currently committing | ||
| 135 | * transaction to complete. If there is absolutely no way | ||
| 136 | * to make progress, this is either a BUG or corrupted | ||
| 137 | * filesystem, so abort the journal and leave a stack | ||
| 138 | * trace for forensic evidence. | ||
| 134 | */ | 139 | */ |
| 135 | spin_lock(&journal->j_state_lock); | 140 | spin_lock(&journal->j_state_lock); |
| 136 | spin_lock(&journal->j_list_lock); | 141 | spin_lock(&journal->j_list_lock); |
| 137 | nblocks = jbd_space_needed(journal); | 142 | nblocks = jbd_space_needed(journal); |
| 138 | if (__jbd2_log_space_left(journal) < nblocks) { | 143 | space_left = __jbd2_log_space_left(journal); |
| 144 | if (space_left < nblocks) { | ||
| 139 | int chkpt = journal->j_checkpoint_transactions != NULL; | 145 | int chkpt = journal->j_checkpoint_transactions != NULL; |
| 146 | tid_t tid = 0; | ||
| 140 | 147 | ||
| 148 | if (journal->j_committing_transaction) | ||
| 149 | tid = journal->j_committing_transaction->t_tid; | ||
| 141 | spin_unlock(&journal->j_list_lock); | 150 | spin_unlock(&journal->j_list_lock); |
| 142 | spin_unlock(&journal->j_state_lock); | 151 | spin_unlock(&journal->j_state_lock); |
| 143 | if (chkpt) { | 152 | if (chkpt) { |
| 144 | jbd2_log_do_checkpoint(journal); | 153 | jbd2_log_do_checkpoint(journal); |
| 154 | } else if (jbd2_cleanup_journal_tail(journal) == 0) { | ||
| 155 | /* We were able to recover space; yay! */ | ||
| 156 | ; | ||
| 157 | } else if (tid) { | ||
| 158 | jbd2_log_wait_commit(journal, tid); | ||
| 145 | } else { | 159 | } else { |
| 146 | printk(KERN_ERR "%s: no transactions\n", | 160 | printk(KERN_ERR "%s: needed %d blocks and " |
| 147 | __func__); | 161 | "only had %d space available\n", |
| 162 | __func__, nblocks, space_left); | ||
| 163 | printk(KERN_ERR "%s: no way to get more " | ||
| 164 | "journal space in %s\n", __func__, | ||
| 165 | journal->j_devname); | ||
| 166 | WARN_ON(1); | ||
| 148 | jbd2_journal_abort(journal, 0); | 167 | jbd2_journal_abort(journal, 0); |
| 149 | } | 168 | } |
| 150 | |||
| 151 | spin_lock(&journal->j_state_lock); | 169 | spin_lock(&journal->j_state_lock); |
| 152 | } else { | 170 | } else { |
| 153 | spin_unlock(&journal->j_list_lock); | 171 | spin_unlock(&journal->j_list_lock); |
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 783de118de92..e70d657a19f8 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c | |||
| @@ -1089,6 +1089,7 @@ journal_t * jbd2_journal_init_inode (struct inode *inode) | |||
| 1089 | if (!journal->j_wbuf) { | 1089 | if (!journal->j_wbuf) { |
| 1090 | printk(KERN_ERR "%s: Cant allocate bhs for commit thread\n", | 1090 | printk(KERN_ERR "%s: Cant allocate bhs for commit thread\n", |
| 1091 | __func__); | 1091 | __func__); |
| 1092 | jbd2_stats_proc_exit(journal); | ||
| 1092 | kfree(journal); | 1093 | kfree(journal); |
| 1093 | return NULL; | 1094 | return NULL; |
| 1094 | } | 1095 | } |
| @@ -1098,6 +1099,7 @@ journal_t * jbd2_journal_init_inode (struct inode *inode) | |||
| 1098 | if (err) { | 1099 | if (err) { |
| 1099 | printk(KERN_ERR "%s: Cannnot locate journal superblock\n", | 1100 | printk(KERN_ERR "%s: Cannnot locate journal superblock\n", |
| 1100 | __func__); | 1101 | __func__); |
| 1102 | jbd2_stats_proc_exit(journal); | ||
| 1101 | kfree(journal); | 1103 | kfree(journal); |
| 1102 | return NULL; | 1104 | return NULL; |
| 1103 | } | 1105 | } |
diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h index ae060c62aff1..18546d8eb78e 100644 --- a/include/asm-generic/memory_model.h +++ b/include/asm-generic/memory_model.h | |||
| @@ -34,7 +34,7 @@ | |||
| 34 | 34 | ||
| 35 | #define __pfn_to_page(pfn) \ | 35 | #define __pfn_to_page(pfn) \ |
| 36 | ({ unsigned long __pfn = (pfn); \ | 36 | ({ unsigned long __pfn = (pfn); \ |
| 37 | unsigned long __nid = arch_pfn_to_nid(pfn); \ | 37 | unsigned long __nid = arch_pfn_to_nid(__pfn); \ |
| 38 | NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\ | 38 | NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\ |
| 39 | }) | 39 | }) |
| 40 | 40 | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index c75b82bda327..feb4657bb043 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -1136,7 +1136,7 @@ static inline void pci_mmcfg_late_init(void) { } | |||
| 1136 | #endif | 1136 | #endif |
| 1137 | 1137 | ||
| 1138 | #ifdef CONFIG_HAS_IOMEM | 1138 | #ifdef CONFIG_HAS_IOMEM |
| 1139 | static inline void * pci_ioremap_bar(struct pci_dev *pdev, int bar) | 1139 | static inline void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar) |
| 1140 | { | 1140 | { |
| 1141 | /* | 1141 | /* |
| 1142 | * Make sure the BAR is actually a memory resource, not an IO resource | 1142 | * Make sure the BAR is actually a memory resource, not an IO resource |
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 66fad3fc02b1..ba6b0f5f7fac 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
| @@ -592,6 +592,8 @@ static void free_unmap_vmap_area_addr(unsigned long addr) | |||
| 592 | 592 | ||
| 593 | #define VMAP_BLOCK_SIZE (VMAP_BBMAP_BITS * PAGE_SIZE) | 593 | #define VMAP_BLOCK_SIZE (VMAP_BBMAP_BITS * PAGE_SIZE) |
| 594 | 594 | ||
| 595 | static bool vmap_initialized __read_mostly = false; | ||
| 596 | |||
| 595 | struct vmap_block_queue { | 597 | struct vmap_block_queue { |
| 596 | spinlock_t lock; | 598 | spinlock_t lock; |
| 597 | struct list_head free; | 599 | struct list_head free; |
| @@ -828,6 +830,9 @@ void vm_unmap_aliases(void) | |||
| 828 | int cpu; | 830 | int cpu; |
| 829 | int flush = 0; | 831 | int flush = 0; |
| 830 | 832 | ||
| 833 | if (unlikely(!vmap_initialized)) | ||
| 834 | return; | ||
| 835 | |||
| 831 | for_each_possible_cpu(cpu) { | 836 | for_each_possible_cpu(cpu) { |
| 832 | struct vmap_block_queue *vbq = &per_cpu(vmap_block_queue, cpu); | 837 | struct vmap_block_queue *vbq = &per_cpu(vmap_block_queue, cpu); |
| 833 | struct vmap_block *vb; | 838 | struct vmap_block *vb; |
| @@ -942,6 +947,8 @@ void __init vmalloc_init(void) | |||
| 942 | INIT_LIST_HEAD(&vbq->dirty); | 947 | INIT_LIST_HEAD(&vbq->dirty); |
| 943 | vbq->nr_dirty = 0; | 948 | vbq->nr_dirty = 0; |
| 944 | } | 949 | } |
| 950 | |||
| 951 | vmap_initialized = true; | ||
| 945 | } | 952 | } |
| 946 | 953 | ||
| 947 | void unmap_kernel_range(unsigned long addr, unsigned long size) | 954 | void unmap_kernel_range(unsigned long addr, unsigned long size) |
