From: tip-bot for Arnd Bergmann <arnd@arndb.de>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, arnd@arndb.de, hpa@zytor.com,
mingo@redhat.com, fujita.tomonori@lab.ntt.co.jp,
tglx@linutronix.de, mingo@elte.hu
Subject: [tip:core/iommu] dma-ops: Remove flush_write_buffers() in dma-mapping-common.h
Date: Mon, 10 Aug 2009 08:46:26 GMT [thread overview]
Message-ID: <tip-a8ad568dd8ca122aa8048ea067d3599820d1c1b4@git.kernel.org> (raw)
In-Reply-To: <1249872797-1314-2-git-send-email-fujita.tomonori@lab.ntt.co.jp>
Commit-ID: a8ad568dd8ca122aa8048ea067d3599820d1c1b4
Gitweb: http://git.kernel.org/tip/a8ad568dd8ca122aa8048ea067d3599820d1c1b4
Author: Arnd Bergmann <arnd@arndb.de>
AuthorDate: Mon, 10 Aug 2009 11:53:10 +0900
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 10 Aug 2009 09:34:57 +0200
dma-ops: Remove flush_write_buffers() in dma-mapping-common.h
This moves flush_write_buffers() in
asm-generic/dma-mapping-common.h to
arch/x86/kernel/pci-nommu.c.
The purpose of this patch is that, we can avoid defining NULL
flush_write_buffers() on IA64 and SPARC.
dma-mapping-common.h is used by X86 and IA64 (and SPARC soon)
but only X86 with CONFIG_X86_OOSTORE or CONFIG_X86_PPRO_FENCE
actually uses flush_write_buffers(). CONFIG_X86_OOSTORE or
CONFIG_X86_PPRO_FENCE is usable with only kernel/pci-nommu.c
(that is, not usable with other X86 IOMMU implementations such
as SWIOTLB, VT-d, etc) so we can safely move
flush_write_buffers() in asm-generic/dma-mapping-common.h to
arch/x86/kernel/pci-nommu.c.
The further discussion is:
http://lkml.org/lkml/2009/6/28/104
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: davem@davemloft.net
Cc: tony.luck@intel.com
Cc: fenghua.yu@intel.com
LKML-Reference: <1249872797-1314-2-git-send-email-fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/pci-nommu.c | 27 ++++++++++++++++++++++-----
include/asm-generic/dma-mapping-common.h | 6 ------
2 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/arch/x86/kernel/pci-nommu.c b/arch/x86/kernel/pci-nommu.c
index c0a4222..a3933d4 100644
--- a/arch/x86/kernel/pci-nommu.c
+++ b/arch/x86/kernel/pci-nommu.c
@@ -79,12 +79,29 @@ static void nommu_free_coherent(struct device *dev, size_t size, void *vaddr,
free_pages((unsigned long)vaddr, get_order(size));
}
+static void nommu_sync_single_for_device(struct device *dev,
+ dma_addr_t addr, size_t size,
+ enum dma_data_direction dir)
+{
+ flush_write_buffers();
+}
+
+
+static void nommu_sync_sg_for_device(struct device *dev,
+ struct scatterlist *sg, int nelems,
+ enum dma_data_direction dir)
+{
+ flush_write_buffers();
+}
+
struct dma_map_ops nommu_dma_ops = {
- .alloc_coherent = dma_generic_alloc_coherent,
- .free_coherent = nommu_free_coherent,
- .map_sg = nommu_map_sg,
- .map_page = nommu_map_page,
- .is_phys = 1,
+ .alloc_coherent = dma_generic_alloc_coherent,
+ .free_coherent = nommu_free_coherent,
+ .map_sg = nommu_map_sg,
+ .map_page = nommu_map_page,
+ .sync_single_for_device = nommu_sync_single_for_device,
+ .sync_sg_for_device = nommu_sync_sg_for_device,
+ .is_phys = 1,
};
void __init no_iommu_init(void)
diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h
index 5406a60..e694263 100644
--- a/include/asm-generic/dma-mapping-common.h
+++ b/include/asm-generic/dma-mapping-common.h
@@ -103,7 +103,6 @@ static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t addr,
if (ops->sync_single_for_cpu)
ops->sync_single_for_cpu(dev, addr, size, dir);
debug_dma_sync_single_for_cpu(dev, addr, size, dir);
- flush_write_buffers();
}
static inline void dma_sync_single_for_device(struct device *dev,
@@ -116,7 +115,6 @@ static inline void dma_sync_single_for_device(struct device *dev,
if (ops->sync_single_for_device)
ops->sync_single_for_device(dev, addr, size, dir);
debug_dma_sync_single_for_device(dev, addr, size, dir);
- flush_write_buffers();
}
static inline void dma_sync_single_range_for_cpu(struct device *dev,
@@ -132,7 +130,6 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev,
ops->sync_single_range_for_cpu(dev, addr, offset, size, dir);
debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir);
- flush_write_buffers();
} else
dma_sync_single_for_cpu(dev, addr, size, dir);
}
@@ -150,7 +147,6 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
ops->sync_single_range_for_device(dev, addr, offset, size, dir);
debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir);
- flush_write_buffers();
} else
dma_sync_single_for_device(dev, addr, size, dir);
}
@@ -165,7 +161,6 @@ dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
if (ops->sync_sg_for_cpu)
ops->sync_sg_for_cpu(dev, sg, nelems, dir);
debug_dma_sync_sg_for_cpu(dev, sg, nelems, dir);
- flush_write_buffers();
}
static inline void
@@ -179,7 +174,6 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
ops->sync_sg_for_device(dev, sg, nelems, dir);
debug_dma_sync_sg_for_device(dev, sg, nelems, dir);
- flush_write_buffers();
}
#define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, NULL)
next prev parent reply other threads:[~2009-08-10 8:47 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-10 2:53 [PATCH resend 0/8] sparc: use asm-generic/dma-mapping-common.h and pci-dma-compat.h FUJITA Tomonori
2009-08-10 2:53 ` [PATCH 1/8] remove flush_write_buffers() in dma-mapping-common.h FUJITA Tomonori
2009-08-10 8:46 ` tip-bot for Arnd Bergmann [this message]
2009-08-10 2:53 ` [PATCH 2/8] IA64: remove NULL flush_write_buffers FUJITA Tomonori
2009-08-10 8:46 ` [tip:core/iommu] IA64: Remove " tip-bot for FUJITA Tomonori
2009-08-10 2:53 ` [PATCH 3/8] sparc: use dma_map_ops struct FUJITA Tomonori
2009-08-10 8:46 ` [tip:core/iommu] sparc: Use " tip-bot for FUJITA Tomonori
2009-08-10 2:53 ` [PATCH 4/8] sparc: use asm-generic/dma-mapping-common.h FUJITA Tomonori
2009-08-10 8:47 ` [tip:core/iommu] sparc: Use asm-generic/dma-mapping-common.h tip-bot for FUJITA Tomonori
2009-08-10 2:53 ` [PATCH 5/8] sparc: remove no-op dma_4v_sync_single_for_cpu and dma_4v_sync_sg_for_cpu FUJITA Tomonori
2009-08-10 8:47 ` [tip:core/iommu] sparc: Remove " tip-bot for FUJITA Tomonori
2009-08-10 2:53 ` [PATCH 6/8] sparc: replace sbus_map_single and sbus_unmap_single with sbus_map_page and sbus_unmap_page FUJITA Tomonori
2009-08-10 8:47 ` [tip:core/iommu] sparc: Replace " tip-bot for FUJITA Tomonori
2009-08-10 2:53 ` [PATCH 7/8] sparc: use asm-generic/pci-dma-compat FUJITA Tomonori
2009-08-10 8:47 ` [tip:core/iommu] sparc: Use asm-generic/pci-dma-compat tip-bot for FUJITA Tomonori
2009-08-10 2:53 ` [PATCH 8/8] sparc: add CONFIG_DMA_API_DEBUG support FUJITA Tomonori
2009-08-10 8:47 ` [tip:core/iommu] sparc: Add " tip-bot for FUJITA Tomonori
2009-08-12 23:34 ` [PATCH resend 0/8] sparc: use asm-generic/dma-mapping-common.h and pci-dma-compat.h David Miller
2009-08-13 7:04 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-a8ad568dd8ca122aa8048ea067d3599820d1c1b4@git.kernel.org \
--to=arnd@arndb.de \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®