From: 'Christoph Hellwig' <hch@lst.de>
To: David Laight <David.Laight@ACULAB.COM>
Cc: "iommu@lists.linux-foundation.org"
<iommu@lists.linux-foundation.org>,
'Christoph Hellwig' <hch@lst.de>,
Dominik Brodowski <linux@dominikbrodowski.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] dma-mapping: better document dma_addr_t and DMA_MAPPING_ERROR
Date: Fri, 25 Sep 2020 06:14:25 +0200 [thread overview]
Message-ID: <20200925041425.GA9419@lst.de> (raw)
In-Reply-To: <f9c37e5ff1cb4a02bff6d2a8d0ea2dcc@AcuMS.aculab.com>
On Tue, Sep 22, 2020 at 01:56:46PM +0000, David Laight wrote:
> > +/*
> > + * A dma_addr_t can hold any valid DMA or bus address for the platform. It can
> > + * be given to a device to use as a DMA source or target. A CPU cannot
> > + * reference a dma_addr_t directly because there may be translation between its
> > + * physical address space and the bus address space.
>
> It can't access it 'directly' because it isn't a virtual address....
>
> > + *
> > + * DMA_MAPPING_ERROR is the magic error code if a mapping failed. It should not
> > + * be used directly in drivers, but checked for using dma_mapping_error()
> > + * instead.
> > + */
>
> I think it might be worth adding:
>
> A dma_addr_t value may be device dependant and differ from the
> 'physical address' of the memory.
This is what I've committed:
* A dma_addr_t can hold any valid DMA or bus address for the platform. It can
* be given to a device to use as a DMA source or target. It is specific to a
* given device and there may be a translation between the CPU physical address
* space and the bus address space.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
WARNING: multiple messages have this Message-ID (diff)
From: 'Christoph Hellwig' <hch@lst.de>
To: David Laight <David.Laight@ACULAB.COM>
Cc: 'Christoph Hellwig' <hch@lst.de>,
"iommu@lists.linux-foundation.org"
<iommu@lists.linux-foundation.org>,
Dominik Brodowski <linux@dominikbrodowski.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] dma-mapping: better document dma_addr_t and DMA_MAPPING_ERROR
Date: Fri, 25 Sep 2020 06:14:25 +0200 [thread overview]
Message-ID: <20200925041425.GA9419@lst.de> (raw)
In-Reply-To: <f9c37e5ff1cb4a02bff6d2a8d0ea2dcc@AcuMS.aculab.com>
On Tue, Sep 22, 2020 at 01:56:46PM +0000, David Laight wrote:
> > +/*
> > + * A dma_addr_t can hold any valid DMA or bus address for the platform. It can
> > + * be given to a device to use as a DMA source or target. A CPU cannot
> > + * reference a dma_addr_t directly because there may be translation between its
> > + * physical address space and the bus address space.
>
> It can't access it 'directly' because it isn't a virtual address....
>
> > + *
> > + * DMA_MAPPING_ERROR is the magic error code if a mapping failed. It should not
> > + * be used directly in drivers, but checked for using dma_mapping_error()
> > + * instead.
> > + */
>
> I think it might be worth adding:
>
> A dma_addr_t value may be device dependant and differ from the
> 'physical address' of the memory.
This is what I've committed:
* A dma_addr_t can hold any valid DMA or bus address for the platform. It can
* be given to a device to use as a DMA source or target. It is specific to a
* given device and there may be a translation between the CPU physical address
* space and the bus address space.
next prev parent reply other threads:[~2020-09-25 4:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-22 13:39 a few trivial dma-mapping header cleanups Christoph Hellwig
2020-09-22 13:39 ` Christoph Hellwig
2020-09-22 13:40 ` [PATCH 1/3] dma-mapping: remove DMA_MASK_NONE Christoph Hellwig
2020-09-22 13:40 ` Christoph Hellwig
2020-09-22 13:59 ` Dominik Brodowski
2020-09-22 13:59 ` Dominik Brodowski
2020-09-22 13:40 ` [PATCH 2/3] dma-mapping: move valid_dma_direction to dma-direction.h Christoph Hellwig
2020-09-22 13:40 ` Christoph Hellwig
2020-09-22 13:40 ` [PATCH 3/3] dma-mapping: better document dma_addr_t and DMA_MAPPING_ERROR Christoph Hellwig
2020-09-22 13:40 ` Christoph Hellwig
2020-09-22 13:56 ` David Laight
2020-09-22 13:56 ` David Laight
2020-09-25 4:14 ` 'Christoph Hellwig' [this message]
2020-09-25 4:14 ` 'Christoph Hellwig'
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=20200925041425.GA9419@lst.de \
--to=hch@lst.de \
--cc=David.Laight@ACULAB.COM \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.