diff options
Diffstat (limited to 'arch')
46 files changed, 238 insertions, 255 deletions
diff --git a/arch/arm/boot/dts/imx6dl-hummingboard.dts b/arch/arm/boot/dts/imx6dl-hummingboard.dts index fd8fc7cd53f3..5bfae54fb780 100644 --- a/arch/arm/boot/dts/imx6dl-hummingboard.dts +++ b/arch/arm/boot/dts/imx6dl-hummingboard.dts | |||
| @@ -52,12 +52,6 @@ | |||
| 52 | }; | 52 | }; |
| 53 | }; | 53 | }; |
| 54 | 54 | ||
| 55 | codec: spdif-transmitter { | ||
| 56 | compatible = "linux,spdif-dit"; | ||
| 57 | pinctrl-names = "default"; | ||
| 58 | pinctrl-0 = <&pinctrl_hummingboard_spdif>; | ||
| 59 | }; | ||
| 60 | |||
| 61 | sound-spdif { | 55 | sound-spdif { |
| 62 | compatible = "fsl,imx-audio-spdif"; | 56 | compatible = "fsl,imx-audio-spdif"; |
| 63 | model = "imx-spdif"; | 57 | model = "imx-spdif"; |
| @@ -111,7 +105,7 @@ | |||
| 111 | }; | 105 | }; |
| 112 | 106 | ||
| 113 | pinctrl_hummingboard_spdif: hummingboard-spdif { | 107 | pinctrl_hummingboard_spdif: hummingboard-spdif { |
| 114 | fsl,pins = <MX6QDL_PAD_GPIO_17__SPDIF_OUT 0x1b0b0>; | 108 | fsl,pins = <MX6QDL_PAD_GPIO_17__SPDIF_OUT 0x13091>; |
| 115 | }; | 109 | }; |
| 116 | 110 | ||
| 117 | pinctrl_hummingboard_usbh1_vbus: hummingboard-usbh1-vbus { | 111 | pinctrl_hummingboard_usbh1_vbus: hummingboard-usbh1-vbus { |
| @@ -142,6 +136,8 @@ | |||
| 142 | }; | 136 | }; |
| 143 | 137 | ||
| 144 | &spdif { | 138 | &spdif { |
| 139 | pinctrl-names = "default"; | ||
| 140 | pinctrl-0 = <&pinctrl_hummingboard_spdif>; | ||
| 145 | status = "okay"; | 141 | status = "okay"; |
| 146 | }; | 142 | }; |
| 147 | 143 | ||
diff --git a/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi b/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi index 64daa3b311f6..c2a24888a276 100644 --- a/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi +++ b/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi | |||
| @@ -46,12 +46,6 @@ | |||
| 46 | }; | 46 | }; |
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| 49 | codec: spdif-transmitter { | ||
| 50 | compatible = "linux,spdif-dit"; | ||
| 51 | pinctrl-names = "default"; | ||
| 52 | pinctrl-0 = <&pinctrl_cubox_i_spdif>; | ||
| 53 | }; | ||
| 54 | |||
| 55 | sound-spdif { | 49 | sound-spdif { |
| 56 | compatible = "fsl,imx-audio-spdif"; | 50 | compatible = "fsl,imx-audio-spdif"; |
| 57 | model = "imx-spdif"; | 51 | model = "imx-spdif"; |
| @@ -89,7 +83,7 @@ | |||
| 89 | }; | 83 | }; |
| 90 | 84 | ||
| 91 | pinctrl_cubox_i_spdif: cubox-i-spdif { | 85 | pinctrl_cubox_i_spdif: cubox-i-spdif { |
| 92 | fsl,pins = <MX6QDL_PAD_GPIO_17__SPDIF_OUT 0x1b0b0>; | 86 | fsl,pins = <MX6QDL_PAD_GPIO_17__SPDIF_OUT 0x13091>; |
| 93 | }; | 87 | }; |
| 94 | 88 | ||
| 95 | pinctrl_cubox_i_usbh1_vbus: cubox-i-usbh1-vbus { | 89 | pinctrl_cubox_i_usbh1_vbus: cubox-i-usbh1-vbus { |
| @@ -121,6 +115,8 @@ | |||
| 121 | }; | 115 | }; |
| 122 | 116 | ||
| 123 | &spdif { | 117 | &spdif { |
| 118 | pinctrl-names = "default"; | ||
| 119 | pinctrl-0 = <&pinctrl_cubox_i_spdif>; | ||
| 124 | status = "okay"; | 120 | status = "okay"; |
| 125 | }; | 121 | }; |
| 126 | 122 | ||
diff --git a/arch/arm/boot/dts/testcases/tests-interrupts.dtsi b/arch/arm/boot/dts/testcases/tests-interrupts.dtsi deleted file mode 100644 index c843720bd3e5..000000000000 --- a/arch/arm/boot/dts/testcases/tests-interrupts.dtsi +++ /dev/null | |||
| @@ -1,58 +0,0 @@ | |||
| 1 | |||
| 2 | / { | ||
| 3 | testcase-data { | ||
| 4 | interrupts { | ||
| 5 | #address-cells = <1>; | ||
| 6 | #size-cells = <1>; | ||
| 7 | test_intc0: intc0 { | ||
| 8 | interrupt-controller; | ||
| 9 | #interrupt-cells = <1>; | ||
| 10 | }; | ||
| 11 | |||
| 12 | test_intc1: intc1 { | ||
| 13 | interrupt-controller; | ||
| 14 | #interrupt-cells = <3>; | ||
| 15 | }; | ||
| 16 | |||
| 17 | test_intc2: intc2 { | ||
| 18 | interrupt-controller; | ||
| 19 | #interrupt-cells = <2>; | ||
| 20 | }; | ||
| 21 | |||
| 22 | test_intmap0: intmap0 { | ||
| 23 | #interrupt-cells = <1>; | ||
| 24 | #address-cells = <0>; | ||
| 25 | interrupt-map = <1 &test_intc0 9>, | ||
| 26 | <2 &test_intc1 10 11 12>, | ||
| 27 | <3 &test_intc2 13 14>, | ||
| 28 | <4 &test_intc2 15 16>; | ||
| 29 | }; | ||
| 30 | |||
| 31 | test_intmap1: intmap1 { | ||
| 32 | #interrupt-cells = <2>; | ||
| 33 | interrupt-map = <0x5000 1 2 &test_intc0 15>; | ||
| 34 | }; | ||
| 35 | |||
| 36 | interrupts0 { | ||
| 37 | interrupt-parent = <&test_intc0>; | ||
| 38 | interrupts = <1>, <2>, <3>, <4>; | ||
| 39 | }; | ||
| 40 | |||
| 41 | interrupts1 { | ||
| 42 | interrupt-parent = <&test_intmap0>; | ||
| 43 | interrupts = <1>, <2>, <3>, <4>; | ||
| 44 | }; | ||
| 45 | |||
| 46 | interrupts-extended0 { | ||
| 47 | reg = <0x5000 0x100>; | ||
| 48 | interrupts-extended = <&test_intc0 1>, | ||
| 49 | <&test_intc1 2 3 4>, | ||
| 50 | <&test_intc2 5 6>, | ||
| 51 | <&test_intmap0 1>, | ||
| 52 | <&test_intmap0 2>, | ||
| 53 | <&test_intmap0 3>, | ||
| 54 | <&test_intmap1 1 2>; | ||
| 55 | }; | ||
| 56 | }; | ||
| 57 | }; | ||
| 58 | }; | ||
diff --git a/arch/arm/boot/dts/testcases/tests-phandle.dtsi b/arch/arm/boot/dts/testcases/tests-phandle.dtsi deleted file mode 100644 index 0007d3cd7dc2..000000000000 --- a/arch/arm/boot/dts/testcases/tests-phandle.dtsi +++ /dev/null | |||
| @@ -1,39 +0,0 @@ | |||
| 1 | |||
| 2 | / { | ||
| 3 | testcase-data { | ||
| 4 | phandle-tests { | ||
| 5 | provider0: provider0 { | ||
| 6 | #phandle-cells = <0>; | ||
| 7 | }; | ||
| 8 | |||
| 9 | provider1: provider1 { | ||
| 10 | #phandle-cells = <1>; | ||
| 11 | }; | ||
| 12 | |||
| 13 | provider2: provider2 { | ||
| 14 | #phandle-cells = <2>; | ||
| 15 | }; | ||
| 16 | |||
| 17 | provider3: provider3 { | ||
| 18 | #phandle-cells = <3>; | ||
| 19 | }; | ||
| 20 | |||
| 21 | consumer-a { | ||
| 22 | phandle-list = <&provider1 1>, | ||
| 23 | <&provider2 2 0>, | ||
| 24 | <0>, | ||
| 25 | <&provider3 4 4 3>, | ||
| 26 | <&provider2 5 100>, | ||
| 27 | <&provider0>, | ||
| 28 | <&provider1 7>; | ||
| 29 | phandle-list-names = "first", "second", "third"; | ||
| 30 | |||
| 31 | phandle-list-bad-phandle = <12345678 0 0>; | ||
| 32 | phandle-list-bad-args = <&provider2 1 0>, | ||
| 33 | <&provider3 0>; | ||
| 34 | empty-property; | ||
| 35 | unterminated-string = [40 41 42 43]; | ||
| 36 | }; | ||
| 37 | }; | ||
| 38 | }; | ||
| 39 | }; | ||
diff --git a/arch/arm/boot/dts/testcases/tests.dtsi b/arch/arm/boot/dts/testcases/tests.dtsi deleted file mode 100644 index 3f123ecc9dd7..000000000000 --- a/arch/arm/boot/dts/testcases/tests.dtsi +++ /dev/null | |||
| @@ -1,2 +0,0 @@ | |||
| 1 | /include/ "tests-phandle.dtsi" | ||
| 2 | /include/ "tests-interrupts.dtsi" | ||
diff --git a/arch/arm/boot/dts/versatile-pb.dts b/arch/arm/boot/dts/versatile-pb.dts index f43907c40c93..65f657711323 100644 --- a/arch/arm/boot/dts/versatile-pb.dts +++ b/arch/arm/boot/dts/versatile-pb.dts | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /include/ "versatile-ab.dts" | 1 | #include <versatile-ab.dts> |
| 2 | 2 | ||
| 3 | / { | 3 | / { |
| 4 | model = "ARM Versatile PB"; | 4 | model = "ARM Versatile PB"; |
| @@ -47,4 +47,4 @@ | |||
| 47 | }; | 47 | }; |
| 48 | }; | 48 | }; |
| 49 | 49 | ||
| 50 | /include/ "testcases/tests.dtsi" | 50 | #include <testcases.dtsi> |
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h index e9a49fe0284e..8b8b61685a34 100644 --- a/arch/arm/include/asm/cacheflush.h +++ b/arch/arm/include/asm/cacheflush.h | |||
| @@ -212,6 +212,7 @@ extern void copy_to_user_page(struct vm_area_struct *, struct page *, | |||
| 212 | static inline void __flush_icache_all(void) | 212 | static inline void __flush_icache_all(void) |
| 213 | { | 213 | { |
| 214 | __flush_icache_preferred(); | 214 | __flush_icache_preferred(); |
| 215 | dsb(); | ||
| 215 | } | 216 | } |
| 216 | 217 | ||
| 217 | /* | 218 | /* |
diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h index 03243f7eeddf..85c60adc8b60 100644 --- a/arch/arm/include/asm/pgtable-3level.h +++ b/arch/arm/include/asm/pgtable-3level.h | |||
| @@ -120,13 +120,16 @@ | |||
| 120 | /* | 120 | /* |
| 121 | * 2nd stage PTE definitions for LPAE. | 121 | * 2nd stage PTE definitions for LPAE. |
| 122 | */ | 122 | */ |
| 123 | #define L_PTE_S2_MT_UNCACHED (_AT(pteval_t, 0x5) << 2) /* MemAttr[3:0] */ | 123 | #define L_PTE_S2_MT_UNCACHED (_AT(pteval_t, 0x0) << 2) /* strongly ordered */ |
| 124 | #define L_PTE_S2_MT_WRITETHROUGH (_AT(pteval_t, 0xa) << 2) /* MemAttr[3:0] */ | 124 | #define L_PTE_S2_MT_WRITETHROUGH (_AT(pteval_t, 0xa) << 2) /* normal inner write-through */ |
| 125 | #define L_PTE_S2_MT_WRITEBACK (_AT(pteval_t, 0xf) << 2) /* MemAttr[3:0] */ | 125 | #define L_PTE_S2_MT_WRITEBACK (_AT(pteval_t, 0xf) << 2) /* normal inner write-back */ |
| 126 | #define L_PTE_S2_RDONLY (_AT(pteval_t, 1) << 6) /* HAP[1] */ | 126 | #define L_PTE_S2_MT_DEV_SHARED (_AT(pteval_t, 0x1) << 2) /* device */ |
| 127 | #define L_PTE_S2_RDWR (_AT(pteval_t, 3) << 6) /* HAP[2:1] */ | 127 | #define L_PTE_S2_MT_MASK (_AT(pteval_t, 0xf) << 2) |
| 128 | 128 | ||
| 129 | #define L_PMD_S2_RDWR (_AT(pmdval_t, 3) << 6) /* HAP[2:1] */ | 129 | #define L_PTE_S2_RDONLY (_AT(pteval_t, 1) << 6) /* HAP[1] */ |
| 130 | #define L_PTE_S2_RDWR (_AT(pteval_t, 3) << 6) /* HAP[2:1] */ | ||
| 131 | |||
| 132 | #define L_PMD_S2_RDWR (_AT(pmdval_t, 3) << 6) /* HAP[2:1] */ | ||
| 130 | 133 | ||
| 131 | /* | 134 | /* |
| 132 | * Hyp-mode PL2 PTE definitions for LPAE. | 135 | * Hyp-mode PL2 PTE definitions for LPAE. |
diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h index ef3c6072aa45..ac4bfae26702 100644 --- a/arch/arm/include/asm/spinlock.h +++ b/arch/arm/include/asm/spinlock.h | |||
| @@ -37,18 +37,9 @@ | |||
| 37 | 37 | ||
| 38 | static inline void dsb_sev(void) | 38 | static inline void dsb_sev(void) |
| 39 | { | 39 | { |
| 40 | #if __LINUX_ARM_ARCH__ >= 7 | 40 | |
| 41 | __asm__ __volatile__ ( | 41 | dsb(ishst); |
| 42 | "dsb ishst\n" | 42 | __asm__(SEV); |
| 43 | SEV | ||
| 44 | ); | ||
| 45 | #else | ||
| 46 | __asm__ __volatile__ ( | ||
| 47 | "mcr p15, 0, %0, c7, c10, 4\n" | ||
| 48 | SEV | ||
| 49 | : : "r" (0) | ||
| 50 | ); | ||
| 51 | #endif | ||
| 52 | } | 43 | } |
| 53 | 44 | ||
| 54 | /* | 45 | /* |
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index b0df9761de6d..1e8b030dbefd 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
| @@ -731,7 +731,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc) | |||
| 731 | kernel_data.end = virt_to_phys(_end - 1); | 731 | kernel_data.end = virt_to_phys(_end - 1); |
| 732 | 732 | ||
| 733 | for_each_memblock(memory, region) { | 733 | for_each_memblock(memory, region) { |
| 734 | res = memblock_virt_alloc_low(sizeof(*res), 0); | 734 | res = memblock_virt_alloc(sizeof(*res), 0); |
| 735 | res->name = "System RAM"; | 735 | res->name = "System RAM"; |
| 736 | res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region)); | 736 | res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region)); |
| 737 | res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1; | 737 | res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1; |
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c index 4ae0286b468d..f55b05a29b55 100644 --- a/arch/arm/mach-tegra/pm.c +++ b/arch/arm/mach-tegra/pm.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/cpu_pm.h> | 24 | #include <linux/cpu_pm.h> |
| 25 | #include <linux/suspend.h> | 25 | #include <linux/suspend.h> |
| 26 | #include <linux/err.h> | 26 | #include <linux/err.h> |
| 27 | #include <linux/slab.h> | ||
| 27 | #include <linux/clk/tegra.h> | 28 | #include <linux/clk/tegra.h> |
| 28 | 29 | ||
| 29 | #include <asm/smp_plat.h> | 30 | #include <asm/smp_plat.h> |
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 1a77450e728a..11b3914660d2 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
| @@ -1358,7 +1358,7 @@ static void *arm_iommu_alloc_attrs(struct device *dev, size_t size, | |||
| 1358 | *handle = DMA_ERROR_CODE; | 1358 | *handle = DMA_ERROR_CODE; |
| 1359 | size = PAGE_ALIGN(size); | 1359 | size = PAGE_ALIGN(size); |
| 1360 | 1360 | ||
| 1361 | if (gfp & GFP_ATOMIC) | 1361 | if (!(gfp & __GFP_WAIT)) |
| 1362 | return __iommu_alloc_atomic(dev, size, handle); | 1362 | return __iommu_alloc_atomic(dev, size, handle); |
| 1363 | 1363 | ||
| 1364 | /* | 1364 | /* |
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h index d5a982d15a88..7ea641b7aa7d 100644 --- a/arch/arm/mm/mm.h +++ b/arch/arm/mm/mm.h | |||
| @@ -38,6 +38,7 @@ static inline pmd_t *pmd_off_k(unsigned long virt) | |||
| 38 | 38 | ||
| 39 | struct mem_type { | 39 | struct mem_type { |
| 40 | pteval_t prot_pte; | 40 | pteval_t prot_pte; |
| 41 | pteval_t prot_pte_s2; | ||
| 41 | pmdval_t prot_l1; | 42 | pmdval_t prot_l1; |
| 42 | pmdval_t prot_sect; | 43 | pmdval_t prot_sect; |
| 43 | unsigned int domain; | 44 | unsigned int domain; |
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 4f08c133cc25..a623cb3ad012 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
| @@ -232,12 +232,16 @@ __setup("noalign", noalign_setup); | |||
| 232 | #endif /* ifdef CONFIG_CPU_CP15 / else */ | 232 | #endif /* ifdef CONFIG_CPU_CP15 / else */ |
| 233 | 233 | ||
| 234 | #define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_XN | 234 | #define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_XN |
| 235 | #define PROT_PTE_S2_DEVICE PROT_PTE_DEVICE | ||
| 235 | #define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE | 236 | #define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE |
| 236 | 237 | ||
| 237 | static struct mem_type mem_types[] = { | 238 | static struct mem_type mem_types[] = { |
| 238 | [MT_DEVICE] = { /* Strongly ordered / ARMv6 shared device */ | 239 | [MT_DEVICE] = { /* Strongly ordered / ARMv6 shared device */ |
| 239 | .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_SHARED | | 240 | .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_SHARED | |
| 240 | L_PTE_SHARED, | 241 | L_PTE_SHARED, |
| 242 | .prot_pte_s2 = s2_policy(PROT_PTE_S2_DEVICE) | | ||
| 243 | s2_policy(L_PTE_S2_MT_DEV_SHARED) | | ||
| 244 | L_PTE_SHARED, | ||
| 241 | .prot_l1 = PMD_TYPE_TABLE, | 245 | .prot_l1 = PMD_TYPE_TABLE, |
| 242 | .prot_sect = PROT_SECT_DEVICE | PMD_SECT_S, | 246 | .prot_sect = PROT_SECT_DEVICE | PMD_SECT_S, |
| 243 | .domain = DOMAIN_IO, | 247 | .domain = DOMAIN_IO, |
| @@ -508,7 +512,8 @@ static void __init build_mem_type_table(void) | |||
| 508 | cp = &cache_policies[cachepolicy]; | 512 | cp = &cache_policies[cachepolicy]; |
| 509 | vecs_pgprot = kern_pgprot = user_pgprot = cp->pte; | 513 | vecs_pgprot = kern_pgprot = user_pgprot = cp->pte; |
| 510 | s2_pgprot = cp->pte_s2; | 514 | s2_pgprot = cp->pte_s2; |
| 511 | hyp_device_pgprot = s2_device_pgprot = mem_types[MT_DEVICE].prot_pte; | 515 | hyp_device_pgprot = mem_types[MT_DEVICE].prot_pte; |
| 516 | s2_device_pgprot = mem_types[MT_DEVICE].prot_pte_s2; | ||
| 512 | 517 | ||
| 513 | /* | 518 | /* |
| 514 | * ARMv6 and above have extended page tables. | 519 | * ARMv6 and above have extended page tables. |
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S index 45dc29f85d56..32b3558321c4 100644 --- a/arch/arm/mm/proc-v6.S +++ b/arch/arm/mm/proc-v6.S | |||
| @@ -208,7 +208,6 @@ __v6_setup: | |||
| 208 | mcr p15, 0, r0, c7, c14, 0 @ clean+invalidate D cache | 208 | mcr p15, 0, r0, c7, c14, 0 @ clean+invalidate D cache |
| 209 | mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache | 209 | mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache |
| 210 | mcr p15, 0, r0, c7, c15, 0 @ clean+invalidate cache | 210 | mcr p15, 0, r0, c7, c15, 0 @ clean+invalidate cache |
| 211 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer | ||
| 212 | #ifdef CONFIG_MMU | 211 | #ifdef CONFIG_MMU |
| 213 | mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs | 212 | mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs |
| 214 | mcr p15, 0, r0, c2, c0, 2 @ TTB control register | 213 | mcr p15, 0, r0, c2, c0, 2 @ TTB control register |
| @@ -218,6 +217,8 @@ __v6_setup: | |||
| 218 | ALT_UP(orr r8, r8, #TTB_FLAGS_UP) | 217 | ALT_UP(orr r8, r8, #TTB_FLAGS_UP) |
| 219 | mcr p15, 0, r8, c2, c0, 1 @ load TTB1 | 218 | mcr p15, 0, r8, c2, c0, 1 @ load TTB1 |
| 220 | #endif /* CONFIG_MMU */ | 219 | #endif /* CONFIG_MMU */ |
| 220 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer and | ||
| 221 | @ complete invalidations | ||
| 221 | adr r5, v6_crval | 222 | adr r5, v6_crval |
| 222 | ldmia r5, {r5, r6} | 223 | ldmia r5, {r5, r6} |
| 223 | ARM_BE8(orr r6, r6, #1 << 25) @ big-endian page tables | 224 | ARM_BE8(orr r6, r6, #1 << 25) @ big-endian page tables |
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index bd1781979a39..74f6033e76dd 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
| @@ -351,7 +351,6 @@ __v7_setup: | |||
| 351 | 351 | ||
| 352 | 4: mov r10, #0 | 352 | 4: mov r10, #0 |
| 353 | mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate | 353 | mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate |
| 354 | dsb | ||
| 355 | #ifdef CONFIG_MMU | 354 | #ifdef CONFIG_MMU |
| 356 | mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs | 355 | mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs |
| 357 | v7_ttb_setup r10, r4, r8, r5 @ TTBCR, TTBRx setup | 356 | v7_ttb_setup r10, r4, r8, r5 @ TTBCR, TTBRx setup |
| @@ -360,6 +359,7 @@ __v7_setup: | |||
| 360 | mcr p15, 0, r5, c10, c2, 0 @ write PRRR | 359 | mcr p15, 0, r5, c10, c2, 0 @ write PRRR |
| 361 | mcr p15, 0, r6, c10, c2, 1 @ write NMRR | 360 | mcr p15, 0, r6, c10, c2, 1 @ write NMRR |
| 362 | #endif | 361 | #endif |
| 362 | dsb @ Complete invalidations | ||
| 363 | #ifndef CONFIG_ARM_THUMBEE | 363 | #ifndef CONFIG_ARM_THUMBEE |
| 364 | mrc p15, 0, r0, c0, c1, 0 @ read ID_PFR0 for ThumbEE | 364 | mrc p15, 0, r0, c0, c1, 0 @ read ID_PFR0 for ThumbEE |
| 365 | and r0, r0, #(0xf << 12) @ ThumbEE enabled field | 365 | and r0, r0, #(0xf << 12) @ ThumbEE enabled field |
diff --git a/arch/avr32/Makefile b/arch/avr32/Makefile index 22fb66590dcd..dba48a5d5bb9 100644 --- a/arch/avr32/Makefile +++ b/arch/avr32/Makefile | |||
| @@ -11,7 +11,7 @@ all: uImage vmlinux.elf | |||
| 11 | 11 | ||
| 12 | KBUILD_DEFCONFIG := atstk1002_defconfig | 12 | KBUILD_DEFCONFIG := atstk1002_defconfig |
| 13 | 13 | ||
| 14 | KBUILD_CFLAGS += -pipe -fno-builtin -mno-pic | 14 | KBUILD_CFLAGS += -pipe -fno-builtin -mno-pic -D__linux__ |
| 15 | KBUILD_AFLAGS += -mrelax -mno-pic | 15 | KBUILD_AFLAGS += -mrelax -mno-pic |
| 16 | KBUILD_CFLAGS_MODULE += -mno-relax | 16 | KBUILD_CFLAGS_MODULE += -mno-relax |
| 17 | LDFLAGS_vmlinux += --relax | 17 | LDFLAGS_vmlinux += --relax |
diff --git a/arch/avr32/boards/mimc200/fram.c b/arch/avr32/boards/mimc200/fram.c index 9764a1a1073e..c1466a872b9c 100644 --- a/arch/avr32/boards/mimc200/fram.c +++ b/arch/avr32/boards/mimc200/fram.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #define FRAM_VERSION "1.0" | 11 | #define FRAM_VERSION "1.0" |
| 12 | 12 | ||
| 13 | #include <linux/miscdevice.h> | 13 | #include <linux/miscdevice.h> |
| 14 | #include <linux/module.h> | ||
| 14 | #include <linux/proc_fs.h> | 15 | #include <linux/proc_fs.h> |
| 15 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
| 16 | #include <linux/io.h> | 17 | #include <linux/io.h> |
diff --git a/arch/avr32/include/asm/Kbuild b/arch/avr32/include/asm/Kbuild index cfb9fe1b8df9..c7c64a63c29f 100644 --- a/arch/avr32/include/asm/Kbuild +++ b/arch/avr32/include/asm/Kbuild | |||
| @@ -17,5 +17,6 @@ generic-y += scatterlist.h | |||
| 17 | generic-y += sections.h | 17 | generic-y += sections.h |
| 18 | generic-y += topology.h | 18 | generic-y += topology.h |
| 19 | generic-y += trace_clock.h | 19 | generic-y += trace_clock.h |
| 20 | generic-y += vga.h | ||
| 20 | generic-y += xor.h | 21 | generic-y += xor.h |
| 21 | generic-y += hash.h | 22 | generic-y += hash.h |
diff --git a/arch/avr32/include/asm/io.h b/arch/avr32/include/asm/io.h index fc6483f83ccc..4f5ec2bb7172 100644 --- a/arch/avr32/include/asm/io.h +++ b/arch/avr32/include/asm/io.h | |||
| @@ -295,6 +295,8 @@ extern void __iounmap(void __iomem *addr); | |||
| 295 | #define iounmap(addr) \ | 295 | #define iounmap(addr) \ |
| 296 | __iounmap(addr) | 296 | __iounmap(addr) |
| 297 | 297 | ||
| 298 | #define ioremap_wc ioremap_nocache | ||
| 299 | |||
| 298 | #define cached(addr) P1SEGADDR(addr) | 300 | #define cached(addr) P1SEGADDR(addr) |
| 299 | #define uncached(addr) P2SEGADDR(addr) | 301 | #define uncached(addr) P2SEGADDR(addr) |
| 300 | 302 | ||
diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h index 9e39ceb1d19f..d4dd41fb951b 100644 --- a/arch/powerpc/include/asm/eeh.h +++ b/arch/powerpc/include/asm/eeh.h | |||
| @@ -172,10 +172,20 @@ struct eeh_ops { | |||
| 172 | }; | 172 | }; |
| 173 | 173 | ||
| 174 | extern struct eeh_ops *eeh_ops; | 174 | extern struct eeh_ops *eeh_ops; |
| 175 | extern int eeh_subsystem_enabled; | 175 | extern bool eeh_subsystem_enabled; |
| 176 | extern raw_spinlock_t confirm_error_lock; | 176 | extern raw_spinlock_t confirm_error_lock; |
| 177 | extern int eeh_probe_mode; | 177 | extern int eeh_probe_mode; |
| 178 | 178 | ||
| 179 | static inline bool eeh_enabled(void) | ||
| 180 | { | ||
| 181 | return eeh_subsystem_enabled; | ||
| 182 | } | ||
| 183 | |||
| 184 | static inline void eeh_set_enable(bool mode) | ||
| 185 | { | ||
| 186 | eeh_subsystem_enabled = mode; | ||
| 187 | } | ||
| 188 | |||
| 179 | #define EEH_PROBE_MODE_DEV (1<<0) /* From PCI device */ | 189 | #define EEH_PROBE_MODE_DEV (1<<0) /* From PCI device */ |
| 180 | #define EEH_PROBE_MODE_DEVTREE (1<<1) /* From device tree */ | 190 | #define EEH_PROBE_MODE_DEVTREE (1<<1) /* From device tree */ |
| 181 | 191 | ||
| @@ -246,7 +256,7 @@ void eeh_remove_device(struct pci_dev *); | |||
| 246 | * If this macro yields TRUE, the caller relays to eeh_check_failure() | 256 | * If this macro yields TRUE, the caller relays to eeh_check_failure() |
| 247 | * which does further tests out of line. | 257 | * which does further tests out of line. |
| 248 | */ | 258 | */ |
| 249 | #define EEH_POSSIBLE_ERROR(val, type) ((val) == (type)~0 && eeh_subsystem_enabled) | 259 | #define EEH_POSSIBLE_ERROR(val, type) ((val) == (type)~0 && eeh_enabled()) |
| 250 | 260 | ||
| 251 | /* | 261 | /* |
| 252 | * Reads from a device which has been isolated by EEH will return | 262 | * Reads from a device which has been isolated by EEH will return |
| @@ -257,6 +267,13 @@ void eeh_remove_device(struct pci_dev *); | |||
| 257 | 267 | ||
| 258 | #else /* !CONFIG_EEH */ | 268 | #else /* !CONFIG_EEH */ |
| 259 | 269 | ||
| 270 | static inline bool eeh_enabled(void) | ||
| 271 | { | ||
| 272 | return false; | ||
| 273 | } | ||
| 274 | |||
| 275 | static inline void eeh_set_enable(bool mode) { } | ||
| 276 | |||
| 260 | static inline int eeh_init(void) | 277 | static inline int eeh_init(void) |
| 261 | { | 278 | { |
| 262 | return 0; | 279 | return 0; |
diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h index d750336b171d..623f2971ce0e 100644 --- a/arch/powerpc/include/asm/hugetlb.h +++ b/arch/powerpc/include/asm/hugetlb.h | |||
| @@ -127,7 +127,7 @@ static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, | |||
| 127 | unsigned long addr, pte_t *ptep) | 127 | unsigned long addr, pte_t *ptep) |
| 128 | { | 128 | { |
| 129 | #ifdef CONFIG_PPC64 | 129 | #ifdef CONFIG_PPC64 |
| 130 | return __pte(pte_update(mm, addr, ptep, ~0UL, 1)); | 130 | return __pte(pte_update(mm, addr, ptep, ~0UL, 0, 1)); |
| 131 | #else | 131 | #else |
| 132 | return __pte(pte_update(ptep, ~0UL, 0)); | 132 | return __pte(pte_update(ptep, ~0UL, 0)); |
| 133 | #endif | 133 | #endif |
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h index bc141c950b1e..eb9261024f51 100644 --- a/arch/powerpc/include/asm/pgtable-ppc64.h +++ b/arch/powerpc/include/asm/pgtable-ppc64.h | |||
| @@ -195,6 +195,7 @@ extern void hpte_need_flush(struct mm_struct *mm, unsigned long addr, | |||
| 195 | static inline unsigned long pte_update(struct mm_struct *mm, | 195 | static inline unsigned long pte_update(struct mm_struct *mm, |
| 196 | unsigned long addr, | 196 | unsigned long addr, |
| 197 | pte_t *ptep, unsigned long clr, | 197 | pte_t *ptep, unsigned long clr, |
| 198 | unsigned long set, | ||
| 198 | int huge) | 199 | int huge) |
| 199 | { | 200 | { |
| 200 | #ifdef PTE_ATOMIC_UPDATES | 201 | #ifdef PTE_ATOMIC_UPDATES |
| @@ -205,14 +206,15 @@ static inline unsigned long pte_update(struct mm_struct *mm, | |||
| 205 | andi. %1,%0,%6\n\ | 206 | andi. %1,%0,%6\n\ |
| 206 | bne- 1b \n\ | 207 | bne- 1b \n\ |
| 207 | andc %1,%0,%4 \n\ | 208 | andc %1,%0,%4 \n\ |
| 209 | or %1,%1,%7\n\ | ||
| 208 | stdcx. %1,0,%3 \n\ | 210 | stdcx. %1,0,%3 \n\ |
| 209 | bne- 1b" | 211 | bne- 1b" |
| 210 | : "=&r" (old), "=&r" (tmp), "=m" (*ptep) | 212 | : "=&r" (old), "=&r" (tmp), "=m" (*ptep) |
| 211 | : "r" (ptep), "r" (clr), "m" (*ptep), "i" (_PAGE_BUSY) | 213 | : "r" (ptep), "r" (clr), "m" (*ptep), "i" (_PAGE_BUSY), "r" (set) |
| 212 | : "cc" ); | 214 | : "cc" ); |
| 213 | #else | 215 | #else |
| 214 | unsigned long old = pte_val(*ptep); | 216 | unsigned long old = pte_val(*ptep); |
| 215 | *ptep = __pte(old & ~clr); | 217 | *ptep = __pte((old & ~clr) | set); |
| 216 | #endif | 218 | #endif |
| 217 | /* huge pages use the old page table lock */ | 219 | /* huge pages use the old page table lock */ |
| 218 | if (!huge) | 220 | if (!huge) |
| @@ -231,9 +233,9 @@ static inline int __ptep_test_and_clear_young(struct mm_struct *mm, | |||
| 231 | { | 233 | { |
| 232 | unsigned long old; | 234 | unsigned long old; |
| 233 | 235 | ||
| 234 | if ((pte_val(*ptep) & (_PAGE_ACCESSED | _PAGE_HASHPTE)) == 0) | 236 | if ((pte_val(*ptep) & (_PAGE_ACCESSED | _PAGE_HASHPTE)) == 0) |
| 235 | return 0; | 237 | return 0; |
| 236 | old = pte_update(mm, addr, ptep, _PAGE_ACCESSED, 0); | 238 | old = pte_update(mm, addr, ptep, _PAGE_ACCESSED, 0, 0); |
| 237 | return (old & _PAGE_ACCESSED) != 0; | 239 | return (old & _PAGE_ACCESSED) != 0; |
| 238 | } | 240 | } |
| 239 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG | 241 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG |
| @@ -252,7 +254,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, | |||
| 252 | if ((pte_val(*ptep) & _PAGE_RW) == 0) | 254 | if ((pte_val(*ptep) & _PAGE_RW) == 0) |
| 253 | return; | 255 | return; |
| 254 | 256 | ||
| 255 | pte_update(mm, addr, ptep, _PAGE_RW, 0); | 257 | pte_update(mm, addr, ptep, _PAGE_RW, 0, 0); |
| 256 | } | 258 | } |
| 257 | 259 | ||
| 258 | static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, | 260 | static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, |
| @@ -261,7 +263,7 @@ static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, | |||
| 261 | if ((pte_val(*ptep) & _PAGE_RW) == 0) | 263 | if ((pte_val(*ptep) & _PAGE_RW) == 0) |
| 262 | return; | 264 | return; |
| 263 | 265 | ||
| 264 | pte_update(mm, addr, ptep, _PAGE_RW, 1); | 266 | pte_update(mm, addr, ptep, _PAGE_RW, 0, 1); |
| 265 | } | 267 | } |
| 266 | 268 | ||
| 267 | /* | 269 | /* |
| @@ -284,14 +286,14 @@ static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, | |||
| 284 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, | 286 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, |
| 285 | unsigned long addr, pte_t *ptep) | 287 | unsigned long addr, pte_t *ptep) |
| 286 | { | 288 | { |
| 287 | unsigned long old = pte_update(mm, addr, ptep, ~0UL, 0); | 289 | unsigned long old = pte_update(mm, addr, ptep, ~0UL, 0, 0); |
| 288 | return __pte(old); | 290 | return __pte(old); |
| 289 | } | 291 | } |
| 290 | 292 | ||
| 291 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, | 293 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, |
| 292 | pte_t * ptep) | 294 | pte_t * ptep) |
| 293 | { | 295 | { |
| 294 | pte_update(mm, addr, ptep, ~0UL, 0); | 296 | pte_update(mm, addr, ptep, ~0UL, 0, 0); |
| 295 | } | 297 | } |
| 296 | 298 | ||
| 297 | 299 | ||
| @@ -506,7 +508,9 @@ extern int pmdp_set_access_flags(struct vm_area_struct *vma, | |||
| 506 | 508 | ||
| 507 | extern unsigned long pmd_hugepage_update(struct mm_struct *mm, | 509 | extern unsigned long pmd_hugepage_update(struct mm_struct *mm, |
| 508 | unsigned long addr, | 510 | unsigned long addr, |
| 509 | pmd_t *pmdp, unsigned long clr); | 511 | pmd_t *pmdp, |
| 512 | unsigned long clr, | ||
| 513 | unsigned long set); | ||
| 510 | 514 | ||
| 511 | static inline int __pmdp_test_and_clear_young(struct mm_struct *mm, | 515 | static inline int __pmdp_test_and_clear_young(struct mm_struct *mm, |
| 512 | unsigned long addr, pmd_t *pmdp) | 516 | unsigned long addr, pmd_t *pmdp) |
| @@ -515,7 +519,7 @@ static inline int __pmdp_test_and_clear_young(struct mm_struct *mm, | |||
| 515 | 519 | ||
| 516 | if ((pmd_val(*pmdp) & (_PAGE_ACCESSED | _PAGE_HASHPTE)) == 0) | 520 | if ((pmd_val(*pmdp) & (_PAGE_ACCESSED | _PAGE_HASHPTE)) == 0) |
| 517 | return 0; | 521 | return 0; |
| 518 | old = pmd_hugepage_update(mm, addr, pmdp, _PAGE_ACCESSED); | 522 | old = pmd_hugepage_update(mm, addr, pmdp, _PAGE_ACCESSED, 0); |
| 519 | return ((old & _PAGE_ACCESSED) != 0); | 523 | return ((old & _PAGE_ACCESSED) != 0); |
| 520 | } | 524 | } |
| 521 | 525 | ||
| @@ -542,7 +546,7 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm, unsigned long addr, | |||
| 542 | if ((pmd_val(*pmdp) & _PAGE_RW) == 0) | 546 | if ((pmd_val(*pmdp) & _PAGE_RW) == 0) |
| 543 | return; | 547 | return; |
| 544 | 548 | ||
| 545 | pmd_hugepage_update(mm, addr, pmdp, _PAGE_RW); | 549 | pmd_hugepage_update(mm, addr, pmdp, _PAGE_RW, 0); |
| 546 | } | 550 | } |
| 547 | 551 | ||
| 548 | #define __HAVE_ARCH_PMDP_SPLITTING_FLUSH | 552 | #define __HAVE_ARCH_PMDP_SPLITTING_FLUSH |
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h index f83b6f3e1b39..3ebb188c3ff5 100644 --- a/arch/powerpc/include/asm/pgtable.h +++ b/arch/powerpc/include/asm/pgtable.h | |||
| @@ -75,12 +75,34 @@ static inline pte_t pte_mknuma(pte_t pte) | |||
| 75 | return pte; | 75 | return pte; |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | #define ptep_set_numa ptep_set_numa | ||
| 79 | static inline void ptep_set_numa(struct mm_struct *mm, unsigned long addr, | ||
| 80 | pte_t *ptep) | ||
| 81 | { | ||
| 82 | if ((pte_val(*ptep) & _PAGE_PRESENT) == 0) | ||
| 83 | VM_BUG_ON(1); | ||
| 84 | |||
| 85 | pte_update(mm, addr, ptep, _PAGE_PRESENT, _PAGE_NUMA, 0); | ||
| 86 | return; | ||
| 87 | } | ||
| 88 | |||
| 78 | #define pmd_numa pmd_numa | 89 | #define pmd_numa pmd_numa |
| 79 | static inline int pmd_numa(pmd_t pmd) | 90 | static inline int pmd_numa(pmd_t pmd) |
| 80 | { | 91 | { |
| 81 | return pte_numa(pmd_pte(pmd)); | 92 | return pte_numa(pmd_pte(pmd)); |
| 82 | } | 93 | } |
| 83 | 94 | ||
| 95 | #define pmdp_set_numa pmdp_set_numa | ||
| 96 | static inline void pmdp_set_numa(struct mm_struct *mm, unsigned long addr, | ||
| 97 | pmd_t *pmdp) | ||
| 98 | { | ||
| 99 | if ((pmd_val(*pmdp) & _PAGE_PRESENT) == 0) | ||
| 100 | VM_BUG_ON(1); | ||
| 101 | |||
| 102 | pmd_hugepage_update(mm, addr, pmdp, _PAGE_PRESENT, _PAGE_NUMA); | ||
| 103 | return; | ||
| 104 | } | ||
| 105 | |||
| 84 | #define pmd_mknonnuma pmd_mknonnuma | 106 | #define pmd_mknonnuma pmd_mknonnuma |
| 85 | static inline pmd_t pmd_mknonnuma(pmd_t pmd) | 107 | static inline pmd_t pmd_mknonnuma(pmd_t pmd) |
| 86 | { | 108 | { |
diff --git a/arch/powerpc/include/asm/vdso.h b/arch/powerpc/include/asm/vdso.h index 0d9cecddf8a4..c53f5f6d1761 100644 --- a/arch/powerpc/include/asm/vdso.h +++ b/arch/powerpc/include/asm/vdso.h | |||
| @@ -4,11 +4,11 @@ | |||
| 4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
| 5 | 5 | ||
| 6 | /* Default link addresses for the vDSOs */ | 6 | /* Default link addresses for the vDSOs */ |
| 7 | #define VDSO32_LBASE 0x100000 | 7 | #define VDSO32_LBASE 0x0 |
| 8 | #define VDSO64_LBASE 0x100000 | 8 | #define VDSO64_LBASE 0x0 |
| 9 | 9 | ||
| 10 | /* Default map addresses for 32bit vDSO */ | 10 | /* Default map addresses for 32bit vDSO */ |
| 11 | #define VDSO32_MBASE VDSO32_LBASE | 11 | #define VDSO32_MBASE 0x100000 |
| 12 | 12 | ||
| 13 | #define VDSO_VERSION_STRING LINUX_2.6.15 | 13 | #define VDSO_VERSION_STRING LINUX_2.6.15 |
| 14 | 14 | ||
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c index 148db72a8c43..e7b76a6bf150 100644 --- a/arch/powerpc/kernel/eeh.c +++ b/arch/powerpc/kernel/eeh.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/pci.h> | 28 | #include <linux/pci.h> |
| 29 | #include <linux/proc_fs.h> | 29 | #include <linux/proc_fs.h> |
| 30 | #include <linux/rbtree.h> | 30 | #include <linux/rbtree.h> |
| 31 | #include <linux/reboot.h> | ||
| 31 | #include <linux/seq_file.h> | 32 | #include <linux/seq_file.h> |
| 32 | #include <linux/spinlock.h> | 33 | #include <linux/spinlock.h> |
| 33 | #include <linux/export.h> | 34 | #include <linux/export.h> |
| @@ -89,7 +90,7 @@ | |||
| 89 | /* Platform dependent EEH operations */ | 90 | /* Platform dependent EEH operations */ |
| 90 | struct eeh_ops *eeh_ops = NULL; | 91 | struct eeh_ops *eeh_ops = NULL; |
| 91 | 92 | ||
| 92 | int eeh_subsystem_enabled; | 93 | bool eeh_subsystem_enabled = false; |
| 93 | EXPORT_SYMBOL(eeh_subsystem_enabled); | 94 | EXPORT_SYMBOL(eeh_subsystem_enabled); |
| 94 | 95 | ||
| 95 | /* | 96 | /* |
| @@ -364,7 +365,7 @@ int eeh_dev_check_failure(struct eeh_dev *edev) | |||
| 364 | 365 | ||
| 365 | eeh_stats.total_mmio_ffs++; | 366 | eeh_stats.total_mmio_ffs++; |
| 366 | 367 | ||
| 367 | if (!eeh_subsystem_enabled) | 368 | if (!eeh_enabled()) |
| 368 | return 0; | 369 | return 0; |
| 369 | 370 | ||
| 370 | if (!edev) { | 371 | if (!edev) { |
| @@ -747,6 +748,17 @@ int __exit eeh_ops_unregister(const char *name) | |||
| 747 | return -EEXIST; | 748 | return -EEXIST; |
| 748 | } | 749 | } |
| 749 | 750 | ||
| 751 | static int eeh_reboot_notifier(struct notifier_block *nb, | ||
| 752 | unsigned long action, void *unused) | ||
| 753 | { | ||
| 754 | eeh_set_enable(false); | ||
| 755 | return NOTIFY_DONE; | ||
| 756 | } | ||
| 757 | |||
| 758 | static struct notifier_block eeh_reboot_nb = { | ||
| 759 | .notifier_call = eeh_reboot_notifier, | ||
| 760 | }; | ||
| 761 | |||
| 750 | /** | 762 | /** |
| 751 | * eeh_init - EEH initialization | 763 | * eeh_init - EEH initialization |
| 752 | * | 764 | * |
| @@ -778,6 +790,14 @@ int eeh_init(void) | |||
| 778 | if (machine_is(powernv) && cnt++ <= 0) | 790 | if (machine_is(powernv) && cnt++ <= 0) |
| 779 | return ret; | 791 | return ret; |
| 780 | 792 | ||
| 793 | /* Register reboot notifier */ | ||
| 794 | ret = register_reboot_notifier(&eeh_reboot_nb); | ||
| 795 | if (ret) { | ||
| 796 | pr_warn("%s: Failed to register notifier (%d)\n", | ||
| 797 | __func__, ret); | ||
| 798 | return ret; | ||
| 799 | } | ||
| 800 | |||
| 781 | /* call platform initialization function */ | 801 | /* call platform initialization function */ |
| 782 | if (!eeh_ops) { | 802 | if (!eeh_ops) { |
| 783 | pr_warning("%s: Platform EEH operation not found\n", | 803 | pr_warning("%s: Platform EEH operation not found\n", |
| @@ -822,7 +842,7 @@ int eeh_init(void) | |||
| 822 | return ret; | 842 | return ret; |
| 823 | } | 843 | } |
| 824 | 844 | ||
| 825 | if (eeh_subsystem_enabled) | 845 | if (eeh_enabled()) |
| 826 | pr_info("EEH: PCI Enhanced I/O Error Handling Enabled\n"); | 846 | pr_info("EEH: PCI Enhanced I/O Error Handling Enabled\n"); |
| 827 | else | 847 | else |
| 828 | pr_warning("EEH: No capable adapters found\n"); | 848 | pr_warning("EEH: No capable adapters found\n"); |
| @@ -897,7 +917,7 @@ void eeh_add_device_late(struct pci_dev *dev) | |||
| 897 | struct device_node *dn; | 917 | struct device_node *dn; |
| 898 | struct eeh_dev *edev; | 918 | struct eeh_dev *edev; |
| 899 | 919 | ||
| 900 | if (!dev || !eeh_subsystem_enabled) | 920 | if (!dev || !eeh_enabled()) |
| 901 | return; | 921 | return; |
| 902 | 922 | ||
| 903 | pr_debug("EEH: Adding device %s\n", pci_name(dev)); | 923 | pr_debug("EEH: Adding device %s\n", pci_name(dev)); |
| @@ -1005,7 +1025,7 @@ void eeh_remove_device(struct pci_dev *dev) | |||
| 1005 | { | 1025 | { |
| 1006 | struct eeh_dev *edev; | 1026 | struct eeh_dev *edev; |
| 1007 | 1027 | ||
| 1008 | if (!dev || !eeh_subsystem_enabled) | 1028 | if (!dev || !eeh_enabled()) |
| 1009 | return; | 1029 | return; |
| 1010 | edev = pci_dev_to_eeh_dev(dev); | 1030 | edev = pci_dev_to_eeh_dev(dev); |
| 1011 | 1031 | ||
| @@ -1045,7 +1065,7 @@ void eeh_remove_device(struct pci_dev *dev) | |||
| 1045 | 1065 | ||
| 1046 | static int proc_eeh_show(struct seq_file *m, void *v) | 1066 | static int proc_eeh_show(struct seq_file *m, void *v) |
| 1047 | { | 1067 | { |
| 1048 | if (0 == eeh_subsystem_enabled) { | 1068 | if (!eeh_enabled()) { |
| 1049 | seq_printf(m, "EEH Subsystem is globally disabled\n"); | 1069 | seq_printf(m, "EEH Subsystem is globally disabled\n"); |
| 1050 | seq_printf(m, "eeh_total_mmio_ffs=%llu\n", eeh_stats.total_mmio_ffs); | 1070 | seq_printf(m, "eeh_total_mmio_ffs=%llu\n", eeh_stats.total_mmio_ffs); |
| 1051 | } else { | 1071 | } else { |
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S index 879f09620f83..7c6bb4b17b49 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S | |||
| @@ -57,11 +57,14 @@ _GLOBAL(call_do_softirq) | |||
| 57 | mtlr r0 | 57 | mtlr r0 |
| 58 | blr | 58 | blr |
| 59 | 59 | ||
| 60 | /* | ||
| 61 | * void call_do_irq(struct pt_regs *regs, struct thread_info *irqtp); | ||
| 62 | */ | ||
| 60 | _GLOBAL(call_do_irq) | 63 | _GLOBAL(call_do_irq) |
| 61 | mflr r0 | 64 | mflr r0 |
| 62 | stw r0,4(r1) | 65 | stw r0,4(r1) |
| 63 | lwz r10,THREAD+KSP_LIMIT(r2) | 66 | lwz r10,THREAD+KSP_LIMIT(r2) |
| 64 | addi r11,r3,THREAD_INFO_GAP | 67 | addi r11,r4,THREAD_INFO_GAP |
| 65 | stwu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r4) | 68 | stwu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r4) |
| 66 | mr r1,r4 | 69 | mr r1,r4 |
| 67 | stw r10,8(r1) | 70 | stw r10,8(r1) |
diff --git a/arch/powerpc/kernel/vdso32/vdso32_wrapper.S b/arch/powerpc/kernel/vdso32/vdso32_wrapper.S index 79683d0393f5..6ac107ac402a 100644 --- a/arch/powerpc/kernel/vdso32/vdso32_wrapper.S +++ b/arch/powerpc/kernel/vdso32/vdso32_wrapper.S | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | .globl vdso32_start, vdso32_end | 6 | .globl vdso32_start, vdso32_end |
| 7 | .balign PAGE_SIZE | 7 | .balign PAGE_SIZE |
| 8 | vdso32_start: | 8 | vdso32_start: |
| 9 | .incbin "arch/powerpc/kernel/vdso32/vdso32.so" | 9 | .incbin "arch/powerpc/kernel/vdso32/vdso32.so.dbg" |
| 10 | .balign PAGE_SIZE | 10 | .balign PAGE_SIZE |
| 11 | vdso32_end: | 11 | vdso32_end: |
| 12 | 12 | ||
diff --git a/arch/powerpc/kernel/vdso64/vdso64_wrapper.S b/arch/powerpc/kernel/vdso64/vdso64_wrapper.S index 8df9e2463007..df60fca6a13d 100644 --- a/arch/powerpc/kernel/vdso64/vdso64_wrapper.S +++ b/arch/powerpc/kernel/vdso64/vdso64_wrapper.S | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | .globl vdso64_start, vdso64_end | 6 | .globl vdso64_start, vdso64_end |
| 7 | .balign PAGE_SIZE | 7 | .balign PAGE_SIZE |
| 8 | vdso64_start: | 8 | vdso64_start: |
| 9 | .incbin "arch/powerpc/kernel/vdso64/vdso64.so" | 9 | .incbin "arch/powerpc/kernel/vdso64/vdso64.so.dbg" |
| 10 | .balign PAGE_SIZE | 10 | .balign PAGE_SIZE |
| 11 | vdso64_end: | 11 | vdso64_end: |
| 12 | 12 | ||
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c index 65b7b65e8708..62bf5e8e78da 100644 --- a/arch/powerpc/mm/pgtable_64.c +++ b/arch/powerpc/mm/pgtable_64.c | |||
| @@ -510,7 +510,8 @@ int pmdp_set_access_flags(struct vm_area_struct *vma, unsigned long address, | |||
| 510 | } | 510 | } |
| 511 | 511 | ||
| 512 | unsigned long pmd_hugepage_update(struct mm_struct *mm, unsigned long addr, | 512 | unsigned long pmd_hugepage_update(struct mm_struct *mm, unsigned long addr, |
| 513 | pmd_t *pmdp, unsigned long clr) | 513 | pmd_t *pmdp, unsigned long clr, |
| 514 | unsigned long set) | ||
| 514 | { | 515 | { |
| 515 | 516 | ||
| 516 | unsigned long old, tmp; | 517 | unsigned long old, tmp; |
| @@ -526,14 +527,15 @@ unsigned long pmd_hugepage_update(struct mm_struct *mm, unsigned long addr, | |||
| 526 | andi. %1,%0,%6\n\ | 527 | andi. %1,%0,%6\n\ |
| 527 | bne- 1b \n\ | 528 | bne- 1b \n\ |
| 528 | andc %1,%0,%4 \n\ | 529 | andc %1,%0,%4 \n\ |
| 530 | or %1,%1,%7\n\ | ||
| 529 | stdcx. %1,0,%3 \n\ | 531 | stdcx. %1,0,%3 \n\ |
| 530 | bne- 1b" | 532 | bne- 1b" |
| 531 | : "=&r" (old), "=&r" (tmp), "=m" (*pmdp) | 533 | : "=&r" (old), "=&r" (tmp), "=m" (*pmdp) |
| 532 | : "r" (pmdp), "r" (clr), "m" (*pmdp), "i" (_PAGE_BUSY) | 534 | : "r" (pmdp), "r" (clr), "m" (*pmdp), "i" (_PAGE_BUSY), "r" (set) |
| 533 | : "cc" ); | 535 | : "cc" ); |
| 534 | #else | 536 | #else |
| 535 | old = pmd_val(*pmdp); | 537 | old = pmd_val(*pmdp); |
| 536 | *pmdp = __pmd(old & ~clr); | 538 | *pmdp = __pmd((old & ~clr) | set); |
| 537 | #endif | 539 | #endif |
| 538 | if (old & _PAGE_HASHPTE) | 540 | if (old & _PAGE_HASHPTE) |
| 539 | hpte_do_hugepage_flush(mm, addr, pmdp); | 541 | hpte_do_hugepage_flush(mm, addr, pmdp); |
| @@ -708,7 +710,7 @@ void set_pmd_at(struct mm_struct *mm, unsigned long addr, | |||
| 708 | void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, | 710 | void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, |
| 709 | pmd_t *pmdp) | 711 | pmd_t *pmdp) |
| 710 | { | 712 | { |
| 711 | pmd_hugepage_update(vma->vm_mm, address, pmdp, _PAGE_PRESENT); | 713 | pmd_hugepage_update(vma->vm_mm, address, pmdp, _PAGE_PRESENT, 0); |
| 712 | } | 714 | } |
| 713 | 715 | ||
| 714 | /* | 716 | /* |
| @@ -835,7 +837,7 @@ pmd_t pmdp_get_and_clear(struct mm_struct *mm, | |||
| 835 | unsigned long old; | 837 | unsigned long old; |
| 836 | pgtable_t *pgtable_slot; | 838 | pgtable_t *pgtable_slot; |
| 837 | 839 | ||
| 838 | old = pmd_hugepage_update(mm, addr, pmdp, ~0UL); | 840 | old = pmd_hugepage_update(mm, addr, pmdp, ~0UL, 0); |
| 839 | old_pmd = __pmd(old); | 841 | old_pmd = __pmd(old); |
| 840 | /* | 842 | /* |
| 841 | * We have pmd == none and we are holding page_table_lock. | 843 | * We have pmd == none and we are holding page_table_lock. |
diff --git a/arch/powerpc/mm/subpage-prot.c b/arch/powerpc/mm/subpage-prot.c index a770df2dae70..6c0b1f5f8d2c 100644 --- a/arch/powerpc/mm/subpage-prot.c +++ b/arch/powerpc/mm/subpage-prot.c | |||
| @@ -78,7 +78,7 @@ static void hpte_flush_range(struct mm_struct *mm, unsigned long addr, | |||
| 78 | pte = pte_offset_map_lock(mm, pmd, addr, &ptl); | 78 | pte = pte_offset_map_lock(mm, pmd, addr, &ptl); |
| 79 | arch_enter_lazy_mmu_mode(); | 79 | arch_enter_lazy_mmu_mode(); |
| 80 | for (; npages > 0; --npages) { | 80 | for (; npages > 0; --npages) { |
| 81 | pte_update(mm, addr, pte, 0, 0); | 81 | pte_update(mm, addr, pte, 0, 0, 0); |
| 82 | addr += PAGE_SIZE; | 82 | addr += PAGE_SIZE; |
| 83 | ++pte; | 83 | ++pte; |
| 84 | } | 84 | } |
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c index e1e71618b70c..f51474336460 100644 --- a/arch/powerpc/platforms/powernv/eeh-ioda.c +++ b/arch/powerpc/platforms/powernv/eeh-ioda.c | |||
| @@ -44,7 +44,8 @@ static int ioda_eeh_event(struct notifier_block *nb, | |||
| 44 | 44 | ||
| 45 | /* We simply send special EEH event */ | 45 | /* We simply send special EEH event */ |
| 46 | if ((changed_evts & OPAL_EVENT_PCI_ERROR) && | 46 | if ((changed_evts & OPAL_EVENT_PCI_ERROR) && |
| 47 | (events & OPAL_EVENT_PCI_ERROR)) | 47 | (events & OPAL_EVENT_PCI_ERROR) && |
| 48 | eeh_enabled()) | ||
| 48 | eeh_send_failure_event(NULL); | 49 | eeh_send_failure_event(NULL); |
| 49 | 50 | ||
| 50 | return 0; | 51 | return 0; |
| @@ -489,8 +490,7 @@ static int ioda_eeh_bridge_reset(struct pci_controller *hose, | |||
| 489 | static int ioda_eeh_reset(struct eeh_pe *pe, int option) | 490 | static int ioda_eeh_reset(struct eeh_pe *pe, int option) |
| 490 | { | 491 | { |
| 491 | struct pci_controller *hose = pe->phb; | 492 | struct pci_controller *hose = pe->phb; |
| 492 | struct eeh_dev *edev; | 493 | struct pci_bus *bus; |
| 493 | struct pci_dev *dev; | ||
| 494 | int ret; | 494 | int ret; |
| 495 | 495 | ||
| 496 | /* | 496 | /* |
| @@ -519,31 +519,11 @@ static int ioda_eeh_reset(struct eeh_pe *pe, int option) | |||
| 519 | if (pe->type & EEH_PE_PHB) { | 519 | if (pe->type & EEH_PE_PHB) { |
| 520 | ret = ioda_eeh_phb_reset(hose, option); | 520 | ret = ioda_eeh_phb_reset(hose, option); |
| 521 | } else { | 521 | } else { |
| 522 | if (pe->type & EEH_PE_DEVICE) { | 522 | bus = eeh_pe_bus_get(pe); |
| 523 | /* | 523 | if (pci_is_root_bus(bus)) |
| 524 | * If it's device PE, we didn't refer to the parent | ||
| 525 | * PCI bus yet. So we have to figure it out indirectly. | ||
| 526 | */ | ||
| 527 | edev = list_first_entry(&pe->edevs, | ||
| 528 | struct eeh_dev, list); | ||
| 529 | dev = eeh_dev_to_pci_dev(edev); | ||
| 530 | dev = dev->bus->self; | ||
| 531 | } else { | ||
| 532 | /* | ||
| 533 | * If it's bus PE, the parent PCI bus is already there | ||
| 534 | * and just pick it up. | ||
| 535 | */ | ||
| 536 | dev = pe->bus->self; | ||
| 537 | } | ||
| 538 | |||
| 539 | /* | ||
| 540 | * Do reset based on the fact that the direct upstream bridge | ||
| 541 | * is root bridge (port) or not. | ||
| 542 | */ | ||
| 543 | if (dev->bus->number == 0) | ||
| 544 | ret = ioda_eeh_root_reset(hose, option); | 524 | ret = ioda_eeh_root_reset(hose, option); |
| 545 | else | 525 | else |
| 546 | ret = ioda_eeh_bridge_reset(hose, dev, option); | 526 | ret = ioda_eeh_bridge_reset(hose, bus->self, option); |
| 547 | } | 527 | } |
| 548 | 528 | ||
| 549 | return ret; | 529 | return ret; |
diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c index a79fddc5e74e..a59788e83b8b 100644 --- a/arch/powerpc/platforms/powernv/eeh-powernv.c +++ b/arch/powerpc/platforms/powernv/eeh-powernv.c | |||
| @@ -145,7 +145,7 @@ static int powernv_eeh_dev_probe(struct pci_dev *dev, void *flag) | |||
| 145 | * Enable EEH explicitly so that we will do EEH check | 145 | * Enable EEH explicitly so that we will do EEH check |
| 146 | * while accessing I/O stuff | 146 | * while accessing I/O stuff |
| 147 | */ | 147 | */ |
| 148 | eeh_subsystem_enabled = 1; | 148 | eeh_set_enable(true); |
| 149 | 149 | ||
| 150 | /* Save memory bars */ | 150 | /* Save memory bars */ |
| 151 | eeh_save_bars(edev); | 151 | eeh_save_bars(edev); |
diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c index 9ef3cc8ebc11..8a8f0472d98f 100644 --- a/arch/powerpc/platforms/pseries/eeh_pseries.c +++ b/arch/powerpc/platforms/pseries/eeh_pseries.c | |||
| @@ -265,7 +265,7 @@ static void *pseries_eeh_of_probe(struct device_node *dn, void *flag) | |||
| 265 | enable = 1; | 265 | enable = 1; |
| 266 | 266 | ||
| 267 | if (enable) { | 267 | if (enable) { |
| 268 | eeh_subsystem_enabled = 1; | 268 | eeh_set_enable(true); |
| 269 | eeh_add_to_parent_pe(edev); | 269 | eeh_add_to_parent_pe(edev); |
| 270 | 270 | ||
| 271 | pr_debug("%s: EEH enabled on %s PHB#%d-PE#%x, config addr#%x\n", | 271 | pr_debug("%s: EEH enabled on %s PHB#%d-PE#%x, config addr#%x\n", |
diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c index 70670a2d9cf2..c413ec158ff5 100644 --- a/arch/powerpc/platforms/pseries/pci.c +++ b/arch/powerpc/platforms/pseries/pci.c | |||
| @@ -113,7 +113,8 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge) | |||
| 113 | { | 113 | { |
| 114 | struct device_node *dn, *pdn; | 114 | struct device_node *dn, *pdn; |
| 115 | struct pci_bus *bus; | 115 | struct pci_bus *bus; |
| 116 | const __be32 *pcie_link_speed_stats; | 116 | u32 pcie_link_speed_stats[2]; |
| 117 | int rc; | ||
| 117 | 118 | ||
| 118 | bus = bridge->bus; | 119 | bus = bridge->bus; |
| 119 | 120 | ||
| @@ -122,38 +123,45 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge) | |||
| 122 | return 0; | 123 | return 0; |
| 123 | 124 | ||
| 124 | for (pdn = dn; pdn != NULL; pdn = of_get_next_parent(pdn)) { | 125 | for (pdn = dn; pdn != NULL; pdn = of_get_next_parent(pdn)) { |
| 125 | pcie_link_speed_stats = of_get_property(pdn, | 126 | rc = of_property_read_u32_array(pdn, |
| 126 | "ibm,pcie-link-speed-stats", NULL); | 127 | "ibm,pcie-link-speed-stats", |
| 127 | if (pcie_link_speed_stats) | 128 | &pcie_link_speed_stats[0], 2); |
| 129 | if (!rc) | ||
| 128 | break; | 130 | break; |
| 129 | } | 131 | } |
| 130 | 132 | ||
| 131 | of_node_put(pdn); | 133 | of_node_put(pdn); |
| 132 | 134 | ||
| 133 | if (!pcie_link_speed_stats) { | 135 | if (rc) { |
| 134 | pr_err("no ibm,pcie-link-speed-stats property\n"); | 136 | pr_err("no ibm,pcie-link-speed-stats property\n"); |
| 135 | return 0; | 137 | return 0; |
| 136 | } | 138 | } |
| 137 | 139 | ||
| 138 | switch (be32_to_cpup(pcie_link_speed_stats)) { | 140 | switch (pcie_link_speed_stats[0]) { |
| 139 | case 0x01: | 141 | case 0x01: |
| 140 | bus->max_bus_speed = PCIE_SPEED_2_5GT; | 142 | bus->max_bus_speed = PCIE_SPEED_2_5GT; |
| 141 | break; | 143 | break; |
| 142 | case 0x02: | 144 | case 0x02: |
| 143 | bus->max_bus_speed = PCIE_SPEED_5_0GT; | 145 | bus->max_bus_speed = PCIE_SPEED_5_0GT; |
| 144 | break; | 146 | break; |
| 147 | case 0x04: | ||
| 148 | bus->max_bus_speed = PCIE_SPEED_8_0GT; | ||
| 149 | break; | ||
| 145 | default: | 150 | default: |
| 146 | bus->max_bus_speed = PCI_SPEED_UNKNOWN; | 151 | bus->max_bus_speed = PCI_SPEED_UNKNOWN; |
| 147 | break; | 152 | break; |
| 148 | } | 153 | } |
| 149 | 154 | ||
| 150 | switch (be32_to_cpup(pcie_link_speed_stats)) { | 155 | switch (pcie_link_speed_stats[1]) { |
| 151 | case 0x01: | 156 | case 0x01: |
| 152 | bus->cur_bus_speed = PCIE_SPEED_2_5GT; | 157 | bus->cur_bus_speed = PCIE_SPEED_2_5GT; |
| 153 | break; | 158 | break; |
| 154 | case 0x02: | 159 | case 0x02: |
| 155 | bus->cur_bus_speed = PCIE_SPEED_5_0GT; | 160 | bus->cur_bus_speed = PCIE_SPEED_5_0GT; |
| 156 | break; | 161 | break; |
| 162 | case 0x04: | ||
| 163 | bus->cur_bus_speed = PCIE_SPEED_8_0GT; | ||
| 164 | break; | ||
| 157 | default: | 165 | default: |
| 158 | bus->cur_bus_speed = PCI_SPEED_UNKNOWN; | 166 | bus->cur_bus_speed = PCI_SPEED_UNKNOWN; |
| 159 | break; | 167 | break; |
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index c51efdcd07a2..7d8b7e94b93b 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
| @@ -27,7 +27,7 @@ config SPARC | |||
| 27 | select RTC_DRV_M48T59 | 27 | select RTC_DRV_M48T59 |
| 28 | select HAVE_DMA_ATTRS | 28 | select HAVE_DMA_ATTRS |
| 29 | select HAVE_DMA_API_DEBUG | 29 | select HAVE_DMA_API_DEBUG |
| 30 | select HAVE_ARCH_JUMP_LABEL | 30 | select HAVE_ARCH_JUMP_LABEL if SPARC64 |
| 31 | select GENERIC_IRQ_SHOW | 31 | select GENERIC_IRQ_SHOW |
| 32 | select ARCH_WANT_IPC_PARSE_VERSION | 32 | select ARCH_WANT_IPC_PARSE_VERSION |
| 33 | select GENERIC_PCI_IOMAP | 33 | select GENERIC_PCI_IOMAP |
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index 869023abe5a4..cfbe53c17b0d 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/pagemap.h> | 14 | #include <linux/pagemap.h> |
| 15 | #include <linux/vmalloc.h> | 15 | #include <linux/vmalloc.h> |
| 16 | #include <linux/kdebug.h> | 16 | #include <linux/kdebug.h> |
| 17 | #include <linux/export.h> | ||
| 17 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
| 18 | #include <linux/init.h> | 19 | #include <linux/init.h> |
| 19 | #include <linux/log2.h> | 20 | #include <linux/log2.h> |
| @@ -62,6 +63,7 @@ extern unsigned long last_valid_pfn; | |||
| 62 | static pgd_t *srmmu_swapper_pg_dir; | 63 | static pgd_t *srmmu_swapper_pg_dir; |
| 63 | 64 | ||
| 64 | const struct sparc32_cachetlb_ops *sparc32_cachetlb_ops; | 65 | const struct sparc32_cachetlb_ops *sparc32_cachetlb_ops; |
| 66 | EXPORT_SYMBOL(sparc32_cachetlb_ops); | ||
| 65 | 67 | ||
| 66 | #ifdef CONFIG_SMP | 68 | #ifdef CONFIG_SMP |
| 67 | const struct sparc32_cachetlb_ops *local_ops; | 69 | const struct sparc32_cachetlb_ops *local_ops; |
diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h index 57ae63cd6ee2..94605c0e9cee 100644 --- a/arch/x86/include/asm/tsc.h +++ b/arch/x86/include/asm/tsc.h | |||
| @@ -66,6 +66,6 @@ extern void tsc_save_sched_clock_state(void); | |||
| 66 | extern void tsc_restore_sched_clock_state(void); | 66 | extern void tsc_restore_sched_clock_state(void); |
| 67 | 67 | ||
| 68 | /* MSR based TSC calibration for Intel Atom SoC platforms */ | 68 | /* MSR based TSC calibration for Intel Atom SoC platforms */ |
| 69 | int try_msr_calibrate_tsc(unsigned long *fast_calibrate); | 69 | unsigned long try_msr_calibrate_tsc(void); |
| 70 | 70 | ||
| 71 | #endif /* _ASM_X86_TSC_H */ | 71 | #endif /* _ASM_X86_TSC_H */ |
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index b88645191fe5..895604f2e916 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
| @@ -1521,6 +1521,8 @@ static int __init init_hw_perf_events(void) | |||
| 1521 | 1521 | ||
| 1522 | pr_cont("%s PMU driver.\n", x86_pmu.name); | 1522 | pr_cont("%s PMU driver.\n", x86_pmu.name); |
| 1523 | 1523 | ||
| 1524 | x86_pmu.attr_rdpmc = 1; /* enable userspace RDPMC usage by default */ | ||
| 1525 | |||
| 1524 | for (quirk = x86_pmu.quirks; quirk; quirk = quirk->next) | 1526 | for (quirk = x86_pmu.quirks; quirk; quirk = quirk->next) |
| 1525 | quirk->func(); | 1527 | quirk->func(); |
| 1526 | 1528 | ||
| @@ -1534,7 +1536,6 @@ static int __init init_hw_perf_events(void) | |||
| 1534 | __EVENT_CONSTRAINT(0, (1ULL << x86_pmu.num_counters) - 1, | 1536 | __EVENT_CONSTRAINT(0, (1ULL << x86_pmu.num_counters) - 1, |
| 1535 | 0, x86_pmu.num_counters, 0, 0); | 1537 | 0, x86_pmu.num_counters, 0, 0); |
| 1536 | 1538 | ||
| 1537 | x86_pmu.attr_rdpmc = 1; /* enable userspace RDPMC usage by default */ | ||
| 1538 | x86_pmu_format_group.attrs = x86_pmu.format_attrs; | 1539 | x86_pmu_format_group.attrs = x86_pmu.format_attrs; |
| 1539 | 1540 | ||
| 1540 | if (x86_pmu.event_attrs) | 1541 | if (x86_pmu.event_attrs) |
| @@ -1820,9 +1821,12 @@ static ssize_t set_attr_rdpmc(struct device *cdev, | |||
| 1820 | if (ret) | 1821 | if (ret) |
| 1821 | return ret; | 1822 | return ret; |
| 1822 | 1823 | ||
| 1824 | if (x86_pmu.attr_rdpmc_broken) | ||
| 1825 | return -ENOTSUPP; | ||
| 1826 | |||
| 1823 | if (!!val != !!x86_pmu.attr_rdpmc) { | 1827 | if (!!val != !!x86_pmu.attr_rdpmc) { |
| 1824 | x86_pmu.attr_rdpmc = !!val; | 1828 | x86_pmu.attr_rdpmc = !!val; |
| 1825 | smp_call_function(change_rdpmc, (void *)val, 1); | 1829 | on_each_cpu(change_rdpmc, (void *)val, 1); |
| 1826 | } | 1830 | } |
| 1827 | 1831 | ||
| 1828 | return count; | 1832 | return count; |
diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h index c1a861829d81..4972c244d0bc 100644 --- a/arch/x86/kernel/cpu/perf_event.h +++ b/arch/x86/kernel/cpu/perf_event.h | |||
| @@ -409,6 +409,7 @@ struct x86_pmu { | |||
| 409 | /* | 409 | /* |
| 410 | * sysfs attrs | 410 | * sysfs attrs |
| 411 | */ | 411 | */ |
| 412 | int attr_rdpmc_broken; | ||
| 412 | int attr_rdpmc; | 413 | int attr_rdpmc; |
| 413 | struct attribute **format_attrs; | 414 | struct attribute **format_attrs; |
| 414 | struct attribute **event_attrs; | 415 | struct attribute **event_attrs; |
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c index 0fa4f242f050..aa333d966886 100644 --- a/arch/x86/kernel/cpu/perf_event_intel.c +++ b/arch/x86/kernel/cpu/perf_event_intel.c | |||
| @@ -1361,10 +1361,8 @@ static int intel_pmu_handle_irq(struct pt_regs *regs) | |||
| 1361 | intel_pmu_disable_all(); | 1361 | intel_pmu_disable_all(); |
| 1362 | handled = intel_pmu_drain_bts_buffer(); | 1362 | handled = intel_pmu_drain_bts_buffer(); |
| 1363 | status = intel_pmu_get_status(); | 1363 | status = intel_pmu_get_status(); |
| 1364 | if (!status) { | 1364 | if (!status) |
| 1365 | intel_pmu_enable_all(0); | 1365 | goto done; |
| 1366 | return handled; | ||
| 1367 | } | ||
| 1368 | 1366 | ||
| 1369 | loops = 0; | 1367 | loops = 0; |
| 1370 | again: | 1368 | again: |
| @@ -2310,10 +2308,7 @@ __init int intel_pmu_init(void) | |||
| 2310 | if (version > 1) | 2308 | if (version > 1) |
| 2311 | x86_pmu.num_counters_fixed = max((int)edx.split.num_counters_fixed, 3); | 2309 | x86_pmu.num_counters_fixed = max((int)edx.split.num_counters_fixed, 3); |
| 2312 | 2310 | ||
| 2313 | /* | 2311 | if (boot_cpu_has(X86_FEATURE_PDCM)) { |
| 2314 | * v2 and above have a perf capabilities MSR | ||
| 2315 | */ | ||
| 2316 | if (version > 1) { | ||
| 2317 | u64 capabilities; | 2312 | u64 capabilities; |
| 2318 | 2313 | ||
| 2319 | rdmsrl(MSR_IA32_PERF_CAPABILITIES, capabilities); | 2314 | rdmsrl(MSR_IA32_PERF_CAPABILITIES, capabilities); |
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c index 29c248799ced..c88f7f4b03ee 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c | |||
| @@ -501,8 +501,11 @@ static struct extra_reg snbep_uncore_cbox_extra_regs[] = { | |||
| 501 | SNBEP_CBO_EVENT_EXTRA_REG(SNBEP_CBO_PMON_CTL_TID_EN, | 501 | SNBEP_CBO_EVENT_EXTRA_REG(SNBEP_CBO_PMON_CTL_TID_EN, |
| 502 | SNBEP_CBO_PMON_CTL_TID_EN, 0x1), | 502 | SNBEP_CBO_PMON_CTL_TID_EN, 0x1), |
| 503 | SNBEP_CBO_EVENT_EXTRA_REG(0x0334, 0xffff, 0x4), | 503 | SNBEP_CBO_EVENT_EXTRA_REG(0x0334, 0xffff, 0x4), |
| 504 | SNBEP_CBO_EVENT_EXTRA_REG(0x4334, 0xffff, 0x6), | ||
| 504 | SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0xffff, 0x4), | 505 | SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0xffff, 0x4), |
| 506 | SNBEP_CBO_EVENT_EXTRA_REG(0x4534, 0xffff, 0x6), | ||
| 505 | SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0xffff, 0x4), | 507 | SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0xffff, 0x4), |
| 508 | SNBEP_CBO_EVENT_EXTRA_REG(0x4934, 0xffff, 0x6), | ||
| 506 | SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0x6), | 509 | SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0x6), |
| 507 | SNBEP_CBO_EVENT_EXTRA_REG(0x0135, 0xffff, 0x8), | 510 | SNBEP_CBO_EVENT_EXTRA_REG(0x0135, 0xffff, 0x8), |
| 508 | SNBEP_CBO_EVENT_EXTRA_REG(0x0335, 0xffff, 0x8), | 511 | SNBEP_CBO_EVENT_EXTRA_REG(0x0335, 0xffff, 0x8), |
| @@ -1178,10 +1181,15 @@ static struct extra_reg ivt_uncore_cbox_extra_regs[] = { | |||
| 1178 | SNBEP_CBO_EVENT_EXTRA_REG(SNBEP_CBO_PMON_CTL_TID_EN, | 1181 | SNBEP_CBO_EVENT_EXTRA_REG(SNBEP_CBO_PMON_CTL_TID_EN, |
| 1179 | SNBEP_CBO_PMON_CTL_TID_EN, 0x1), | 1182 | SNBEP_CBO_PMON_CTL_TID_EN, 0x1), |
| 1180 | SNBEP_CBO_EVENT_EXTRA_REG(0x1031, 0x10ff, 0x2), | 1183 | SNBEP_CBO_EVENT_EXTRA_REG(0x1031, 0x10ff, 0x2), |
| 1184 | SNBEP_CBO_EVENT_EXTRA_REG(0x1134, 0xffff, 0x4), | ||
| 1185 | SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0xc), | ||
| 1186 | SNBEP_CBO_EVENT_EXTRA_REG(0x5134, 0xffff, 0xc), | ||
| 1181 | SNBEP_CBO_EVENT_EXTRA_REG(0x0334, 0xffff, 0x4), | 1187 | SNBEP_CBO_EVENT_EXTRA_REG(0x0334, 0xffff, 0x4), |
| 1188 | SNBEP_CBO_EVENT_EXTRA_REG(0x4334, 0xffff, 0xc), | ||
| 1182 | SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0xffff, 0x4), | 1189 | SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0xffff, 0x4), |
| 1190 | SNBEP_CBO_EVENT_EXTRA_REG(0x4534, 0xffff, 0xc), | ||
| 1183 | SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0xffff, 0x4), | 1191 | SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0xffff, 0x4), |
| 1184 | SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0xc), | 1192 | SNBEP_CBO_EVENT_EXTRA_REG(0x4934, 0xffff, 0xc), |
| 1185 | SNBEP_CBO_EVENT_EXTRA_REG(0x0135, 0xffff, 0x10), | 1193 | SNBEP_CBO_EVENT_EXTRA_REG(0x0135, 0xffff, 0x10), |
| 1186 | SNBEP_CBO_EVENT_EXTRA_REG(0x0335, 0xffff, 0x10), | 1194 | SNBEP_CBO_EVENT_EXTRA_REG(0x0335, 0xffff, 0x10), |
| 1187 | SNBEP_CBO_EVENT_EXTRA_REG(0x2135, 0xffff, 0x10), | 1195 | SNBEP_CBO_EVENT_EXTRA_REG(0x2135, 0xffff, 0x10), |
diff --git a/arch/x86/kernel/cpu/perf_event_p6.c b/arch/x86/kernel/cpu/perf_event_p6.c index b1e2fe115323..7c1a0c07b607 100644 --- a/arch/x86/kernel/cpu/perf_event_p6.c +++ b/arch/x86/kernel/cpu/perf_event_p6.c | |||
| @@ -231,31 +231,49 @@ static __initconst const struct x86_pmu p6_pmu = { | |||
| 231 | 231 | ||
| 232 | }; | 232 | }; |
| 233 | 233 | ||
| 234 | static __init void p6_pmu_rdpmc_quirk(void) | ||
| 235 | { | ||
| 236 | if (boot_cpu_data.x86_mask < 9) { | ||
| 237 | /* | ||
| 238 | * PPro erratum 26; fixed in stepping 9 and above. | ||
| 239 | */ | ||
| 240 | pr_warn("Userspace RDPMC support disabled due to a CPU erratum\n"); | ||
| 241 | x86_pmu.attr_rdpmc_broken = 1; | ||
| 242 | x86_pmu.attr_rdpmc = 0; | ||
| 243 | } | ||
| 244 | } | ||
| 245 | |||
| 234 | __init int p6_pmu_init(void) | 246 | __init int p6_pmu_init(void) |
| 235 | { | 247 | { |
| 248 | x86_pmu = p6_pmu; | ||
| 249 | |||
| 236 | switch (boot_cpu_data.x86_model) { | 250 | switch (boot_cpu_data.x86_model) { |
| 237 | case 1: | 251 | case 1: /* Pentium Pro */ |
| 238 | case 3: /* Pentium Pro */ | 252 | x86_add_quirk(p6_pmu_rdpmc_quirk); |
| 239 | case 5: | 253 | break; |
| 240 | case 6: /* Pentium II */ | 254 | |
| 241 | case 7: | 255 | case 3: /* Pentium II - Klamath */ |
| 242 | case 8: | 256 | case 5: /* Pentium II - Deschutes */ |
| 243 | case 11: /* Pentium III */ | 257 | case 6: /* Pentium II - Mendocino */ |
| 244 | case 9: | ||
| 245 | case 13: | ||
| 246 | /* Pentium M */ | ||
| 247 | break; | 258 | break; |
| 259 | |||
| 260 | case 7: /* Pentium III - Katmai */ | ||
| 261 | case 8: /* Pentium III - Coppermine */ | ||
| 262 | case 10: /* Pentium III Xeon */ | ||
| 263 | case 11: /* Pentium III - Tualatin */ | ||
| 264 | break; | ||
| 265 | |||
| 266 | case 9: /* Pentium M - Banias */ | ||
| 267 | case 13: /* Pentium M - Dothan */ | ||
| 268 | break; | ||
| 269 | |||
| 248 | default: | 270 | default: |
| 249 | pr_cont("unsupported p6 CPU model %d ", | 271 | pr_cont("unsupported p6 CPU model %d ", boot_cpu_data.x86_model); |
| 250 | boot_cpu_data.x86_model); | ||
| 251 | return -ENODEV; | 272 | return -ENODEV; |
| 252 | } | 273 | } |
| 253 | 274 | ||
| 254 | x86_pmu = p6_pmu; | ||
| 255 | |||
| 256 | memcpy(hw_cache_event_ids, p6_hw_cache_event_ids, | 275 | memcpy(hw_cache_event_ids, p6_hw_cache_event_ids, |
| 257 | sizeof(hw_cache_event_ids)); | 276 | sizeof(hw_cache_event_ids)); |
| 258 | 277 | ||
| 259 | |||
| 260 | return 0; | 278 | return 0; |
| 261 | } | 279 | } |
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index 872079a67e4d..f7d0672481fd 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c | |||
| @@ -100,8 +100,10 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size, | |||
| 100 | flag |= __GFP_ZERO; | 100 | flag |= __GFP_ZERO; |
| 101 | again: | 101 | again: |
| 102 | page = NULL; | 102 | page = NULL; |
| 103 | if (!(flag & GFP_ATOMIC)) | 103 | /* CMA can be used only in the context which permits sleeping */ |
| 104 | if (flag & __GFP_WAIT) | ||
| 104 | page = dma_alloc_from_contiguous(dev, count, get_order(size)); | 105 | page = dma_alloc_from_contiguous(dev, count, get_order(size)); |
| 106 | /* fallback */ | ||
| 105 | if (!page) | 107 | if (!page) |
| 106 | page = alloc_pages_node(dev_to_node(dev), flag, get_order(size)); | 108 | page = alloc_pages_node(dev_to_node(dev), flag, get_order(size)); |
| 107 | if (!page) | 109 | if (!page) |
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index acb3b606613e..cfbe99f88830 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c | |||
| @@ -653,13 +653,10 @@ unsigned long native_calibrate_tsc(void) | |||
| 653 | 653 | ||
| 654 | /* Calibrate TSC using MSR for Intel Atom SoCs */ | 654 | /* Calibrate TSC using MSR for Intel Atom SoCs */ |
| 655 | local_irq_save(flags); | 655 | local_irq_save(flags); |
| 656 | i = try_msr_calibrate_tsc(&fast_calibrate); | 656 | fast_calibrate = try_msr_calibrate_tsc(); |
| 657 | local_irq_restore(flags); | 657 | local_irq_restore(flags); |
| 658 | if (i >= 0) { | 658 | if (fast_calibrate) |
| 659 | if (i == 0) | ||
| 660 | pr_warn("Fast TSC calibration using MSR failed\n"); | ||
| 661 | return fast_calibrate; | 659 | return fast_calibrate; |
| 662 | } | ||
| 663 | 660 | ||
| 664 | local_irq_save(flags); | 661 | local_irq_save(flags); |
| 665 | fast_calibrate = quick_pit_calibrate(); | 662 | fast_calibrate = quick_pit_calibrate(); |
diff --git a/arch/x86/kernel/tsc_msr.c b/arch/x86/kernel/tsc_msr.c index 8b5434f4389f..92ae6acac8a7 100644 --- a/arch/x86/kernel/tsc_msr.c +++ b/arch/x86/kernel/tsc_msr.c | |||
| @@ -53,7 +53,7 @@ static struct freq_desc freq_desc_tables[] = { | |||
| 53 | /* TNG */ | 53 | /* TNG */ |
| 54 | { 6, 0x4a, 1, { 0, FREQ_100, FREQ_133, 0, 0, 0, 0, 0 } }, | 54 | { 6, 0x4a, 1, { 0, FREQ_100, FREQ_133, 0, 0, 0, 0, 0 } }, |
| 55 | /* VLV2 */ | 55 | /* VLV2 */ |
| 56 | { 6, 0x37, 1, { 0, FREQ_100, FREQ_133, FREQ_166, 0, 0, 0, 0 } }, | 56 | { 6, 0x37, 1, { FREQ_83, FREQ_100, FREQ_133, FREQ_166, 0, 0, 0, 0 } }, |
| 57 | /* ANN */ | 57 | /* ANN */ |
| 58 | { 6, 0x5a, 1, { FREQ_83, FREQ_100, FREQ_133, FREQ_100, 0, 0, 0, 0 } }, | 58 | { 6, 0x5a, 1, { FREQ_83, FREQ_100, FREQ_133, FREQ_100, 0, 0, 0, 0 } }, |
| 59 | }; | 59 | }; |
| @@ -77,21 +77,18 @@ static int match_cpu(u8 family, u8 model) | |||
| 77 | 77 | ||
| 78 | /* | 78 | /* |
| 79 | * Do MSR calibration only for known/supported CPUs. | 79 | * Do MSR calibration only for known/supported CPUs. |
| 80 | * Return values: | 80 | * |
| 81 | * -1: CPU is unknown/unsupported for MSR based calibration | 81 | * Returns the calibration value or 0 if MSR calibration failed. |
| 82 | * 0: CPU is known/supported, but calibration failed | ||
| 83 | * 1: CPU is known/supported, and calibration succeeded | ||
| 84 | */ | 82 | */ |
| 85 | int try_msr_calibrate_tsc(unsigned long *fast_calibrate) | 83 | unsigned long try_msr_calibrate_tsc(void) |
| 86 | { | 84 | { |
| 87 | int cpu_index; | ||
| 88 | u32 lo, hi, ratio, freq_id, freq; | 85 | u32 lo, hi, ratio, freq_id, freq; |
| 86 | unsigned long res; | ||
| 87 | int cpu_index; | ||
| 89 | 88 | ||
| 90 | cpu_index = match_cpu(boot_cpu_data.x86, boot_cpu_data.x86_model); | 89 | cpu_index = match_cpu(boot_cpu_data.x86, boot_cpu_data.x86_model); |
| 91 | if (cpu_index < 0) | 90 | if (cpu_index < 0) |
| 92 | return -1; | 91 | return 0; |
| 93 | |||
| 94 | *fast_calibrate = 0; | ||
| 95 | 92 | ||
| 96 | if (freq_desc_tables[cpu_index].msr_plat) { | 93 | if (freq_desc_tables[cpu_index].msr_plat) { |
| 97 | rdmsr(MSR_PLATFORM_INFO, lo, hi); | 94 | rdmsr(MSR_PLATFORM_INFO, lo, hi); |
| @@ -103,7 +100,7 @@ int try_msr_calibrate_tsc(unsigned long *fast_calibrate) | |||
| 103 | pr_info("Maximum core-clock to bus-clock ratio: 0x%x\n", ratio); | 100 | pr_info("Maximum core-clock to bus-clock ratio: 0x%x\n", ratio); |
| 104 | 101 | ||
| 105 | if (!ratio) | 102 | if (!ratio) |
| 106 | return 0; | 103 | goto fail; |
| 107 | 104 | ||
| 108 | /* Get FSB FREQ ID */ | 105 | /* Get FSB FREQ ID */ |
| 109 | rdmsr(MSR_FSB_FREQ, lo, hi); | 106 | rdmsr(MSR_FSB_FREQ, lo, hi); |
| @@ -112,16 +109,19 @@ int try_msr_calibrate_tsc(unsigned long *fast_calibrate) | |||
| 112 | pr_info("Resolved frequency ID: %u, frequency: %u KHz\n", | 109 | pr_info("Resolved frequency ID: %u, frequency: %u KHz\n", |
| 113 | freq_id, freq); | 110 | freq_id, freq); |
| 114 | if (!freq) | 111 | if (!freq) |
| 115 | return 0; | 112 | goto fail; |
| 116 | 113 | ||
| 117 | /* TSC frequency = maximum resolved freq * maximum resolved bus ratio */ | 114 | /* TSC frequency = maximum resolved freq * maximum resolved bus ratio */ |
| 118 | *fast_calibrate = freq * ratio; | 115 | res = freq * ratio; |
| 119 | pr_info("TSC runs at %lu KHz\n", *fast_calibrate); | 116 | pr_info("TSC runs at %lu KHz\n", res); |
| 120 | 117 | ||
| 121 | #ifdef CONFIG_X86_LOCAL_APIC | 118 | #ifdef CONFIG_X86_LOCAL_APIC |
| 122 | lapic_timer_frequency = (freq * 1000) / HZ; | 119 | lapic_timer_frequency = (freq * 1000) / HZ; |
| 123 | pr_info("lapic_timer_frequency = %d\n", lapic_timer_frequency); | 120 | pr_info("lapic_timer_frequency = %d\n", lapic_timer_frequency); |
| 124 | #endif | 121 | #endif |
| 122 | return res; | ||
| 125 | 123 | ||
| 126 | return 1; | 124 | fail: |
| 125 | pr_warn("Fast TSC calibration using MSR failed\n"); | ||
| 126 | return 0; | ||
| 127 | } | 127 | } |
