aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-05-01 10:44:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-05-01 10:44:32 -0400
commit036f351e2566eaa5826581c8512dd55f6585ad01 (patch)
treea50de0e08a9379c0ed7cafc75acf55cec0bbdc47 /arch
parent4a152c3913fb46fc2e29081d0251862106c3d55f (diff)
parent8291fd04d86b97869bd34e796bcac3141b9d5432 (diff)
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Will Deacon: "Not too much here, but we've addressed a couple of nasty issues in the dma-mapping code as well as adding the halfword and byte variants of load_acquire/store_release following on from the CSD locking bug that you fixed in the core. - fix perf devicetree warnings at probe time - fix memory leak in __dma_free() - ensure DMA buffers are always zeroed - show IRQ trigger in /proc/interrupts (for parity with ARM) - implement byte and halfword access for smp_{load_acquire,store_release}" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: perf: Fix the pmu node name in warning message arm64: perf: don't warn about missing interrupt-affinity property for PPIs arm64: add missing PAGE_ALIGN() to __dma_free() arm64: dma-mapping: always clear allocated buffers ARM64: Enable CONFIG_GENERIC_IRQ_SHOW_LEVEL arm64: add missing data types in smp_load_acquire/smp_store_release
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/Kconfig1
-rw-r--r--arch/arm64/include/asm/barrier.h16
-rw-r--r--arch/arm64/kernel/perf_event.c9
-rw-r--r--arch/arm64/mm/dma-mapping.c9
4 files changed, 28 insertions, 7 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 4269dba63cf1..7796af4b1d6f 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -31,6 +31,7 @@ config ARM64
31 select GENERIC_EARLY_IOREMAP 31 select GENERIC_EARLY_IOREMAP
32 select GENERIC_IRQ_PROBE 32 select GENERIC_IRQ_PROBE
33 select GENERIC_IRQ_SHOW 33 select GENERIC_IRQ_SHOW
34 select GENERIC_IRQ_SHOW_LEVEL
34 select GENERIC_PCI_IOMAP 35 select GENERIC_PCI_IOMAP
35 select GENERIC_SCHED_CLOCK 36 select GENERIC_SCHED_CLOCK
36 select GENERIC_SMP_IDLE_THREAD 37 select GENERIC_SMP_IDLE_THREAD
diff --git a/arch/arm64/include/asm/barrier.h b/arch/arm64/include/asm/barrier.h
index a5abb0062d6e..71f19c4dc0de 100644
--- a/arch/arm64/include/asm/barrier.h
+++ b/arch/arm64/include/asm/barrier.h
@@ -65,6 +65,14 @@ do { \
65do { \ 65do { \
66 compiletime_assert_atomic_type(*p); \ 66 compiletime_assert_atomic_type(*p); \
67 switch (sizeof(*p)) { \ 67 switch (sizeof(*p)) { \
68 case 1: \
69 asm volatile ("stlrb %w1, %0" \
70 : "=Q" (*p) : "r" (v) : "memory"); \
71 break; \
72 case 2: \
73 asm volatile ("stlrh %w1, %0" \
74 : "=Q" (*p) : "r" (v) : "memory"); \
75 break; \
68 case 4: \ 76 case 4: \
69 asm volatile ("stlr %w1, %0" \ 77 asm volatile ("stlr %w1, %0" \
70 : "=Q" (*p) : "r" (v) : "memory"); \ 78 : "=Q" (*p) : "r" (v) : "memory"); \
@@ -81,6 +89,14 @@ do { \
81 typeof(*p) ___p1; \ 89 typeof(*p) ___p1; \
82 compiletime_assert_atomic_type(*p); \ 90 compiletime_assert_atomic_type(*p); \
83 switch (sizeof(*p)) { \ 91 switch (sizeof(*p)) { \
92 case 1: \
93 asm volatile ("ldarb %w0, %1" \
94 : "=r" (___p1) : "Q" (*p) : "memory"); \
95 break; \
96 case 2: \
97 asm volatile ("ldarh %w0, %1" \
98 : "=r" (___p1) : "Q" (*p) : "memory"); \
99 break; \
84 case 4: \ 100 case 4: \
85 asm volatile ("ldar %w0, %1" \ 101 asm volatile ("ldar %w0, %1" \
86 : "=r" (___p1) : "Q" (*p) : "memory"); \ 102 : "=r" (___p1) : "Q" (*p) : "memory"); \
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
index 195991dadc37..23f25acf43a9 100644
--- a/arch/arm64/kernel/perf_event.c
+++ b/arch/arm64/kernel/perf_event.c
@@ -1310,7 +1310,7 @@ static const struct of_device_id armpmu_of_device_ids[] = {
1310 1310
1311static int armpmu_device_probe(struct platform_device *pdev) 1311static int armpmu_device_probe(struct platform_device *pdev)
1312{ 1312{
1313 int i, *irqs; 1313 int i, irq, *irqs;
1314 1314
1315 if (!cpu_pmu) 1315 if (!cpu_pmu)
1316 return -ENODEV; 1316 return -ENODEV;
@@ -1319,6 +1319,11 @@ static int armpmu_device_probe(struct platform_device *pdev)
1319 if (!irqs) 1319 if (!irqs)
1320 return -ENOMEM; 1320 return -ENOMEM;
1321 1321
1322 /* Don't bother with PPIs; they're already affine */
1323 irq = platform_get_irq(pdev, 0);
1324 if (irq >= 0 && irq_is_percpu(irq))
1325 return 0;
1326
1322 for (i = 0; i < pdev->num_resources; ++i) { 1327 for (i = 0; i < pdev->num_resources; ++i) {
1323 struct device_node *dn; 1328 struct device_node *dn;
1324 int cpu; 1329 int cpu;
@@ -1327,7 +1332,7 @@ static int armpmu_device_probe(struct platform_device *pdev)
1327 i); 1332 i);
1328 if (!dn) { 1333 if (!dn) {
1329 pr_warn("Failed to parse %s/interrupt-affinity[%d]\n", 1334 pr_warn("Failed to parse %s/interrupt-affinity[%d]\n",
1330 of_node_full_name(dn), i); 1335 of_node_full_name(pdev->dev.of_node), i);
1331 break; 1336 break;
1332 } 1337 }
1333 1338
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
index ef7d112f5ce0..b0bd4e5fd5cf 100644
--- a/arch/arm64/mm/dma-mapping.c
+++ b/arch/arm64/mm/dma-mapping.c
@@ -67,8 +67,7 @@ static void *__alloc_from_pool(size_t size, struct page **ret_page, gfp_t flags)
67 67
68 *ret_page = phys_to_page(phys); 68 *ret_page = phys_to_page(phys);
69 ptr = (void *)val; 69 ptr = (void *)val;
70 if (flags & __GFP_ZERO) 70 memset(ptr, 0, size);
71 memset(ptr, 0, size);
72 } 71 }
73 72
74 return ptr; 73 return ptr;
@@ -105,7 +104,6 @@ static void *__dma_alloc_coherent(struct device *dev, size_t size,
105 struct page *page; 104 struct page *page;
106 void *addr; 105 void *addr;
107 106
108 size = PAGE_ALIGN(size);
109 page = dma_alloc_from_contiguous(dev, size >> PAGE_SHIFT, 107 page = dma_alloc_from_contiguous(dev, size >> PAGE_SHIFT,
110 get_order(size)); 108 get_order(size));
111 if (!page) 109 if (!page)
@@ -113,8 +111,7 @@ static void *__dma_alloc_coherent(struct device *dev, size_t size,
113 111
114 *dma_handle = phys_to_dma(dev, page_to_phys(page)); 112 *dma_handle = phys_to_dma(dev, page_to_phys(page));
115 addr = page_address(page); 113 addr = page_address(page);
116 if (flags & __GFP_ZERO) 114 memset(addr, 0, size);
117 memset(addr, 0, size);
118 return addr; 115 return addr;
119 } else { 116 } else {
120 return swiotlb_alloc_coherent(dev, size, dma_handle, flags); 117 return swiotlb_alloc_coherent(dev, size, dma_handle, flags);
@@ -195,6 +192,8 @@ static void __dma_free(struct device *dev, size_t size,
195{ 192{
196 void *swiotlb_addr = phys_to_virt(dma_to_phys(dev, dma_handle)); 193 void *swiotlb_addr = phys_to_virt(dma_to_phys(dev, dma_handle));
197 194
195 size = PAGE_ALIGN(size);
196
198 if (!is_device_dma_coherent(dev)) { 197 if (!is_device_dma_coherent(dev)) {
199 if (__free_from_pool(vaddr, size)) 198 if (__free_from_pool(vaddr, size))
200 return; 199 return;