* two alpha dma cleanups/fixes
@ 2018-05-09 14:04 ` Christoph Hellwig
0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2018-05-09 14:04 UTC (permalink / raw)
To: ink-biIs/Y0ymYJMZLIVYojuPNP0rXTJTi09, mattst88-Re5JQEeQqe8AvxtiuMwx3w
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
linux-alpha-u79uwXL29TY76Z2rM5mHXA
jenses appears to be broken, but patch 1 might unbreak it while getting
rid of a dma_map_ops instance (which іs my real goal here), patch two
just cleans up the dma boilerplate code a bit.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 4+ messages in thread
* two alpha dma cleanups/fixes
@ 2018-05-09 14:04 ` Christoph Hellwig
0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2018-05-09 14:04 UTC (permalink / raw)
To: ink-biIs/Y0ymYJMZLIVYojuPNP0rXTJTi09, mattst88-Re5JQEeQqe8AvxtiuMwx3w
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
linux-alpha-u79uwXL29TY76Z2rM5mHXA
jenses appears to be broken, but patch 1 might unbreak it while getting
rid of a dma_map_ops instance (which Ñ–s my real goal here), patch two
just cleans up the dma boilerplate code a bit.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] alpha: use dma_direct_ops for jensen
[not found] ` <20180509140452.20716-1-hch-jcswGhMUV9g@public.gmane.org>
@ 2018-05-09 14:04 ` Christoph Hellwig
2018-05-09 14:04 ` [PATCH 2/2] alpha: simplify get_arch_dma_ops Christoph Hellwig
1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2018-05-09 14:04 UTC (permalink / raw)
To: ink-biIs/Y0ymYJMZLIVYojuPNP0rXTJTi09, mattst88-Re5JQEeQqe8AvxtiuMwx3w
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
linux-alpha-u79uwXL29TY76Z2rM5mHXA
The generic dma_direct implementation does the same thing as the alpha
pci-noop implementation, just with more bells and whistles. And unlike
the current code it at least has a theoretical chance to actually compile.
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
arch/alpha/Kconfig | 1 +
arch/alpha/include/asm/dma-mapping.h | 4 ++++
arch/alpha/kernel/pci-noop.c | 33 ----------------------------
3 files changed, 5 insertions(+), 33 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
config ALPHA_JENSEN
bool "Jensen"
depends on BROKEN
+ select DMA_DIRECT_OPS
help
DEC PC 150 AXP (aka Jensen): This is a very old Digital system - one
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..76ce923ecca1 100644
--- a/arch/alpha/include/asm/dma-mapping.h
+++ b/arch/alpha/include/asm/dma-mapping.h
@@ -6,7 +6,11 @@ extern const struct dma_map_ops *dma_ops;
static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
{
+#ifdef CONFIG_ALPHA_JENSEN
+ return &dma_direct_ops;
+#else
return dma_ops;
+#endif
}
#endif /* _ALPHA_DMA_MAPPING_H */
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,
else
return -ENODEV;
}
-
-static void *alpha_noop_alloc_coherent(struct device *dev, size_t size,
- dma_addr_t *dma_handle, gfp_t gfp,
- unsigned long attrs)
-{
- void *ret;
-
- if (!dev || *dev->dma_mask >= 0xffffffffUL)
- gfp &= ~GFP_DMA;
- ret = (void *)__get_free_pages(gfp, get_order(size));
- if (ret) {
- memset(ret, 0, size);
- *dma_handle = virt_to_phys(ret);
- }
- return ret;
-}
-
-static int alpha_noop_supported(struct device *dev, u64 mask)
-{
- return mask < 0x00ffffffUL ? 0 : 1;
-}
-
-const struct dma_map_ops alpha_noop_ops = {
- .alloc = alpha_noop_alloc_coherent,
- .free = dma_noop_free_coherent,
- .map_page = dma_noop_map_page,
- .map_sg = dma_noop_map_sg,
- .mapping_error = dma_noop_mapping_error,
- .dma_supported = alpha_noop_supported,
-};
-
-const struct dma_map_ops *dma_ops = &alpha_noop_ops;
-EXPORT_SYMBOL(dma_ops);
--
2.17.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] alpha: simplify get_arch_dma_ops
[not found] ` <20180509140452.20716-1-hch-jcswGhMUV9g@public.gmane.org>
2018-05-09 14:04 ` [PATCH 1/2] alpha: use dma_direct_ops for jensen Christoph Hellwig
@ 2018-05-09 14:04 ` Christoph Hellwig
1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2018-05-09 14:04 UTC (permalink / raw)
To: ink-biIs/Y0ymYJMZLIVYojuPNP0rXTJTi09, mattst88-Re5JQEeQqe8AvxtiuMwx3w
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
linux-alpha-u79uwXL29TY76Z2rM5mHXA
Remove the dma_ops indirection.
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
arch/alpha/include/asm/dma-mapping.h | 4 ++--
arch/alpha/kernel/pci_iommu.c | 4 +---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/alpha/include/asm/dma-mapping.h b/arch/alpha/include/asm/dma-mapping.h
index 76ce923ecca1..8beeafd4f68e 100644
--- a/arch/alpha/include/asm/dma-mapping.h
+++ b/arch/alpha/include/asm/dma-mapping.h
@@ -2,14 +2,14 @@
#ifndef _ALPHA_DMA_MAPPING_H
#define _ALPHA_DMA_MAPPING_H
-extern const struct dma_map_ops *dma_ops;
+extern const struct dma_map_ops alpha_pci_ops;
static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
{
#ifdef CONFIG_ALPHA_JENSEN
return &dma_direct_ops;
#else
- return dma_ops;
+ return &alpha_pci_ops;
#endif
}
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 = {
.mapping_error = alpha_pci_mapping_error,
.dma_supported = alpha_pci_supported,
};
-
-const struct dma_map_ops *dma_ops = &alpha_pci_ops;
-EXPORT_SYMBOL(dma_ops);
+EXPORT_SYMBOL(alpha_pci_ops);
--
2.17.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-05-09 14:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-09 14:04 two alpha dma cleanups/fixes Christoph Hellwig
2018-05-09 14:04 ` Christoph Hellwig
[not found] ` <20180509140452.20716-1-hch-jcswGhMUV9g@public.gmane.org>
2018-05-09 14:04 ` [PATCH 1/2] alpha: use dma_direct_ops for jensen Christoph Hellwig
2018-05-09 14:04 ` [PATCH 2/2] alpha: simplify get_arch_dma_ops Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.