From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: konrad.wilk@oracle.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] swiotlb: suppress warning when __GFP_NOWARN is set v4
Date: Thu, 4 Jan 2018 11:16:39 +0100 [thread overview]
Message-ID: <d4753ea7-44b3-9c5f-3bb8-4a6654ccea88@gmail.com> (raw)
In-Reply-To: <20180104095325.GB13091@infradead.org>
Am 04.01.2018 um 10:53 schrieb Christoph Hellwig:
> This seems to collide with my dma direct/swiotlb series posted recently.
>
>> +++ b/lib/swiotlb.c
>> @@ -490,11 +490,11 @@ static void swiotlb_bounce(phys_addr_t orig_addr, phys_addr_t tlb_addr,
>> }
>> }
>>
>> -phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
>> - dma_addr_t tbl_dma_addr,
>> - phys_addr_t orig_addr, size_t size,
>> - enum dma_data_direction dir,
>> - unsigned long attrs)
>> +static phys_addr_t tbl_map_single(struct device *hwdev,
>> + dma_addr_t tbl_dma_addr,
>> + phys_addr_t orig_addr, size_t size,
>> + enum dma_data_direction dir,
>> + unsigned long attrs, bool warn)
> We already have DMA_ATTR_NO_WARN which can be passed in attrs. Please
> use it instead of reinventing it.
>
>> swiotlb_alloc_coherent(struct device *hwdev, size_t size,
>> dma_addr_t *dma_handle, gfp_t flags)
>> {
>> + bool warn = !(flags & __GFP_NOWARN);
>> dma_addr_t dev_addr;
>> void *ret;
>> int order = get_order(size);
>> @@ -739,7 +750,7 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size,
>> * will grab memory from the lowest available address range.
>> */
>> phys_addr_t paddr = map_single(hwdev, 0, size,
>> - DMA_FROM_DEVICE, 0);
>> + DMA_FROM_DEVICE, 0, warn);
> Note: in my above series swiotlb_alloc_coherent is going away, and
> replaced with a swiotlb_alloc that takes a dma_attrs argument.
That's what I thought about as well, but this is a bug fix for stable
kernels. So the changes should be as small as possible.
But using DMA_ATTR_NO_WARN is a good point, going to send a v5 which
uses this instead.
Regards,
Christian.
>
> Using that for passing the nowarn flag is the right way to go instead
> of using __GFP_NOWARN.
prev parent reply other threads:[~2018-01-04 10:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-04 9:32 Christian König
2018-01-04 9:53 ` Christoph Hellwig
2018-01-04 10:16 ` Christian König [this message]
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=d4753ea7-44b3-9c5f-3bb8-4a6654ccea88@gmail.com \
--to=ckoenig.leichtzumerken@gmail.com \
--cc=christian.koenig@amd.com \
--cc=hch@infradead.org \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®