Skip to content

Commit 9ce8654

Browse files
committed
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
2 parents a048a07 + 92d7223 commit 9ce8654

5 files changed

Lines changed: 15 additions & 45 deletions

File tree

arch/alpha/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ config ALPHA_EIGER
211211
config ALPHA_JENSEN
212212
bool "Jensen"
213213
depends on BROKEN
214+
select DMA_DIRECT_OPS
214215
help
215216
DEC PC 150 AXP (aka Jensen): This is a very old Digital system - one
216217
of the first-generation Alpha systems. A number of these systems

arch/alpha/include/asm/dma-mapping.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
#ifndef _ALPHA_DMA_MAPPING_H
33
#define _ALPHA_DMA_MAPPING_H
44

5-
extern const struct dma_map_ops *dma_ops;
5+
extern const struct dma_map_ops alpha_pci_ops;
66

77
static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
88
{
9-
return dma_ops;
9+
#ifdef CONFIG_ALPHA_JENSEN
10+
return &dma_direct_ops;
11+
#else
12+
return &alpha_pci_ops;
13+
#endif
1014
}
1115

1216
#endif /* _ALPHA_DMA_MAPPING_H */

arch/alpha/kernel/io.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,20 @@ unsigned int ioread32(void __iomem *addr)
3737

3838
void iowrite8(u8 b, void __iomem *addr)
3939
{
40-
IO_CONCAT(__IO_PREFIX,iowrite8)(b, addr);
4140
mb();
41+
IO_CONCAT(__IO_PREFIX,iowrite8)(b, addr);
4242
}
4343

4444
void iowrite16(u16 b, void __iomem *addr)
4545
{
46-
IO_CONCAT(__IO_PREFIX,iowrite16)(b, addr);
4746
mb();
47+
IO_CONCAT(__IO_PREFIX,iowrite16)(b, addr);
4848
}
4949

5050
void iowrite32(u32 b, void __iomem *addr)
5151
{
52-
IO_CONCAT(__IO_PREFIX,iowrite32)(b, addr);
5352
mb();
53+
IO_CONCAT(__IO_PREFIX,iowrite32)(b, addr);
5454
}
5555

5656
EXPORT_SYMBOL(ioread8);
@@ -176,26 +176,26 @@ u64 readq(const volatile void __iomem *addr)
176176

177177
void writeb(u8 b, volatile void __iomem *addr)
178178
{
179-
__raw_writeb(b, addr);
180179
mb();
180+
__raw_writeb(b, addr);
181181
}
182182

183183
void writew(u16 b, volatile void __iomem *addr)
184184
{
185-
__raw_writew(b, addr);
186185
mb();
186+
__raw_writew(b, addr);
187187
}
188188

189189
void writel(u32 b, volatile void __iomem *addr)
190190
{
191-
__raw_writel(b, addr);
192191
mb();
192+
__raw_writel(b, addr);
193193
}
194194

195195
void writeq(u64 b, volatile void __iomem *addr)
196196
{
197-
__raw_writeq(b, addr);
198197
mb();
198+
__raw_writeq(b, addr);
199199
}
200200

201201
EXPORT_SYMBOL(readb);

arch/alpha/kernel/pci-noop.c

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -102,36 +102,3 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn,
102102
else
103103
return -ENODEV;
104104
}
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);

arch/alpha/kernel/pci_iommu.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,4 @@ const struct dma_map_ops alpha_pci_ops = {
950950
.mapping_error = alpha_pci_mapping_error,
951951
.dma_supported = alpha_pci_supported,
952952
};
953-
954-
const struct dma_map_ops *dma_ops = &alpha_pci_ops;
955-
EXPORT_SYMBOL(dma_ops);
953+
EXPORT_SYMBOL(alpha_pci_ops);

0 commit comments

Comments
 (0)