Received: by 10.223.185.116 with SMTP id b49csp2719473wrg; Mon, 5 Mar 2018 07:40:07 -0800 (PST) X-Google-Smtp-Source: AG47ELswVNvmP9sagbgneYYSro5MJ8NYl0o5q9DFjzYNoILpmOpBBykxFt6L51InnZTWj4zxMWbz X-Received: by 2002:a17:902:2e04:: with SMTP id q4-v6mr13418464plb.22.1520264407747; Mon, 05 Mar 2018 07:40:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520264407; cv=none; d=google.com; s=arc-20160816; b=Vdo2yZ1POEkuW0SqafVIfD1T4AX7oP01VJjjJkn3+EE74B2DaBaJs1eIMIVOkGn7HT oNyG/aa7By5mUgP3vOHUORm3XvI55UdIq1fxac3a1RQ4DhGDmgdXgIriBtUVvnpARUa2 2CPc/YSl84Uc7KYyks0c3Y/idSQ+FPQxryx+C+zlNCQFXtOUsEojYt6gh+1t++wFdM0D vFBIvN2gwr2e2Tqb1ncPeG5QNGUWztBS/9GqQYAqJpPVMoUeKmksXqum1qLa+dzdX14x lFz3Oy/B3vuqF5q23z9mwu+Ux6vdH/ryKUi091ui63t9pa0EIjhKSQbzsBsLIhtOys9v devw== 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:arc-authentication-results; bh=SnrFVKNkFlxgHgNEKo9naTgZwSQyGMdbXAKTD7DXXCs=; b=rjqG+iG7b7M23R2ce97x+39VOg0WMfLfb20wgtCoh698IXjK3Tsi+GpjPBM56w3Fbb 8ZwYfELRFtPeMCqWCVh7XbPvn46iPyNeX6+nKXKu9Dl3nzUOtNRe37llO7dgTg4g1uMa MzTu43i+is9RehLOiKwurB9BsheyrAQh/f+MtUDFX3KlS5KSmK/CKn1vxRFkifBWIjOe Vv4tQoA0EuSwtJq9e6JX8oLTRlPRoRVBqjwsuiCZNKwdAFv02E0QaWCuV6GHzxLzi1jg 1A+ECq86vJosvIVPrGUx3iE9RCkqkumMY9JWYwp2FTkD4unuO6wuQS04VWd3ypp2um2c 6h9g== 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 e10si151014pgu.428.2018.03.05.07.39.52; Mon, 05 Mar 2018 07:40:07 -0800 (PST) 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 S1752307AbeCEPhf (ORCPT + 99 others); Mon, 5 Mar 2018 10:37:35 -0500 Received: from foss.arm.com ([217.140.101.70]:52258 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751392AbeCEPhd (ORCPT ); Mon, 5 Mar 2018 10:37:33 -0500 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 6B0F014; Mon, 5 Mar 2018 07:37:33 -0800 (PST) Received: from [10.1.210.88] (e110467-lin.cambridge.arm.com [10.1.210.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6D2F53F25C; Mon, 5 Mar 2018 07:37:30 -0800 (PST) Subject: Re: [PATCH 1/6] Docs: dt: add fsl-mc iommu-parent device-tree binding To: Nipun Gupta , "will.deacon@arm.com" , "mark.rutland@arm.com" , "catalin.marinas@arm.com" Cc: "iommu@lists.linux-foundation.org" , "robh+dt@kernel.org" , "hch@lst.de" , "m.szyprowski@samsung.com" , "gregkh@linuxfoundation.org" , "joro@8bytes.org" , Leo Li , "shawnguo@kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linuxppc-dev@lists.ozlabs.org" , Bharat Bhushan , "stuyoder@gmail.com" , Laurentiu Tudor References: <1520260166-29387-1-git-send-email-nipun.gupta@nxp.com> <1520260166-29387-2-git-send-email-nipun.gupta@nxp.com> <5cdeded1-ca3c-339a-bf73-73401e7dd4ed@arm.com> From: Robin Murphy Message-ID: Date: Mon, 5 Mar 2018 15:37:29 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: 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 05/03/18 15:00, Nipun Gupta wrote: > > >> -----Original Message----- >> From: Robin Murphy [mailto:robin.murphy@arm.com] >> Sent: Monday, March 05, 2018 20:23 >> To: Nipun Gupta ; will.deacon@arm.com; >> mark.rutland@arm.com; catalin.marinas@arm.com >> Cc: iommu@lists.linux-foundation.org; robh+dt@kernel.org; hch@lst.de; >> m.szyprowski@samsung.com; gregkh@linuxfoundation.org; joro@8bytes.org; >> Leo Li ; shawnguo@kernel.org; linux- >> kernel@vger.kernel.org; devicetree@vger.kernel.org; linux-arm- >> kernel@lists.infradead.org; linuxppc-dev@lists.ozlabs.org; Bharat Bhushan >> ; stuyoder@gmail.com; Laurentiu Tudor >> >> Subject: Re: [PATCH 1/6] Docs: dt: add fsl-mc iommu-parent device-tree binding >> >> On 05/03/18 14:29, Nipun Gupta wrote: >>> The existing IOMMU bindings cannot be used to specify the relationship >>> between fsl-mc devices and IOMMUs. This patch adds a binding for >>> mapping fsl-mc devices to IOMMUs, using a new iommu-parent property. >> >> Given that allowing "msi-parent" for #msi-cells > 1 is merely a >> backward-compatibility bodge full of hard-coded assumptions, why would >> we want to knowingly introduce a similarly unpleasant equivalent for >> IOMMUs? What's wrong with "iommu-map"? > > Hi Robin, > > With 'msi-parent' the property is fixed up to have msi-map. In this case there is > no fixup required and simple 'iommu-parent' property can be used, with MC bus > itself providing the stream-id's (in the code execution via FW). > > We can also use the iommu-map property similar to PCI, which will require u-boot > fixup. But then it leads to little bit complications of u-boot - kernel compatibility. What needs fixing up? With a stream-map-mask in place to ignore the upper Stream ID bits, you just need: iommu-map = <0 &smmu 0 0x80>; to say that the lower bits of the ICID value map directly to the lower bits of the Stream ID value - that's the same fixed property of the hardware that you're wanting to assume in iommu-parent. > If you suggest we can re-use the iommu-map property. What is your opinion? I think it makes a lot more sense to directly use the property which already exists, than to introduce a new one to merely assume one hard-coded value of the existing one. Extending msi-parent to msi-map was a case of "oops, it turns out we need more flexibility here"; for the case of iommu-map I can't imagine any justification for saying "oops, we need less flexibility here" (saving 9 whole bytes in the DT really is irrelevant). Robin.