login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
May
»
15
Re: [PATCH 2/2] x86: per-device dma_mapping_ops support
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Yinghai Lu
Subject:
Re: [PATCH 2/2] x86: per-device dma_mapping_ops support
Date: Thursday, May 15, 2008 - 1:45 pm
On Mon, May 12, 2008 at 11:04 PM, FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:
quoted text
> This adds per-device dma_mapping_ops support for CONFIG_X86_64. > > A pointer to dma_mapping_ops to struct dev_archdata is added. If the > pointer is non NULL, DMA operations in asm/dma-mapping.h use it. If > it's NULL, the system-wide dma_ops pointer is used as before. > > Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> > --- > arch/x86/kernel/pci-calgary_64.c | 2 +- > arch/x86/kernel/pci-dma.c | 2 +- > arch/x86/kernel/pci-gart_64.c | 2 +- > arch/x86/kernel/pci-nommu.c | 14 +----- > arch/x86/kernel/pci-swiotlb_64.c | 2 +- > include/asm-x86/device.h | 3 + > include/asm-x86/dma-mapping.h | 95 ++++++++++++++++++++++++++------------ > 7 files changed, 74 insertions(+), 46 deletions(-) > > diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c > index e28ec49..dca9a82 100644 > --- a/arch/x86/kernel/pci-calgary_64.c > +++ b/arch/x86/kernel/pci-calgary_64.c > @@ -541,7 +541,7 @@ error: > return ret; > } > > -static const struct dma_mapping_ops calgary_dma_ops = { > +static struct dma_mapping_ops calgary_dma_ops = { > .alloc_coherent = calgary_alloc_coherent, > .map_single = calgary_map_single, > .unmap_single = calgary_unmap_single, > diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c > index 0c37f16..33ded93 100644 > --- a/arch/x86/kernel/pci-dma.c > +++ b/arch/x86/kernel/pci-dma.c > @@ -11,7 +11,7 @@ > int forbid_dac __read_mostly; > EXPORT_SYMBOL(forbid_dac); > > -const struct dma_mapping_ops *dma_ops; > +struct dma_mapping_ops *dma_ops; > EXPORT_SYMBOL(dma_ops); > > static int iommu_sac_force __read_mostly; > diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c > index e1a6954..8469f76 100644 > --- a/arch/x86/kernel/pci-gart_64.c > +++ b/arch/x86/kernel/pci-gart_64.c > @@ -621,7 +621,7 @@ static __init int init_k8_gatt(struct agp_kern_info *info) > > extern int agp_amd64_init(void); > > -static const struct dma_mapping_ops gart_dma_ops = { > +static struct dma_mapping_ops gart_dma_ops = { > .map_single = gart_map_single, > .map_simple = gart_map_simple, > .unmap_single = gart_unmap_single, > diff --git a/arch/x86/kernel/pci-nommu.c b/arch/x86/kernel/pci-nommu.c > index 05d70b8..67cc5ee 100644 > --- a/arch/x86/kernel/pci-nommu.c > +++ b/arch/x86/kernel/pci-nommu.c > @@ -72,21 +72,9 @@ static int nommu_map_sg(struct device *hwdev, struct scatterlist *sg, > return nents; > } > > -/* Make sure we keep the same behaviour */ > -static int nommu_mapping_error(struct device *hwdev, dma_addr_t dma_addr) > -{ > -#ifdef CONFIG_X86_32 > - return 0; > -#else > - return (dma_addr == bad_dma_address); > -#endif > -} > - > - > -const struct dma_mapping_ops nommu_dma_ops = { > +struct dma_mapping_ops nommu_dma_ops = { > .map_single = nommu_map_single, > .map_sg = nommu_map_sg, > - .mapping_error = nommu_mapping_error, > .is_phys = 1, > }; > > diff --git a/arch/x86/kernel/pci-swiotlb_64.c b/arch/x86/kernel/pci-swiotlb_64.c > index 490da7f..a464016 100644 > --- a/arch/x86/kernel/pci-swiotlb_64.c > +++ b/arch/x86/kernel/pci-swiotlb_64.c > @@ -18,7 +18,7 @@ swiotlb_map_single_phys(struct device *hwdev, phys_addr_t paddr, size_t size, > return swiotlb_map_single(hwdev, phys_to_virt(paddr), size, direction); > } > > -const struct dma_mapping_ops swiotlb_dma_ops = { > +struct dma_mapping_ops swiotlb_dma_ops = { > .mapping_error = swiotlb_dma_mapping_error, > .alloc_coherent = swiotlb_alloc_coherent, > .free_coherent = swiotlb_free_coherent, > diff --git a/include/asm-x86/device.h b/include/asm-x86/device.h > index 87a7153..3c034f4 100644 > --- a/include/asm-x86/device.h > +++ b/include/asm-x86/device.h > @@ -5,6 +5,9 @@ struct dev_archdata { > #ifdef CONFIG_ACPI > void *acpi_handle; > #endif > +#ifdef CONFIG_X86_64 > +struct dma_mapping_ops *dma_ops; > +#endif > #ifdef CONFIG_DMAR > void *iommu; /* hook for IOMMU specific extension */ > #endif
do you have other patch to assign value to dma_ops for every device? it is always NULL at this time. YH --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 0/2] x86: per-device dma_mapping_ops
, FUJITA Tomonori
, (Mon May 12, 11:04 pm)
[PATCH 1/2] add the device argument to dma_mapping_error
, FUJITA Tomonori
, (Mon May 12, 11:04 pm)
[PATCH 2/2] x86: per-device dma_mapping_ops support
, FUJITA Tomonori
, (Mon May 12, 11:04 pm)
Re: [PATCH 1/2] add the device argument to dma_mapping_error
, Randy Dunlap
, (Tue May 13, 8:39 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Muli Ben-Yehuda
, (Tue May 13, 10:49 pm)
Re: [PATCH 2/2] x86: per-device dma_mapping_ops support
, Muli Ben-Yehuda
, (Tue May 13, 10:55 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, FUJITA Tomonori
, (Wed May 14, 6:12 pm)
Re: [PATCH 1/2] add the device argument to dma_mapping_error
, FUJITA Tomonori
, (Wed May 14, 6:12 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Alexis Bruemmer
, (Wed May 14, 7:00 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, FUJITA Tomonori
, (Wed May 14, 7:30 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Andi Kleen
, (Thu May 15, 2:01 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, FUJITA Tomonori
, (Thu May 15, 2:16 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Andi Kleen
, (Thu May 15, 2:30 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, FUJITA Tomonori
, (Thu May 15, 2:41 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Andi Kleen
, (Thu May 15, 3:48 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Muli Ben-Yehuda
, (Thu May 15, 8:15 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Muli Ben-Yehuda
, (Thu May 15, 8:17 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Muli Ben-Yehuda
, (Thu May 15, 8:26 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Muli Ben-Yehuda
, (Thu May 15, 8:32 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Alexis Bruemmer
, (Thu May 15, 11:21 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Alexis Bruemmer
, (Thu May 15, 11:25 am)
Re: [PATCH 2/2] x86: per-device dma_mapping_ops support
, Yinghai Lu
, (Thu May 15, 1:45 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Andi Kleen
, (Thu May 15, 2:03 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Muli Ben-Yehuda
, (Thu May 15, 2:39 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Andi Kleen
, (Thu May 15, 2:45 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Muli Ben-Yehuda
, (Thu May 15, 2:53 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Muli Ben-Yehuda
, (Thu May 15, 3:05 pm)
Re: [PATCH 2/2] x86: per-device dma_mapping_ops support
, FUJITA Tomonori
, (Thu May 15, 8:44 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, FUJITA Tomonori
, (Thu May 15, 8:44 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Andi Kleen
, (Thu May 15, 10:24 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, FUJITA Tomonori
, (Sun May 18, 11:32 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Rusty Russell
Re: 2.6.22-rc3-mm1
Eric Sandeen
Re: [PATCH] xfs: do not pass unused params to xfs_flush_pages
Bill Fink
Re: [PATCH] net: add ability to clear stats via ethtool - e1000/pcnet32
David Miller
Re: NO_HZ: timer interrupt stuck
Jeffrey V. Merkey
Re: Versioning file system
git
:
Johannes Schindelin
[PATCH] fetch: refuse to fetch into the current branch in a non-bare repository
Junio C Hamano
Re: [PATCH] http-push: making HTTP push more robust and more user-friendly
Oliver Kullmann
Re: how to move with history?
Junio C Hamano
Re: [PATCH 2/3] git-add--interactive: remove hunk coalescing
Shawn O. Pearce
Re: Bugs in Gitosis
linux-netdev
:
gregkh
Patch "IPv6: keep route for tentative address" has been added to the 2.6.34-stable...
Patrick McHardy
Re: [rfc 02/13] [RFC 02/13] netfilter: nf_conntrack_sip: Add callid parser
webmaster Maintenance
&#32852;&#31995;&#31995;&#32479;&#31649;&#29702;&#21592;
Krzysztof Oledzki
Re: Error: an inet prefix is expected rather than "0/0".
Paul Gortmaker
[PATCH net-next 09/16] tipc: Relocate trivial link status functions to header file
git-commits-head
:
Linux Kernel Mailing List
V4L/DVB: tm6000: add special usb request to quit i2c tuner transfer
Linux Kernel Mailing List
OMAP: DSS2: SDI driver
Linux Kernel Mailing List
PCI: introduce pci_pcie_cap()
Linux Kernel Mailing List
drivers/acpi: use kasprintf
Linux Kernel Mailing List
Staging: et131x: prune all the debug code
openbsd-misc
:
Ted Bullock
Re: Proliant DL380 G3 cannot get on network
Úlfar M. E. Johnson
installing openbsd in xen
Eric Furman
Re: Defending OpenBSD Performance
Damien Miller
Re: Patching a SSH 'Weakness'
Brian
CARP multicast and ADSL bridge
Colocation donated by:
Syndicate