diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-05-23 11:18:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-05-23 11:18:33 -0400 |
commit | 9ce8654323d69273b4977f76f11c9e2d345ab130 (patch) | |
tree | 598a849fd4b1ccbf9809daba271a0255e33653b2 | |
parent | a048a07d7f4535baa4cbad6bc024f175317ab938 (diff) | |
parent | 92d7223a74235054f2aa7227d207d9c57f84dca0 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha
Pull alpha fixes from Matt Turner:
"A few small changes for alpha"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha:
alpha: io: reorder barriers to guarantee writeX() and iowriteX() ordering #2
alpha: simplify get_arch_dma_ops
alpha: use dma_direct_ops for jensen
-rw-r--r-- | arch/alpha/Kconfig | 1 | ||||
-rw-r--r-- | arch/alpha/include/asm/dma-mapping.h | 8 | ||||
-rw-r--r-- | arch/alpha/kernel/io.c | 14 | ||||
-rw-r--r-- | arch/alpha/kernel/pci-noop.c | 33 | ||||
-rw-r--r-- | arch/alpha/kernel/pci_iommu.c | 4 |
5 files changed, 15 insertions, 45 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index b2022885ced8..f19dc31288c8 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig | |||
@@ -211,6 +211,7 @@ config ALPHA_EIGER | |||
211 | config ALPHA_JENSEN | 211 | config ALPHA_JENSEN |
212 | bool "Jensen" | 212 | bool "Jensen" |
213 | depends on BROKEN | 213 | depends on BROKEN |
214 | select DMA_DIRECT_OPS | ||
214 | help | 215 | help |
215 | DEC PC 150 AXP (aka Jensen): This is a very old Digital system - one | 216 | DEC PC 150 AXP (aka Jensen): This is a very old Digital system - one |
216 | of the first-generation Alpha systems. A number of these systems | 217 | of the first-generation Alpha systems. A number of these systems |
diff --git a/arch/alpha/include/asm/dma-mapping.h b/arch/alpha/include/asm/dma-mapping.h index b78f61f20796..8beeafd4f68e 100644 --- a/arch/alpha/include/asm/dma-mapping.h +++ b/arch/alpha/include/asm/dma-mapping.h | |||
@@ -2,11 +2,15 @@ | |||
2 | #ifndef _ALPHA_DMA_MAPPING_H | 2 | #ifndef _ALPHA_DMA_MAPPING_H |
3 | #define _ALPHA_DMA_MAPPING_H | 3 | #define _ALPHA_DMA_MAPPING_H |
4 | 4 | ||
5 | extern const struct dma_map_ops *dma_ops; | 5 | extern const struct dma_map_ops alpha_pci_ops; |
6 | 6 | ||
7 | static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) | 7 | static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) |
8 | { | 8 | { |
9 | return dma_ops; | 9 | #ifdef CONFIG_ALPHA_JENSEN |
10 | return &dma_direct_ops; | ||
11 | #else | ||
12 | return &alpha_pci_ops; | ||
13 | #endif | ||
10 | } | 14 | } |
11 | 15 | ||
12 | #endif /* _ALPHA_DMA_MAPPING_H */ | 16 | #endif /* _ALPHA_DMA_MAPPING_H */ |
diff --git a/arch/alpha/kernel/io.c b/arch/alpha/kernel/io.c index 3e3d49c254c5..c025a3e5e357 100644 --- a/arch/alpha/kernel/io.c +++ b/arch/alpha/kernel/io.c | |||
@@ -37,20 +37,20 @@ unsigned int ioread32(void __iomem *addr) | |||
37 | 37 | ||
38 | void iowrite8(u8 b, void __iomem *addr) | 38 | void iowrite8(u8 b, void __iomem *addr) |
39 | { | 39 | { |
40 | IO_CONCAT(__IO_PREFIX,iowrite8)(b, addr); | ||
41 | mb(); | 40 | mb(); |
41 | IO_CONCAT(__IO_PREFIX,iowrite8)(b, addr); | ||
42 | } | 42 | } |
43 | 43 | ||
44 | void iowrite16(u16 b, void __iomem *addr) | 44 | void iowrite16(u16 b, void __iomem *addr) |
45 | { | 45 | { |
46 | IO_CONCAT(__IO_PREFIX,iowrite16)(b, addr); | ||
47 | mb(); | 46 | mb(); |
47 | IO_CONCAT(__IO_PREFIX,iowrite16)(b, addr); | ||
48 | } | 48 | } |
49 | 49 | ||
50 | void iowrite32(u32 b, void __iomem *addr) | 50 | void iowrite32(u32 b, void __iomem *addr) |
51 | { | 51 | { |
52 | IO_CONCAT(__IO_PREFIX,iowrite32)(b, addr); | ||
53 | mb(); | 52 | mb(); |
53 | IO_CONCAT(__IO_PREFIX,iowrite32)(b, addr); | ||
54 | } | 54 | } |
55 | 55 | ||
56 | EXPORT_SYMBOL(ioread8); | 56 | EXPORT_SYMBOL(ioread8); |
@@ -176,26 +176,26 @@ u64 readq(const volatile void __iomem *addr) | |||
176 | 176 | ||
177 | void writeb(u8 b, volatile void __iomem *addr) | 177 | void writeb(u8 b, volatile void __iomem *addr) |
178 | { | 178 | { |
179 | __raw_writeb(b, addr); | ||
180 | mb(); | 179 | mb(); |
180 | __raw_writeb(b, addr); | ||
181 | } | 181 | } |
182 | 182 | ||
183 | void writew(u16 b, volatile void __iomem *addr) | 183 | void writew(u16 b, volatile void __iomem *addr) |
184 | { | 184 | { |
185 | __raw_writew(b, addr); | ||
186 | mb(); | 185 | mb(); |
186 | __raw_writew(b, addr); | ||
187 | } | 187 | } |
188 | 188 | ||
189 | void writel(u32 b, volatile void __iomem *addr) | 189 | void writel(u32 b, volatile void __iomem *addr) |
190 | { | 190 | { |
191 | __raw_writel(b, addr); | ||
192 | mb(); | 191 | mb(); |
192 | __raw_writel(b, addr); | ||
193 | } | 193 | } |
194 | 194 | ||
195 | void writeq(u64 b, volatile void __iomem *addr) | 195 | void writeq(u64 b, volatile void __iomem *addr) |
196 | { | 196 | { |
197 | __raw_writeq(b, addr); | ||
198 | mb(); | 197 | mb(); |
198 | __raw_writeq(b, addr); | ||
199 | } | 199 | } |
200 | 200 | ||
201 | EXPORT_SYMBOL(readb); | 201 | EXPORT_SYMBOL(readb); |
diff --git a/arch/alpha/kernel/pci-noop.c b/arch/alpha/kernel/pci-noop.c index b6ebb65127a8..c7c5879869d3 100644 --- a/arch/alpha/kernel/pci-noop.c +++ b/arch/alpha/kernel/pci-noop.c | |||
@@ -102,36 +102,3 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn, | |||
102 | else | 102 | else |
103 | return -ENODEV; | 103 | return -ENODEV; |
104 | } | 104 | } |
105 | |||
106 | static void *alpha_noop_alloc_coherent(struct device *dev, size_t size, | ||
107 | dma_addr_t *dma_handle, gfp_t gfp, | ||
108 | unsigned long attrs) | ||
109 | { | ||
110 | void *ret; | ||
111 | |||
112 | if (!dev || *dev->dma_mask >= 0xffffffffUL) | ||
113 | gfp &= ~GFP_DMA; | ||
114 | ret = (void *)__get_free_pages(gfp, get_order(size)); | ||
115 | if (ret) { | ||
116 | memset(ret, 0, size); | ||
117 | *dma_handle = virt_to_phys(ret); | ||
118 | } | ||
119 | return ret; | ||
120 | } | ||
121 | |||
122 | static int alpha_noop_supported(struct device *dev, u64 mask) | ||
123 | { | ||
124 | return mask < 0x00ffffffUL ? 0 : 1; | ||
125 | } | ||
126 | |||
127 | const struct dma_map_ops alpha_noop_ops = { | ||
128 | .alloc = alpha_noop_alloc_coherent, | ||
129 | .free = dma_noop_free_coherent, | ||
130 | .map_page = dma_noop_map_page, | ||
131 | .map_sg = dma_noop_map_sg, | ||
132 | .mapping_error = dma_noop_mapping_error, | ||
133 | .dma_supported = alpha_noop_supported, | ||
134 | }; | ||
135 | |||
136 | const struct dma_map_ops *dma_ops = &alpha_noop_ops; | ||
137 | EXPORT_SYMBOL(dma_ops); | ||
diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c index 83b34b9188ea..6923b0d9c1e1 100644 --- a/arch/alpha/kernel/pci_iommu.c +++ b/arch/alpha/kernel/pci_iommu.c | |||
@@ -950,6 +950,4 @@ const struct dma_map_ops alpha_pci_ops = { | |||
950 | .mapping_error = alpha_pci_mapping_error, | 950 | .mapping_error = alpha_pci_mapping_error, |
951 | .dma_supported = alpha_pci_supported, | 951 | .dma_supported = alpha_pci_supported, |
952 | }; | 952 | }; |
953 | 953 | EXPORT_SYMBOL(alpha_pci_ops); | |
954 | const struct dma_map_ops *dma_ops = &alpha_pci_ops; | ||
955 | EXPORT_SYMBOL(dma_ops); | ||