From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751447AbeEBMjT (ORCPT ); Wed, 2 May 2018 08:39:19 -0400 Received: from verein.lst.de ([213.95.11.211]:38997 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751020AbeEBMjR (ORCPT ); Wed, 2 May 2018 08:39:17 -0400 Date: Wed, 2 May 2018 14:41:51 +0200 From: Christoph Hellwig To: Daniel Vetter Cc: Christian =?iso-8859-1?Q?K=F6nig?= , Chris Wilson , Michel =?iso-8859-1?Q?D=E4nzer?= , Konrad Rzeszutek Wilk , Christoph Hellwig , iommu@lists.linux-foundation.org, Linux Kernel Mailing List , dri-devel Subject: Re: [PATCH] swiotlb: Fix inversed DMA_ATTR_NO_WARN test Message-ID: <20180502124151.GA22857@lst.de> References: <20180501132411.2311-1-michel@daenzer.net> <786ca83f-45c4-264b-2aef-d84fb18d3d28@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 02, 2018 at 02:18:56PM +0200, Daniel Vetter wrote: > Other dma-api backends like cma just shut up when __GFP_NOWARN is > passed. And afaiui Christoph Hellwig has plans to nuke the DMA_ATTR > stuff (or at least clean it up) - should we just remove > DMA_ATTR_NO_WARN and instead only look at __GFP_NOWARN? No. __GFP_NOWARN (and gfp_t flags in general) are the wrong interface for dma allocations and just cause problems. I actually plan to get rid of the gfp_t argument in dma_alloc_attrs sooner, and only allow either GFP_KERNEL or GFP_DMA passed in dma_alloc_coherent. > Or maybe we should at least enforce that both or none are set, for > consistency for now? The interface should be DMA_ATTR_NO_WARN. __GFP_NOWARN in this context was never documented, and just slipped in. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH] swiotlb: Fix inversed DMA_ATTR_NO_WARN test Date: Wed, 2 May 2018 14:41:51 +0200 Message-ID: <20180502124151.GA22857@lst.de> References: <20180501132411.2311-1-michel@daenzer.net> <786ca83f-45c4-264b-2aef-d84fb18d3d28@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Daniel Vetter Cc: Konrad Rzeszutek Wilk , Michel =?iso-8859-1?Q?D=E4nzer?= , Linux Kernel Mailing List , dri-devel , Christian =?iso-8859-1?Q?K=F6nig?= , iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Chris Wilson , Christoph Hellwig List-Id: iommu@lists.linux-foundation.org On Wed, May 02, 2018 at 02:18:56PM +0200, Daniel Vetter wrote: > Other dma-api backends like cma just shut up when __GFP_NOWARN is > passed. And afaiui Christoph Hellwig has plans to nuke the DMA_ATTR > stuff (or at least clean it up) - should we just remove > DMA_ATTR_NO_WARN and instead only look at __GFP_NOWARN? No. __GFP_NOWARN (and gfp_t flags in general) are the wrong interface for dma allocations and just cause problems. I actually plan to get rid of the gfp_t argument in dma_alloc_attrs sooner, and only allow either GFP_KERNEL or GFP_DMA passed in dma_alloc_coherent. > Or maybe we should at least enforce that both or none are set, for > consistency for now? The interface should be DMA_ATTR_NO_WARN. __GFP_NOWARN in this context was never documented, and just slipped in.