linux-next: manual merge of the swiotlb tree with the powerpc tree

From: Stephen Rothwell
Date: Thu Feb 21 2019 - 19:36:30 EST


Hi all,

Today's linux-next merge of the swiotlb tree got a conflict in:

kernel/dma/swiotlb.c

between commit:

feee96440c9c ("swiotlb: remove swiotlb_dma_supported")

from the powerpc tree and commit:

71602fe6d4e9 ("swiotlb: add debugfs to track swiotlb buffer usage")

from the swiotlb tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

--
Cheers,
Stephen Rothwell

diff --cc kernel/dma/swiotlb.c
index 6d0236bd3929,2b0c8fd9658e..000000000000
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@@ -650,3 -665,48 +665,36 @@@ bool swiotlb_map(struct device *dev, ph

return true;
}
+
-/*
- * Return whether the given device DMA address mask can be supported
- * properly. For example, if your device can only drive the low 24-bits
- * during bus mastering, then you would pass 0x00ffffff as the mask to
- * this function.
- */
-int
-swiotlb_dma_supported(struct device *hwdev, u64 mask)
-{
- return __phys_to_dma(hwdev, io_tlb_end - 1) <= mask;
-}
-
+ #ifdef CONFIG_DEBUG_FS
+
+ static int __init swiotlb_create_debugfs(void)
+ {
+ struct dentry *d_swiotlb_usage;
+ struct dentry *ent;
+
+ d_swiotlb_usage = debugfs_create_dir("swiotlb", NULL);
+
+ if (!d_swiotlb_usage)
+ return -ENOMEM;
+
+ ent = debugfs_create_ulong("io_tlb_nslabs", 0400,
+ d_swiotlb_usage, &io_tlb_nslabs);
+ if (!ent)
+ goto fail;
+
+ ent = debugfs_create_ulong("io_tlb_used", 0400,
+ d_swiotlb_usage, &io_tlb_used);
+ if (!ent)
+ goto fail;
+
+ return 0;
+
+ fail:
+ debugfs_remove_recursive(d_swiotlb_usage);
+ return -ENOMEM;
+ }
+
+ late_initcall(swiotlb_create_debugfs);
+
+ #endif

Attachment: pgpGlxLPzCUTm.pgp
Description: OpenPGP digital signature