Received: by 10.192.165.148 with SMTP id m20csp2089251imm; Sat, 28 Apr 2018 11:57:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq4C52gCoWjyaF8ac1HK3OEKIbs5S8UWwbMRFnQhtirMkbAuyBDukttACcUMkF3jX+yPS81 X-Received: by 2002:a17:902:2ac3:: with SMTP id j61-v6mr6734250plb.224.1524941849608; Sat, 28 Apr 2018 11:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524941849; cv=none; d=google.com; s=arc-20160816; b=MjOSzuHt/l9AvYdPRYu55bIgx9nwqRCdwHSASaJcYt3pyFnKJXX5/o3Lc08ruyWGYG fO1+/DEGuOMecKbgJrR9Xo63KuIuamzL4VKAww1qTFGo3CEuyCtxb3W0mE8e+Tya2W93 YzSdMUa4b50swqCArhNBY6Lbb/YjB6p8o0jXk/kv9iGZSFKtfsQ4NCE+8YjgCHOtRPFz lsxQ/CrtL8v7CPf+ZxHDQ+N4sXCcmA1PiHW8eOZhZcN2P3ZN08SEaJHuFRqBQK0iDZX5 itmvqno6QlOn1hneo8DY+eDpTtsvFyVo7aBrmWTZf8Oanqlp9Ny+M4xrWCErP0dLH+Jw e6Iw== 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:arc-authentication-results; bh=fHuIXKmQtmgawbb+bhgDHYxX0Ht1l1FjMXIYbw+FtZc=; b=iepd50VvQT718En+zDOmJtk0jaeNVBrVncrVUbZEF5gA5Ybyk78vS27MerwKOWK0wA BPYh+C38Ypl4WPPqyiHRQ4ERGuNU/ZIOTAvaCWnKY7czvjO7nu03oHgpyxXOZ7VBwhCv WdlgWyAu8yU4LI8Z2FKF5c+1/OvkRn4jauUHfLQvYX8wK5GjRGYzy5N1Vcq5S9wi5tOF KT8XlAx4AoHe7unSGRzOWRLXMc9JRG6nUDevRpHydDDhoR0hGV79PJcASH6G2VDp8lLk y2zkRmChKtcYKE/TXjrkwDy0kN3rN9BIXeAmrRUwtAjxeKXatBHG6wM8e/LfkAO/Undw t8zg== ARC-Authentication-Results: i=1; mx.google.com; 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 21si4207209pfy.293.2018.04.28.11.57.04; Sat, 28 Apr 2018 11:57:29 -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; 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 S1751376AbeD1SzV (ORCPT + 99 others); Sat, 28 Apr 2018 14:55:21 -0400 Received: from mx2.suse.de ([195.135.220.15]:48724 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751079AbeD1SzT (ORCPT ); Sat, 28 Apr 2018 14:55:19 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 583DBACE0; Sat, 28 Apr 2018 18:55:17 +0000 (UTC) Date: Sat, 28 Apr 2018 18:55:14 +0000 From: "Luis R. Rodriguez" To: Christoph Hellwig , Dan Carpenter , Julia Lawall Cc: "Luis R. Rodriguez" , 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: <20180428185514.GW27853@wotan.suse.de> References: <20180426215406.GB27853@wotan.suse.de> <20180427053556.GB11339@infradead.org> <20180427161456.GD27853@wotan.suse.de> <20180428084221.GD31684@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180428084221.GD31684@infradead.org> User-Agent: Mutt/1.6.0 (2016-04-01) 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 01:42:21AM -0700, Christoph Hellwig wrote: > On Fri, Apr 27, 2018 at 04:14:56PM +0000, Luis R. Rodriguez wrote: > > Do we have a list of users for x86 with a small DMA mask? > > Or, given that I'm not aware of a tool to be able to look > > for this in an easy way, would it be good to find out which > > x86 drivers do have a small mask? > > Basically you'll have to grep for calls to dma_set_mask/ > dma_set_coherent_mask/dma_set_mask_and_coherent and their pci_* > wrappers with masks smaller 32-bit. Some use numeric values, > some use DMA_BIT_MASK and various places uses local variables > or struct members to parse them, so finding them will be a bit > more work. Nothing a coccinelle expert couldn't solve, though :) Thing is unless we have a specific flag used consistently I don't believe we can do this search with Coccinelle. ie, if we have local variables and based on some series of variables things are set, this makes the grammatical expression difficult to express. So Cocinelle is not designed for this purpose. But I believe smatch [0] is intended exactly for this sort of purpose, is that right Dan? I gave a cursory look and I think it'd take me significant time to get such hunt down. [0] https://lwn.net/Articles/691882/ Luis