Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752858AbeADN3W (ORCPT + 1 other); Thu, 4 Jan 2018 08:29:22 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:43917 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752372AbeADN3V (ORCPT ); Thu, 4 Jan 2018 08:29:21 -0500 Date: Thu, 4 Jan 2018 05:29:19 -0800 From: Christoph Hellwig To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: konrad.wilk@oracle.com, linux-kernel@vger.kernel.org, hch@infradead.org Subject: Re: [PATCH] swiotlb: suppress warning when __GFP_NOWARN is set v5 Message-ID: <20180104132919.GA7213@infradead.org> References: <20180104132419.24536-1-christian.koenig@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180104132419.24536-1-christian.koenig@amd.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: > @@ -713,6 +713,7 @@ void * > swiotlb_alloc_coherent(struct device *hwdev, size_t size, > dma_addr_t *dma_handle, gfp_t flags) > { > + bool warn = !(flags & __GFP_NOWARN); This is still wrong. __GFP_NOWARN has no meaning for DMA coherent allocations, and if a driver expects it to do anything it's doing it wrong. This needs to check for DMA_ATTR_NO_WARN, and thus get the attrs passed.