Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5935750ybv; Tue, 18 Feb 2020 06:47:19 -0800 (PST) X-Google-Smtp-Source: APXvYqwKEOQSj+zR3dmwPk7uw2C/Kx16Zn0ui8mlEM0sxh2NheL5McrQ38Y4JQlxUBm1nR5txLg2 X-Received: by 2002:a9d:171a:: with SMTP id i26mr11662520ota.202.1582037239745; Tue, 18 Feb 2020 06:47:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582037239; cv=none; d=google.com; s=arc-20160816; b=rPcsjAaPP5e+hOxOoPOB1S7JsIWSCDtHH22uWRUjEO8gg3HZRFACxRWqrqUQVCmhiX RP7LLZ26RT6iDbztJT7oeD6UYun09ztiE6QOv8rHu4wTJFF5FragPJ/wooovEJkMV/fl i7WCy3g645OFJcIBBlnOOrgMBbm0bfF4xNohMZ8kFHznDs30vq/EurwHsyhWWhtwmrbl 6D/EPZacvMp2FXxc6TEigb3xfDhPHBs0zHrimM7okeKeuowSDztyQeK2OdUYx9BVMHtz xSFnk3qGUQ9IZZI7kL/LPfhTg6hBa4tkV3VKwUkFmfd0FnVDFj/pK3vd/M0FItQigpz5 ib9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=jVEDhwBxa0Gv/fZY+PItUocb7mt1fBCKYzxEYj7kfMs=; b=tA6ee/0yElDpLbsqjaP0synxUiTPdWZj2txuRk7tk0NUMmUt92L7/bM16+GW9FLMVP hu20RO4rgkO931DJYoxhdjv9luyS/dNi2EIUfiPYoprVJblJ815h4OFtDj3SPZ3tvZjo 4mPrY8Y32Sxm68oS80FW0FviDBzMoX52ofqMmr6Mu+Edx4dkb9lyDIuTU7Z/Faae1vw2 06jhoVFu//0QbxnyJX8H9pQyxSdwNtSq+0E6/woc6RVy52HCZkOwJIYgMusBohUO57Ey ll/dyaWj7AJaI6DpMDMbdwVWddvXHrLwBHvg6n8x7rjTVkZ+YFjdzrz4vocenSHV0I3y gvOw== 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 13si7952696oiy.28.2020.02.18.06.47.07; Tue, 18 Feb 2020 06:47:19 -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 S1726762AbgBROrC (ORCPT + 99 others); Tue, 18 Feb 2020 09:47:02 -0500 Received: from foss.arm.com ([217.140.110.172]:53646 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726605AbgBROrC (ORCPT ); Tue, 18 Feb 2020 09:47:02 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 413291FB; Tue, 18 Feb 2020 06:47:01 -0800 (PST) Received: from e121166-lin.cambridge.arm.com (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EA7163F703; Tue, 18 Feb 2020 06:46:57 -0800 (PST) Date: Tue, 18 Feb 2020 14:46:53 +0000 From: Lorenzo Pieralisi To: "Pankaj Bansal (OSS)" Cc: Hanjun Guo , Marc Zyngier , Ard Biesheuvel , Makarand Pawagi , Calvin Johnson , "stuyoder@gmail.com" , "nleeder@codeaurora.org" , Ioana Ciornei , Cristi Sovaiala , Will Deacon , "jon@solid-run.com" , Russell King , ACPI Devel Maling List , Len Brown , Jason Cooper , Andy Wang , Varun Sethi , Thomas Gleixner , linux-arm-kernel , Laurentiu Tudor , Paul Yang , "netdev@vger.kernel.org" , "Rafael J. Wysocki" , Linux Kernel Mailing List , Shameerali Kolothum Thodi , Sudeep Holla , Robin Murphy Subject: Re: [PATCH] bus: fsl-mc: Add ACPI support for fsl-mc Message-ID: <20200218144653.GA4286@e121166-lin.cambridge.arm.com> References: <615c6807-c018-92c9-b66a-8afdda183699@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 18, 2020 at 12:48:39PM +0000, Pankaj Bansal (OSS) wrote: [...] > > > In DT case, we create the domain DOMAIN_BUS_FSL_MC_MSI for MC bus and > > it's children. > > > And then when MC child device is created, we search the "msi-parent" > > property from the MC > > > DT node and get the ITS associated with MC bus. Then we search > > DOMAIN_BUS_FSL_MC_MSI > > > on that ITS. Once we find the domain, we can call msi_domain_alloc_irqs for > > that domain. > > > > > > This is exactly what we tried to do initially with ACPI. But the searching > > DOMAIN_BUS_FSL_MC_MSI > > > associated to an ITS, is something that is part of drivers/acpi/arm64/iort.c. > > > (similar to DOMAIN_BUS_PLATFORM_MSI and DOMAIN_BUS_PCI_MSI) > > > > Can you have a look at mbigen driver (drivers/irqchip/irq-mbigen.c) to see if > > it helps you? > > > > mbigen is an irq converter to convert device's wired interrupts into MSI > > (connecting to ITS), which will alloc a bunch of MSIs from ITS platform MSI > > domain at the setup. > > Unfortunately this is not the same case as ours. As I see Hisilicon IORT table > Is using single id mapping with named components. > > https://github.com/tianocore/edk2-platforms/blob/master/Silicon/Hisilicon/Hi1616/D05AcpiTables/D05Iort.asl#L300 > > while we are not: > > https://source.codeaurora.org/external/qoriq/qoriq-components/edk2-platforms/tree/Platform/NXP/LX2160aRdbPkg/AcpiTables/Iort.aslc?h=LX2160_UEFI_ACPI_EAR1#n290 > > This is because as I said, we are trying to represent a bus in IORT > via named components and not individual devices connected to that bus. I had a thorough look into this and strictly speaking there is no *mapping* requirement at all, all you need to know is what ITS the FSL MC bus is mapping MSIs to. Which brings me to the next question (which is orthogonal to how to model FSL MC in IORT, that has to be discussed but I want to have a full picture in mind first). When you probe the FSL MC as a platform device, the ACPI core, through IORT (if you add the 1:1 mapping as an array of single mappings) already link the platform device to ITS platform device MSI domain (acpi_configure_pmsi_domain()). The associated fwnode is the *same* (IIUC) as for the DOMAIN_BUS_FSL_MC_MSI and ITS DOMAIN_BUS_NEXUS, so in practice you don't need IORT code to retrieve the DOMAIN_BUS_FSL_MC_MSI domain, the fwnode is the same as the one in the FSL MC platform device IRQ domain->fwnode pointer and you can use it to retrieve the DOMAIN_BUS_FSL_MC_MSI domain through it. Is my reading correct ? Overall, DOMAIN_BUS_FSL_MC_MSI is just an MSI layer to override the provide the MSI domain ->prepare hook (ie to stash the MC device id), no more (ie its_fsl_mc_msi_prepare()). That's it for the MSI layer - I need to figure out whether we *want* to extend IORT (and/or ACPI) to defined bindings for "additional busses", what I write above is a summary of my understanding, I have not made my mind up yet. As for the IOMMU code, it seems like the only thing needed is extending named components configuration to child devices, hierarchically. As Marc already mentioned, IOMMU and IRQ code must be separate for future postings but first we need to find a suitable answer to the problem at hand. Lorenzo