From patchwork Tue Sep 22 16:23:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Murphy X-Patchwork-Id: 7240881 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CBF419F32B for ; Tue, 22 Sep 2015 16:26:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 12571206F2 for ; Tue, 22 Sep 2015 16:26:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2C9F320672 for ; Tue, 22 Sep 2015 16:26:10 +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 1ZeQM8-0003SJ-8w; Tue, 22 Sep 2015 16:23:48 +0000 Received: from eu-smtp-delivery-143.mimecast.com ([146.101.78.143]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZeQM4-0003A3-QP for linux-arm-kernel@lists.infradead.org; Tue, 22 Sep 2015 16:23:46 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-7-4LFdWL1rRsGjpWtguE4alQ-1; Tue, 22 Sep 2015 17:23:19 +0100 Received: from [10.1.205.36] ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 22 Sep 2015 17:23:19 +0100 Subject: Re: [PATCH v2] iommu/io-pgtable-arm: Don't use dma_to_phys() To: Yong Wu , Will Deacon References: <59f4ebbf06e75a6176a366495211afd16d0048a3.1442507940.git.robin.murphy@arm.com> <1442566550.8145.156.camel@mhfsdcap03> <55FBEFBA.6000606@arm.com> <1442928308.17514.3.camel@mhfsdcap03> From: Robin Murphy Message-ID: <56018074.2010104@arm.com> Date: Tue, 22 Sep 2015 17:23:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1442928308.17514.3.camel@mhfsdcap03> X-OriginalArrivalTime: 22 Sep 2015 16:23:19.0730 (UTC) FILETIME=[FE5BD920:01D0F552] X-MC-Unique: 4LFdWL1rRsGjpWtguE4alQ-1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150922_092345_182266_5758729E X-CRM114-Status: GOOD ( 11.07 ) X-Spam-Score: -4.2 (----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "joro@8bytes.org" , "iommu@lists.linux-foundation.org" , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 22/09/15 14:25, Yong Wu wrote: [...] > About here: >> @@ -629,6 +626,11 @@ arm_lpae_alloc_pgtable(struct io_pgtable_cfg > *cfg) >> if (cfg->oas > ARM_LPAE_MAX_ADDR_BITS) >> return NULL; >> >> + if (cfg->iommu_dev->dma_pfn_offset) { > > Do we need change to : > if (!selftest_running && cfg->iommu_dev->dma_pfn_offset) { > > cfg->iommu_dev will be null while self test. Urgh, you're absolutely right. Must have been one of those days when I had loads of noisy debug in there and turned the self-tests off :( Will; since the branch hasn't gone anywhere yet, are you OK to take the below? Robin. ----->8----- From: Robin Murphy Date: Tue, 22 Sep 2015 14:52:27 +0100 Subject: [PATCH] fixup! iommu/io-pgtable-arm: Don't use dma_to_phys() Signed-off-by: Robin Murphy --- drivers/iommu/io-pgtable-arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index 1f08ce7..2ba2323 100644 --- a/drivers/iommu/io-pgtable-arm.c +++ b/drivers/iommu/io-pgtable-arm.c @@ -628,7 +628,7 @@ arm_lpae_alloc_pgtable(struct io_pgtable_cfg *cfg) if (cfg->oas > ARM_LPAE_MAX_ADDR_BITS) return NULL; - if (cfg->iommu_dev->dma_pfn_offset) { + if (!selftest_running && cfg->iommu_dev->dma_pfn_offset) { dev_err(cfg->iommu_dev, "Cannot accommodate DMA offset for IOMMU page tables\n"); return NULL; }