Re: [PATCH 2/2] x86: per-device dma_mapping_ops support

From: FUJITA Tomonori
Date: Thu May 15 2008 - 23:46:30 EST


On Thu, 15 May 2008 13:45:58 -0700
"Yinghai Lu" <yhlu.kernel@xxxxxxxxx> wrote:

> On Mon, May 12, 2008 at 11:04 PM, FUJITA Tomonori
> <fujita.tomonori@xxxxxxxxxxxxx> wrote:
> > 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@xxxxxxxxxxxxx>
> > ---
> > 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(-)

(snip)

> do you have other patch to assign value to dma_ops for every device?
> it is always NULL at this time.

Not yet.

As I said, I plan to implement a mechanism to register a hook called
when a new pci (or dma capable) device is created. It enables IOMMUs
to set up an appropriate dma_mapping_ops per device:

http://lkml.org/lkml/2008/5/14/519

But I wanted to make sure whether per-device dma_ops is useful for
everyone.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/