Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5962194ybv; Tue, 18 Feb 2020 07:15:48 -0800 (PST) X-Google-Smtp-Source: APXvYqxM/2LEpEfs1mFyapYgP9k5sOh+KxezTlUTB2s2uo9nBDHYso63dtFU8DjcViGRRWVi8o5b X-Received: by 2002:a9d:2c2a:: with SMTP id f39mr15729560otb.301.1582038948394; Tue, 18 Feb 2020 07:15:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582038948; cv=none; d=google.com; s=arc-20160816; b=lUGc1oRCI1U7z5DZubIGAaefc9od7pIYzrFp3G8HACyFu1O5WR6JZcPNiyDP9yD/H3 ImZFE4zF5Ddb7jWA/8CSEhopsyOlmZwHkg36De+bb2gDlFFeNhA5NkLXafvUW71Nz5fb ZuO8RRHmeMWBwPKHir3OSFfS9Xr18eMat2U6UdTGrdJY9n5vig6r7rU8irlkCAWtGWmV lEMy5T2evtrmC+e5tAlZKz5plQLgQrI/xWv7DKgO8hu8SuGwvmkflIc65BTh+03ESxiU 4TfeIuEYS0r5MyA/Q/2uO2XTpE73zOcGGjX1q7DSxM+wDOIUZuyy8xQwZd9axQhf4zxx R18w== 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=Wagf6ZB931KUB7eRpZTr2SxlK9AwISXzS/qfuDM1OpU=; b=UjE4sZEGHWy2Xl5S7/Qxuzltax17bJIXJ/V8bdniPooFtJ/YRg84AixhGpD8fq2GEK Tmkgt2L5W8zeqDtSJznMHI+cX9qALgtIQEnjTOirN2nPXsTOY6OS7rOXDhvzvW6Fx700 JVLy0QDGlsUaJWtCoeucqP7XYawZI6dJEOVsDXEVto5sB9G2dctdw+jJ9qrce2k9as79 5YuQphkSAalQ65hyBT/yx9TZQ7h+UXMJbOxWD/2QIwG3vhgpjSgojApobMsAJCI8OxDL CYkaB1NAIdIjq9GCsNyGSVk7Uck0y2cbqLvof1U7DjkePTBUEL8cqMbORZDb1V3GJ/zZ 1JaA== 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 c7si1782151otf.87.2020.02.18.07.15.35; Tue, 18 Feb 2020 07:15:48 -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 S1726821AbgBRPP1 (ORCPT + 99 others); Tue, 18 Feb 2020 10:15:27 -0500 Received: from foss.arm.com ([217.140.110.172]:54082 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726761AbgBRPP1 (ORCPT ); Tue, 18 Feb 2020 10:15:27 -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 127B830E; Tue, 18 Feb 2020 07:15:26 -0800 (PST) Received: from [10.1.196.37] (e121345-lin.cambridge.arm.com [10.1.196.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8771B3F703; Tue, 18 Feb 2020 07:15:22 -0800 (PST) Subject: Re: [PATCH] bus: fsl-mc: Add ACPI support for fsl-mc To: Lorenzo Pieralisi , "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 References: <615c6807-c018-92c9-b66a-8afdda183699@huawei.com> <20200218144653.GA4286@e121166-lin.cambridge.arm.com> From: Robin Murphy Message-ID: <2762bb26-967d-3410-d250-a63d8d755d76@arm.com> Date: Tue, 18 Feb 2020 15:15:21 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200218144653.GA4286@e121166-lin.cambridge.arm.com> 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 18/02/2020 2:46 pm, Lorenzo Pieralisi wrote: > 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. I'm really not sure we'd need to go near any bindings - the IORT spec *can* reasonably describe "giant black box of DPAA2 stuff" as a single named component, and that's arguably the most accurate abstraction already, even when it comes to the namespace device. This isn't a bus in any traditional sense, it's a set of accelerator components with an interface to dynamically configure them into custom pipelines, and the expected use-case seems to be for userspace to freely reconfigure whatever virtual network adapters it wants at any given time. Thus I don't see that it's logical or even practical for firmware itself to be involved beyond describing "here's your toolbox", and in particular, basing any decisions on the particular way that DPAA2 has been shoehorned into the Linux driver model would almost certainly be a step in the wrong direction. IMO the scope of this issue belongs entirely within the implementation(s) of Linux's own abstraction layers. Robin. > As for the IOMMU code, it seems like the only thing needed i > 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 >