Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp756277yba; Fri, 26 Apr 2019 08:15:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2w92hrM+rVIeZd46Z7leEsEZCZu/pm6KN2fTVaTP430OMR/gg9PonzsuyjuK7tVZum2mQ X-Received: by 2002:a17:902:b68e:: with SMTP id c14mr48281094pls.49.1556291718023; Fri, 26 Apr 2019 08:15:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556291718; cv=none; d=google.com; s=arc-20160816; b=UQKm2gnFoXQk9zP9qQ9v3f6QAcVx8ArCUBUx9X6tTUFEcTdM6gRLzyQTWs04flPTmw hoFoeOsPrh7V+zz1sxe0/c34Z8I5YSeA0yl1Kxd9tFCGsX06dhpcJGqtDDcJCBJ/HCVs E5Omn2HGpFWBBGE4vBU/1pu8HW4ugM87x9napSU413yep1w7STeMJS1ea4qt41h95r7K YfRBUMTyUTJoYY5pk+yCe52QLmqPtwpV1lV7kienMwXWgkXnSEe750O2zlpJQpNCUCu5 az+xRRp23JzmOBrfrnzAPBZ8dME1J3RbdqgimxgA9gnaEVWOltnQI/KhnIYFHhQoKh1+ WrWQ== 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; bh=BimAwYFS5IViLE7PSYQe+NC4IHg0j9XRQ81KN6YjCfo=; b=Mp2pXOS6RoCTiJmBcN7xo8DHNNCwD+ZP8kE1u89em+dHhaJ3EPbe2mO55ybUheGAwd pH9o/ZpDc9QDNjHW+PPj+uewfi/JiDHYLf9ZwubayZFi/+oBV7091/lHTR/Lg8UQNJ5n 7VlmC1sPtA8LAVEf0xGycc+1onyR0NUJ2MlG2dbMHz+iKlXByr443z+BCbW9YuD/I8zf aB18kHCmkBBNpIOSE1ICpQ1mSRc7cCgccuzsY3cto+2+RWG/BNPfu8FxR37DtAvcZVVs 4iJJcLyKp31frMAWykzyA1rAd7ahBul73yOdlQ5bLNChfL+9l+iraCCd2HAVjCmI3xHJ UM3g== 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 l1si26349485plb.423.2019.04.26.08.15.02; Fri, 26 Apr 2019 08:15:18 -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 S1726322AbfDZPNr (ORCPT + 99 others); Fri, 26 Apr 2019 11:13:47 -0400 Received: from verein.lst.de ([213.95.11.211]:46642 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726169AbfDZPNq (ORCPT ); Fri, 26 Apr 2019 11:13:46 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 8230D227A81; Fri, 26 Apr 2019 17:13:30 +0200 (CEST) Date: Fri, 26 Apr 2019 17:13:30 +0200 From: Christoph Hellwig To: Laurentiu Tudor Cc: Christoph Hellwig , "robin.murphy@arm.com" , "m.szyprowski@samsung.com" , "iommu@lists.linux-foundation.org" , Leo Li , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH] dma-mapping: create iommu mapping for newly allocated dma coherent mem Message-ID: <20190426151330.GC20438@lst.de> References: <20190422165125.21704-1-laurentiu.tudor@nxp.com> <20190422181100.GB32490@lst.de> <20190424145705.GB21480@lst.de> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 25, 2019 at 11:30:54AM +0000, Laurentiu Tudor wrote: > > I think the first step is to move the two USB controller that can only > > DMA to their own BAR off the existing DMA coherent infrastructure. The > > controllers are already identified using the HCD_LOCAL_MEM flag, so we > > just need to key off that in the hcd_buffer_* routines and call into a > > So if HCD_LOCAL_MEM is set I should call into the gen_pool api instead > of existing dma_{alloc,free}_coherent(). Yes. > > genalloc that has been fed using the bar, replacing the current > > dma_declare_coherent usage. Take a look at drivers/pci/p2pdma.c > > for another example of allocating bits of a BAR using genalloc. > > Where should I place the reference to the gen_pool? How does local_pool > in 'struct hcd_usb' sound? Sounds fine to me, but in the end the usb maintainers will have to decide.