lkml.org 
[lkml]   [2018]   [Jan]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] swiotlb: suppress warning when __GFP_NOWARN is set v2
From
Date
Am 02.01.2018 um 16:39 schrieb Chris Wilson:
> Quoting Christian König (2018-01-02 12:13:58)
>> TTM tries to allocate coherent memory in chunks of 2MB first to improve
>> TLB efficiency and falls back to allocating 4K pages if that fails.
>>
>> Suppress the warning when the 2MB allocations fails since there is a
>> valid fall back path.
>>
>> v2: suppress warnings from swiotlb_tbl_map_single as well
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> Reported-by: Mike Galbraith <efault@gmx.de>
>> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104082
>> CC: stable@vger.kernel.org
>> ---
>> @@ -989,7 +1002,8 @@ swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems,
>> if (swiotlb_force == SWIOTLB_FORCE ||
>> !dma_capable(hwdev, dev_addr, sg->length)) {
>> phys_addr_t map = map_single(hwdev, sg_phys(sg),
>> - sg->length, dir, attrs);
>> + sg->length, dir, attrs,
>> + true);
> This keeps the warning for dma_map_sg(), so seems quite ineffective.

That is the desired result, dma_map_sg() should still print the warning.

We only want to disable it for swiotlb_alloc_coherent().

Regards,
Christian.

>
>> if (map == SWIOTLB_MAP_ERROR) {
>> /* Don't panic here, we expect map_sg users
>> to do proper error handling. */
> And counter to the suggestion here?

We don't use swiotlb_map_sg_attrs() in TTM, so that is irrelevant for my
use case and I can't test any change regarding it.

Regards,
Christian.

> -Chris

\
 
 \ /
  Last update: 2018-01-02 17:14    [W:0.048 / U:2.980 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site