login
Login
/
Register
Search
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
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Yinghai Lu <yhlu.kernel@...>
To: FUJITA Tomonori <fujita.tomonori@...>
Cc: <linux-kernel@...>, <akpm@...>, <muli@...>, <alexisb@...>
Subject:
Re: [PATCH 2/2] x86: per-device dma_mapping_ops support
Date: Thursday, May 15, 2008 - 4: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
, (Tue May 13, 2:04 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Andi Kleen
, (Thu May 15, 5:01 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, FUJITA Tomonori
, (Thu May 15, 5:16 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Alexis Bruemmer
, (Thu May 15, 2:25 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Andi Kleen
, (Thu May 15, 5:30 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, FUJITA Tomonori
, (Thu May 15, 5:41 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Muli Ben-Yehuda
, (Thu May 15, 11:26 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Andi Kleen
, (Thu May 15, 5:03 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Muli Ben-Yehuda
, (Thu May 15, 5:39 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Andi Kleen
, (Thu May 15, 5:45 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Muli Ben-Yehuda
, (Thu May 15, 5:53 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Muli Ben-Yehuda
, (Thu May 15, 6:05 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Andi Kleen
, (Thu May 15, 6:48 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, FUJITA Tomonori
, (Thu May 15, 11:44 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Andi Kleen
, (Fri May 16, 1:24 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, FUJITA Tomonori
, (Mon May 19, 2:32 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Muli Ben-Yehuda
, (Thu May 15, 11:32 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Muli Ben-Yehuda
, (Wed May 14, 1:49 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, FUJITA Tomonori
, (Wed May 14, 9:12 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Muli Ben-Yehuda
, (Thu May 15, 11:15 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Alexis Bruemmer
, (Wed May 14, 10:00 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Muli Ben-Yehuda
, (Thu May 15, 11:17 am)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, FUJITA Tomonori
, (Wed May 14, 10:30 pm)
Re: [PATCH 0/2] x86: per-device dma_mapping_ops
, Alexis Bruemmer
, (Thu May 15, 2:21 pm)
[PATCH 1/2] add the device argument to dma_mapping_error
, FUJITA Tomonori
, (Tue May 13, 2:04 am)
Re: [PATCH 1/2] add the device argument to dma_mapping_error
, Randy Dunlap
, (Tue May 13, 11:39 am)
Re: [PATCH 1/2] add the device argument to dma_mapping_error
, FUJITA Tomonori
, (Wed May 14, 9:12 pm)
[PATCH 2/2] x86: per-device dma_mapping_ops support
, FUJITA Tomonori
, (Tue May 13, 2:04 am)
Re: [PATCH 2/2] x86: per-device dma_mapping_ops support
, Yinghai Lu
, (Thu May 15, 4:45 pm)
Re: [PATCH 2/2] x86: per-device dma_mapping_ops support
, FUJITA Tomonori
, (Thu May 15, 11:44 pm)
Re: [PATCH 2/2] x86: per-device dma_mapping_ops support
, Muli Ben-Yehuda
, (Wed May 14, 1:55 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Dave Hansen
[RFC][PATCH 0/4] kernel-based checkpoint restart
Greg KH
[GIT PATCH] driver core patches against 2.6.24
Bart Van Assche
Integration of SCST in the mainstream Linux kernel
Eric Paris
[RFC 0/5] [TALPA] Intro to a linux interface for on access scanning
git
:
linux-netdev
:
David Miller
Re: [GIT]: Networking
Natalie Protasevich
[BUG] New Kernel Bugs
Gerrit Renker
[PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side)
Jarek Poplawski
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
12 users
and
1171 guests
online.
Online users
womensunderwea
farmvillezrbmr
vv_ivango
cambridgeacupu
yeasty123
eatpraylovemia
koiselv
retrying234
mesotheliomadk
hotelskillarne
stagehypnotist
fitnessenquipm
Syndicate