Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1384248 > unrolled thread

Re: [PATCH v5 3/9] dma-mapping: add dma_{map,unmap}_resource

Started byChristoph Hellwig <hch@infradead.org>
First post2016-04-21 15:50 +0200
Last post2016-04-26 15:30 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v5 3/9] dma-mapping: add dma_{map,unmap}_resource Christoph Hellwig <hch@infradead.org> - 2016-04-21 15:50 +0200
    Re: [PATCH v5 3/9] dma-mapping: add dma_{map,unmap}_resource Niklas Söderlund <niso@kth.se> - 2016-04-25 16:40 +0200
      Re: [PATCH v5 3/9] dma-mapping: add dma_{map,unmap}_resource Christoph Hellwig <hch@infradead.org> - 2016-04-25 21:20 +0200
        Re: [PATCH v5 3/9] dma-mapping: add dma_{map,unmap}_resource Niklas Söderlund   <niklas.soderlund@ragnatech.se> - 2016-04-26 15:30 +0200

#1384248 — Re: [PATCH v5 3/9] dma-mapping: add dma_{map,unmap}_resource

FromChristoph Hellwig <hch@infradead.org>
Date2016-04-21 15:50 +0200
SubjectRe: [PATCH v5 3/9] dma-mapping: add dma_{map,unmap}_resource
Message-ID<rqn9y-1tU-29@gated-at.bofh.it>
On Wed, Apr 13, 2016 at 03:29:17PM +0200, Niklas S?derlund wrote:
> > Yes, it would be good to do an audit of all the ARM dma_ops as well
> > as generic code like drivers/base/dma-*.c, lib/dma-debug.c and
> > include/linux/dma-*.h

What about things like the phys_addr() helper in lib/dma-debug.c?  That
was in fact what prompted my question for an audit, and it seems
to not even feature on your list.  What patterns / symbols did you look
for?

[toc] | [next] | [standalone]


#1386526

FromNiklas Söderlund <niso@kth.se>
Date2016-04-25 16:40 +0200
Message-ID<rrPQ6-7se-17@gated-at.bofh.it>
In reply to#1384248
Hi Christoph,

On 2016-04-21 06:49:42 -0700, Christoph Hellwig wrote:
> On Wed, Apr 13, 2016 at 03:29:17PM +0200, Niklas S?derlund wrote:
> > > Yes, it would be good to do an audit of all the ARM dma_ops as well
> > > as generic code like drivers/base/dma-*.c, lib/dma-debug.c and
> > > include/linux/dma-*.h
> 
> What about things like the phys_addr() helper in lib/dma-debug.c?  That
> was in fact what prompted my question for an audit, and it seems
> to not even feature on your list.  What patterns / symbols did you look
> for?


I have followed the call path from the usage in 
drivers/dma/sh/rcar-dmac.c and made sure the dma_addr_t is not used in a 
bad way.

I also looked at the dma-mapping API and ruled out that the only 
function that make sens to use with a dma_addr_t from dma_map_resource() 
are dma_unmap_resource() and dma_mapping_error(). With that I can't see 
how a dma_addr_t would end up in lib/dma-debug.c. But I might be missing 
something?

In the big picture do you feel the approach I have is the correct way to 
solve my problem? Provided we can work out this issues ofc?

-- 
Regards,
Niklas Söderlund

[toc] | [prev] | [next] | [standalone]


#1386771

FromChristoph Hellwig <hch@infradead.org>
Date2016-04-25 21:20 +0200
Message-ID<rrUd4-2DB-17@gated-at.bofh.it>
In reply to#1386526
On Mon, Apr 25, 2016 at 04:26:19PM +0200, Niklas S?derlund wrote:
> I have followed the call path from the usage in 
> drivers/dma/sh/rcar-dmac.c and made sure the dma_addr_t is not used in a 
> bad way.

The dma-debug routines are called from the generic code in
include/linux/dma-mapping.h, and from my reading of the other patches
in your series you are calling it for these as well.

[toc] | [prev] | [next] | [standalone]


#1387471

FromNiklas Söderlund <niklas.soderlund@ragnatech.se>
Date2016-04-26 15:30 +0200
Message-ID<rsbdU-8w9-5@gated-at.bofh.it>
In reply to#1386771
Hi Christoph,

On 2016-04-25 12:10:04 -0700, Christoph Hellwig wrote:
> On Mon, Apr 25, 2016 at 04:26:19PM +0200, Niklas S?derlund wrote:
> > I have followed the call path from the usage in 
> > drivers/dma/sh/rcar-dmac.c and made sure the dma_addr_t is not used in a 
> > bad way.
> 
> The dma-debug routines are called from the generic code in
> include/linux/dma-mapping.h, and from my reading of the other patches
> in your series you are calling it for these as well.

You are correct I have not consider that dma_mapping_error() call in to 
lib/dma-debug.c. I will see if I can make the dma_mapping_error() safe 
to use with a dma_addr_t obtained from dma_map_resource() and post a new 
series.

Thanks for pointing this out!

-- 
Regards,
Niklas Söderlund

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web