Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp20266ybt; Tue, 30 Jun 2020 13:57:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/lo1J3jLQcRSschdJMjUBqZcGDs76ma4teV0SMWRenDjUkIQgG/a05ufZTRnMj6AlwETM X-Received: by 2002:a17:906:a253:: with SMTP id bi19mr19081601ejb.338.1593550217639; Tue, 30 Jun 2020 13:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593550217; cv=none; d=google.com; s=arc-20160816; b=HRdP4uFs6Gkpo88y7Jic2uGFZFAWsuGYZnkgmExq6IqwOQmuIYFBojHdmCY8IrxT4i SLny1UNbrTzn6vr+G4KiANiapD2Y0KaRXO/8r0wxFEaKB+4ko+VzbSbeQ/GZexLid3K3 tNWnaiwSzjixo4EWQDz7Zez0Uwh8Mxe/IWYsQXL17QkwBdlYo8uDlEIlTujHOBVqDqWK lAPT/k2XYxwl+u17GsPCQCewMeR+GYg1lE29PnoH+nCExzjLO1neB7nH3j7yEJj3bahk VdBEGrV4XGxRGQbYFrosP/IxTEJ2Gs6y7Lkr/Dr8/Fi7qa6auq8PiSGarUUDEEmo0E3+ fplQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=NSo37Qb0oL3TJClVwPMiygr0t+oa9JglD9JeIRV3gD0=; b=yP+CYb8eBTBS5erIy0OPE0nhdfEh8E3FezU/rZxbOJL3/Gc401vw1qgkO+IZbReykq jaDAGc0J25I4KEKYB7v4v9xaAaOBcNA5OrG7dmsc4nd9P52x/SmS+puAMkuIHrgOUWu0 MY4tLLH9id7HPW2Tdr6hNE27MCWRNdTJuPTYNh02mK36A7Bf5DMKd6I+ntW71CDyPY24 UmoCEdxUVDgVWHgYdveF0+iHyWZPfinikLD4jPyvxcXtcW4WENoy3qCnPCaiYVbSxTy+ azVAzitE/LsuLv8hRRBy+SewaBL9lj8Fq02GxAjdPf42JQeYp5BS49LV3ia7Oiv1nZhn dpnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=oygIkTzD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j9si2269060ejk.711.2020.06.30.13.49.55; Tue, 30 Jun 2020 13:50:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=oygIkTzD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726139AbgF3TDP (ORCPT + 99 others); Tue, 30 Jun 2020 15:03:15 -0400 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:13495 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726055AbgF3TDP (ORCPT ); Tue, 30 Jun 2020 15:03:15 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 30 Jun 2020 12:02:24 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 30 Jun 2020 12:03:14 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 30 Jun 2020 12:03:14 -0700 Received: from [10.26.75.203] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 30 Jun 2020 19:03:07 +0000 Subject: Re: [PATCH v8 1/3] iommu/arm-smmu: add NVIDIA implementation for dual ARM MMU-500 usage To: Krishna Reddy CC: "joro@8bytes.org" , "will@kernel.org" , "robin.murphy@arm.com" , "linux-arm-kernel@lists.infradead.org" , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "linux-tegra@vger.kernel.org" , Thierry Reding , "Yu-Huan Hsu" , Sachin Nikam , Pritesh Raithatha , Timo Alho , Bitan Biswas , Mikko Perttunen , Nicolin Chen , Bryan Huntsman , "nicoleotsuka@gmail.com" References: <20200630001051.12350-1-vdumpa@nvidia.com> <20200630001051.12350-2-vdumpa@nvidia.com> <4037efc7-fbed-e8cf-dac7-212c65014e4e@nvidia.com> From: Jon Hunter Message-ID: <64ffa84f-a8cf-ae81-6306-b5d8b1ff0618@nvidia.com> Date: Tue, 30 Jun 2020 20:03:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1593543744; bh=NSo37Qb0oL3TJClVwPMiygr0t+oa9JglD9JeIRV3gD0=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=oygIkTzDFvzDTGmAiQUZwCNND//8nYEOd9JcPxruivrWwg5BWUi2yTMgqfW2Iq0N0 IR49MR/Eb2tRVzIXK9Mr9i8kpHyfDI4BohtIayTOdAFHUXKa8k5j2J6cx/xmwHdWf1 hBGMXWvkc/LBrRjZVqPpl47R0zaT1G+6kwgU6EZyjFX8TE4KMbrA/39DZzZjzIMIo4 ORQztpInF2vPs0KPzR1r0/mSYpqI5SFOLTqkj2IsURh/qhOlRXoWJ3e/HEMrj8A4jF uofGKmGbN4yRh+AfpwVDaRxJaJWdiPEY1SAkPaEjvj5VNYSw8Ojh1MAcHAAauhy4dt m6kv/m96gFH9w== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30/06/2020 18:16, Krishna Reddy wrote: >> OK, well I see what you are saying, but if we intended to support all 3 for Tegra194, then we should ensure all 3 are initialised correctly. > > The driver intend to support up to 3 instances. It doesn't really mandate that all three instances be present in same DT node. > Each mmio aperture in "reg" property is an instance here. reg = , , ; > The reg can have all three or less and driver just configures based on reg and it works fine. So it sounds like we need at least 2 SMMUs (for non-iso and iso) but we have up to 3 (for Tegra194). So the question is do we have a use-case where we only use 2 and not 3? If not, then it still seems that we should require that all 3 are present. The other problem I see here is that currently the arm-smmu binding defines the 'reg' with a 'maxItems' of 1, whereas we have 3. I believe that this will get caught by the 'dt_binding_check' when we try to populate the binding. >> It would be better to query the number of SMMUs populated in device-tree and then ensure that all are initialised correctly. > > Getting the IORESOURCE_MEM is the way to count the instances driver need to support. > In a way, It is already querying through IORESOURCE_MEM here. Yes I was wondering that. I think we just need to decide if the 3rd SMMU is optional or not. The DT binding should detail and min and max supported. Jon -- nvpublic