Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp920442ybi; Fri, 31 May 2019 10:46:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAAPG1Le6VoPO+yu+GxIdFg/32wJLSDyps0Nkat2FSVHa0RVj4V/hnoZ7JmreuqZ0Rh0vz X-Received: by 2002:a17:90a:9303:: with SMTP id p3mr10581334pjo.23.1559324798500; Fri, 31 May 2019 10:46:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559324798; cv=none; d=google.com; s=arc-20160816; b=tE6jqYR+1GyLuuxoDEWZ0oaqf/GTSbUPt/ENoncOSaMoGIAZOxs73qPL0mAKT+8Edt u16i/ifgqJ7+UdUKzdTWdux7RleIIyfxkz+E8Q+Pz+VopJORhH18ovMaZ53Y+U1U7Hma X+LvGFcJyBxD54YyHAnr8i97j5MWYYnPghwy1fzourcOeltfAxWw+jDh37SJ098Mc2Xm T3Qn5TWrHrKlZ93Grq6U2Q+IWmvNLEsXCGLrqtbDIS9u2L7Sfn4dLJKiDp4r7at7ak8/ Z/9sCyF67XPPofpfpfWBLAecDJd/1fsXIbPhgtJHhtFj5AbXjYuQf7oU9t5ReSW9Cebt IznA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=d3FUD3/NXqohYnmX8/FZrBv64xi3mfFk0C70k9oTZFQ=; b=AfT8fXbQTyfm3LqJFWhbIjIU8FpFt1QQFXXfloMjNw/N8rmr8QJH6I0ItqIye7b2Mv aeRVlUOD5Wcfp4tZoL37OCcgRAEtKI/pPokSMeRyofZATPd3sFfoeSVzJsyXj0WKp5tn 3FGagvFmusVM9pQs33JOxgjZ/dVhb3jdC5CLP8On5Z9Lxyj+IgnHLGVPjkvXQy0WieJo 44efRR0dEHofp8jPPI48NDOKcLWZ8uF16e1MMKsJp01/W80cRZoV5rUy3Zqm6bpSJt4N zDji8tXzJAbisl38iD+/I3dPqKd3s5lXN3jLD6W6vs813HE8sLGIudHsEd9uzU6k1Sgi wCXQ== 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 n63si6882386pgn.511.2019.05.31.10.46.19; Fri, 31 May 2019 10:46:38 -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 S1726635AbfEaRpF (ORCPT + 99 others); Fri, 31 May 2019 13:45:05 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:55710 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725934AbfEaRpF (ORCPT ); Fri, 31 May 2019 13:45:05 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E4D53A78; Fri, 31 May 2019 10:45:04 -0700 (PDT) Received: from [10.1.196.75] (e110467-lin.cambridge.arm.com [10.1.196.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DEB233F59C; Fri, 31 May 2019 10:45:01 -0700 (PDT) Subject: Re: [PATCH v3 0/6] Prerequisites for NXP LS104xA SMMU enablement To: Christoph Hellwig Cc: David Miller , madalin.bucur@nxp.com, netdev@vger.kernel.org, roy.pledge@nxp.com, linux-kernel@vger.kernel.org, leoyang.li@nxp.com, Joakim.Tjernlund@infinera.com, iommu@lists.linux-foundation.org, camelia.groza@nxp.com, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org References: <20190530141951.6704-1-laurentiu.tudor@nxp.com> <20190530.150844.1826796344374758568.davem@davemloft.net> <20190531163350.GB8708@infradead.org> <37406608-df48-c7a0-6975-4b4ad408ba36@arm.com> <20190531170804.GA12211@infradead.org> From: Robin Murphy Message-ID: <1b81c168-f5e0-f86a-f90e-22e8c3f2a602@arm.com> Date: Fri, 31 May 2019 18:45:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190531170804.GA12211@infradead.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31/05/2019 18:08, Christoph Hellwig wrote: > On Fri, May 31, 2019 at 06:03:30PM +0100, Robin Murphy wrote: >>> The thing needs to be completely redone as it abuses parts of the >>> iommu API in a completely unacceptable way. >> >> `git grep iommu_iova_to_phys drivers/{crypto,gpu,net}` >> >> :( >> >> I guess one alternative is for the offending drivers to maintain their own >> lookup tables of mapped DMA addresses - I think at least some of these >> things allow storing some kind of token in a descriptor, which even if it's >> not big enough for a virtual address might be sufficient for an index. > > Well, we'll at least need DMA API wrappers that work on the dma addr > only and hide this madness underneath. And then tell if an given device > supports this and fail the probe otherwise. Bleh, I'm certainly not keen on formalising any kind of dma_to_phys()/dma_to_virt() interface for this. Or are you just proposing something like dma_unmap_sorry_sir_the_dog_ate_my_homework() for drivers which have 'lost' the original VA they mapped? Robin.