Received: by 10.192.165.148 with SMTP id m20csp2156950imm; Sat, 28 Apr 2018 13:45:32 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqggKE8HOxcu5DG5jzhKMHnOnt+O3QSPOqkHPuGGcms7VEvmnpKTZEyp5GpSZ/k4ddjxHol X-Received: by 2002:a17:902:5402:: with SMTP id d2-v6mr7123492pli.386.1524948332893; Sat, 28 Apr 2018 13:45:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524948332; cv=none; d=google.com; s=arc-20160816; b=bJeX9BbBUlT4i/Azyx9HTLUbWFwOvbLnr0qUvTibfMBrL1tV89Pmdr/IjK1V05J/JY 81Urfrk1dr4SGgks2CaixpzUH1zcCuh7LxkKGaEMNsZRB0QsaVvcR1jNWuInPf3AM1zJ lxofOG+p/mRpteq3J70ncuWR5uxrl7tRQQEsqjhy6VkJQCCS9wIIvAYBWR8dHlxDuvnr V5zebFpvrQVwzi3NrM+ZE6SOguFKBedx0uPzFRUhIBpW2USZnxYdxDwjNOcYTgUxCeOv l5IfljuDBDOmZJhjCkoMriVO63G6NbIKPKy1GBsYZCKi0OhpRnIZzpR+SPg3jjDJT9I5 AwjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=eehbr3mioVfeQE7LlOtUW6hVIZTJy6nnEmpcF748aG8=; b=XcCyhwFbQ79iV0nCiosQs/hAklGBUP0YVmnulKswZW13oCipikNJoMM5MxHsfLEkiX MwPCoQMAZLOxRBC7UeFATDJ8CvbTLq+kFA+OJ6YfLxSrcdOIIKX4CPCk7x0EfvjsXbqh ydcoda2TsHeIcxHmSScTX/hrHqATulTbk53FVRsVpfG9nLutJddGItZ4Z1b8sz//t4N9 O/agICIO5IbYSgjV0VRuL6t4X7vkQ+snQMkNMGp8ZyHXX162i68vhiV8gxMrGxzsfXbr r7ldS/DAtFXirdXFQJou1M95Rokwy1SMYBOIFlnnwOb526i07MXJ0s1y6+gu4EmmS2Eq VaBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=bombadil.20170209 header.b=g+rHW4wV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j3-v6si4192780pld.300.2018.04.28.13.44.45; Sat, 28 Apr 2018 13:45:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=bombadil.20170209 header.b=g+rHW4wV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751795AbeD1Ulf (ORCPT + 99 others); Sat, 28 Apr 2018 16:41:35 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:59566 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751151AbeD1Uld (ORCPT ); Sat, 28 Apr 2018 16:41:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=rgbzfKKJGjJPEC6uK3r3aOWKeGbQsrmZSiya93DaEzc=; b=g+rHW4wVvvfdoMPPplHKQrshy woEGURXDP0f2Fx7RxwPlxr9Bm6QriXIoguwXPZ5mFfC0NLlfOnU3mvEcEpKhek91eDw3112kzcBkg q+g8w2GK+PZkuVHiTDpos3mDG6lFPaq3VPZ9V+st32x/0ica+vUskUNyFr6rxOjFS9Tvn5/Bx4Z66 6axLlftVorue3diXRtHglhFbCieren7Hfg67EKjPVc6dTsEj4N9e/BSEkoyVx5LiwjbcX7WTzhtyy o89XljsM5yoVKvtjUrMbQNj7GR/nA/c1JGX7E2MVDKvJzqF4RuRmt/oAUrwFlQVtj1ZhweboCjeYg YO503c9Ig==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fCWek-00051r-GC; Sat, 28 Apr 2018 20:41:18 +0000 Date: Sat, 28 Apr 2018 13:41:18 -0700 From: Matthew Wilcox To: Julia Lawall Cc: "Luis R. Rodriguez" , Christoph Hellwig , Dan Carpenter , linux-mm@kvack.org, mhocko@kernel.org, cl@linux.com, Jan Kara , matthew@wil.cx, x86@kernel.org, luto@amacapital.net, martin.petersen@oracle.com, jthumshirn@suse.de, broonie@kernel.org, Juergen Gross , linux-spi@vger.kernel.org, Joerg Roedel , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, "lsf-pc@lists.linux-foundation.org" Subject: Re: [LSF/MM TOPIC NOTES] x86 ZONE_DMA love Message-ID: <20180428204118.GA3305@bombadil.infradead.org> References: <20180426215406.GB27853@wotan.suse.de> <20180427053556.GB11339@infradead.org> <20180427161456.GD27853@wotan.suse.de> <20180428084221.GD31684@infradead.org> <20180428185514.GW27853@wotan.suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 28, 2018 at 09:46:52PM +0200, Julia Lawall wrote: > FWIW, here is my semantic patch and the output - it reports on things that > appear to be too small and things that it doesn't know about. > > What are the relevant pci wrappers? I didn't find them. Basically all of the functions in include/linux/pci-dma-compat.h > too small: drivers/gpu/drm/i915/i915_drv.c:1138: 30 > too small: drivers/net/wireless/broadcom/b43/dma.c:1068: 30 > unknown: sound/pci/ctxfi/cthw20k2.c:2033: DMA_BIT_MASK(dma_bits) > unknown: sound/pci/ctxfi/cthw20k2.c:2034: DMA_BIT_MASK(dma_bits) This one's good: const unsigned int dma_bits = BITS_PER_LONG; > unknown: drivers/scsi/megaraid/megaraid_sas_base.c:6036: consistent_mask and this one: consistent_mask = (instance->adapter_type == VENTURA_SERIES) ? DMA_BIT_MASK(64) : DMA_BIT_MASK(32); > unknown: drivers/net/wireless/ath/wil6210/txrx.c:200: DMA_BIT_MASK(wil->dma_addr_size) if (wil->dma_addr_size > 32) dma_set_mask_and_coherent(dev, DMA_BIT_MASK(wil->dma_addr_size)); > unknown: drivers/net/ethernet/netronome/nfp/nfp_main.c:452: DMA_BIT_MASK(NFP_NET_MAX_DMA_BITS) drivers/net/ethernet/netronome/nfp/nfp_net.h:#define NFP_NET_MAX_DMA_BITS 40 > unknown: drivers/gpu/host1x/dev.c:199: host->info->dma_mask Looks safe ... drivers/gpu/host1x/bus.c: device->dev.coherent_dma_mask = host1x->dev->coherent_dma_mask; drivers/gpu/host1x/bus.c: device->dev.dma_mask = &device->dev.coherent_dma_mask; drivers/gpu/host1x/dev.c: .dma_mask = DMA_BIT_MASK(32), drivers/gpu/host1x/dev.c: .dma_mask = DMA_BIT_MASK(32), drivers/gpu/host1x/dev.c: .dma_mask = DMA_BIT_MASK(34), drivers/gpu/host1x/dev.c: .dma_mask = DMA_BIT_MASK(34), drivers/gpu/host1x/dev.c: .dma_mask = DMA_BIT_MASK(34), drivers/gpu/host1x/dev.c: dma_set_mask_and_coherent(host->dev, host->info->dma_mask); drivers/gpu/host1x/dev.h: u64 dma_mask; /* mask of addressable memory */ ... but that reminds us that maybe some drivers aren't using dma_set_mask() but rather touching dma_mask directly. ... 57 more to look at ...