From patchwork Fri Jul 4 13:42:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 4481191 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B3FAFBEEAA for ; Fri, 4 Jul 2014 13:45:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D4E59203E3 for ; Fri, 4 Jul 2014 13:45:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 096E7203C4 for ; Fri, 4 Jul 2014 13:45:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X33lt-0003IT-Ch; Fri, 04 Jul 2014 13:43:25 +0000 Received: from mail-wg0-x232.google.com ([2a00:1450:400c:c00::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X33lr-0003Ey-0U for linux-arm-kernel@lists.infradead.org; Fri, 04 Jul 2014 13:43:23 +0000 Received: by mail-wg0-f50.google.com with SMTP id x13so680921wgg.9 for ; Fri, 04 Jul 2014 06:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=T9H9MxYuvYo59PMuvIjUj0VMmxMirCbvo2bWX5O+bx0=; b=RT4URzyZs0HJzal+xF+xxHa4qnozoAEYZ/F1TEAuWti9tlbUQHea6tgSagJv8CWg1n HH2sHDJzgRhOvVx1cOShzSoz8sf2bZMhMni3yMH+rZUzDkJqpLmDQsn8VTnDlVdpnjFJ Sb3DfM0ZINsklZnQcUMLNDCJvEehDjklwIfonByLgnsFL9G3mSJlA8500R2sO729d5Lq 2I0r6gVWYSP3PpAsOZJwHwLUemu+lWc2f7BW7olAwv59enzCWK4KswdD39r4I7DqQ6cW 7OMGZ3sntKaoGevbYMhoxscsQJ5h4Q+eWgxr8tNKP8o+Gfrapxv8DmNF+0v6Eb+PAG2j mNWA== X-Received: by 10.194.185.238 with SMTP id ff14mr12628637wjc.9.1404481380286; Fri, 04 Jul 2014 06:43:00 -0700 (PDT) Received: from localhost (port-55131.pppoe.wtnet.de. [46.59.216.12]) by mx.google.com with ESMTPSA id l5sm79400706wif.22.2014.07.04.06.42.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jul 2014 06:42:59 -0700 (PDT) Date: Fri, 4 Jul 2014 15:42:57 +0200 From: Thierry Reding To: Laura Abbott Subject: Re: [PATCHv4 4/5] arm: use genalloc for the atomic pool Message-ID: <20140704134254.GA4142@ulmo> References: <1404324218-4743-1-git-send-email-lauraa@codeaurora.org> <1404324218-4743-5-git-send-email-lauraa@codeaurora.org> MIME-Version: 1.0 In-Reply-To: <1404324218-4743-5-git-send-email-lauraa@codeaurora.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140704_064323_210932_68ADA06E X-CRM114-Status: GOOD ( 19.41 ) X-Spam-Score: -0.8 (/) Cc: David Riley , Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Ritesh Harjain , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Jul 02, 2014 at 11:03:37AM -0700, Laura Abbott wrote: [...] > diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c [...] > index f5190ac..02a1939 100644 > --- a/arch/arm/mm/dma-mapping.c > +++ b/arch/arm/mm/dma-mapping.c > @@ -26,6 +26,7 @@ > #include > #include > #include > +#include Includes should be sorted alphabetically. I realize that's not the case for this particular file, but the downside of that is that your patch no longer applies cleanly on top of linux-next because some other patch did add linux/cma.h at the same location. > static int __init early_coherent_pool(char *p) > { > - atomic_pool.size = memparse(p, &p); > + atomic_pool_size = memparse(p, &p); > return 0; > } > early_param("coherent_pool", early_coherent_pool); > > + There's a gratuituous blank line her. I also need the below hunk on top of you patch to make this compile on ARM. Thierry diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index b323032f0850..460aaf965a87 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -1250,11 +1250,13 @@ static int __iommu_remove_mapping(struct device *dev, dma_addr_t iova, size_t si static struct page **__atomic_get_pages(void *addr) { - struct dma_pool *pool = &atomic_pool; - struct page **pages = pool->pages; - int offs = (addr - pool->vaddr) >> PAGE_SHIFT; + struct page *page; + phys_addr_t phys; + + phys = gen_pool_virt_to_phys(atomic_pool, (unsigned long)addr); + page = phys_to_page(phys); - return pages + offs; + return (struct page **)page; } static struct page **__iommu_get_pages(void *cpu_addr, struct dma_attrs *attrs) diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index a2487f12b2fc..764f53565958 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c @@ -441,7 +441,6 @@ remove_mapping: dma_common_free_remap(addr, atomic_pool_size, VM_USERMAP); destroy_genpool: gen_pool_destroy(atomic_pool); - atomic_pool == NULL; free_page: if (!dma_release_from_contiguous(NULL, page, nr_pages)) __free_pages(page, get_order(atomic_pool_size));