[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220223142555.GA5986@lst.de>
Date: Wed, 23 Feb 2022 15:25:55 +0100
From: Christoph Hellwig <hch@....de>
To: Baoquan He <bhe@...hat.com>
Cc: Christoph Hellwig <hch@....de>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, akpm@...ux-foundation.org, cl@...ux.com,
42.hyeyoo@...il.com, penberg@...nel.org, rientjes@...gle.com,
iamjoonsoo.kim@....com, vbabka@...e.cz, David.Laight@...lab.com,
david@...hat.com, herbert@...dor.apana.org.au, davem@...emloft.net,
linux-crypto@...r.kernel.org, steffen.klassert@...unet.com,
netdev@...r.kernel.org, hca@...ux.ibm.com, gor@...ux.ibm.com,
agordeev@...ux.ibm.com, borntraeger@...ux.ibm.com,
svens@...ux.ibm.com, linux-s390@...r.kernel.org, michael@...le.cc,
linux-i2c@...r.kernel.org, wsa@...nel.org
Subject: Re: [PATCH 1/2] dma-mapping: check dma_mask for streaming mapping
allocs
On Wed, Feb 23, 2022 at 08:28:13AM +0800, Baoquan He wrote:
> Could you tell more why this is wrong? According to
> Documentation/core-api/dma-api.rst and DMA code, __dma_alloc_pages() is
> the core function of dma_alloc_pages()/dma_alloc_noncoherent() which are
> obviously streaming mapping,
Why are they "obviously" streaming mappings?
> why do we need to check
> dev->coherent_dma_mask here? Because dev->coherent_dma_mask is the subset
> of dev->dma_mask, it's safer to use dev->coherent_dma_mask in these
> places? This is confusing, I talked to Hyeonggon in private mail, he has
> the same feeling.
Think of th coherent_dma_mask as dma_alloc_mask. It is the mask for the
DMA memory allocator. dma_mask is the mask for the dma_map_* routines.
Powered by blists - more mailing lists