Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp561397ybl; Fri, 31 Jan 2020 04:03:36 -0800 (PST) X-Google-Smtp-Source: APXvYqzl9QFptxpUxEGjiPxvmmgxD2OfW87TVjHgRhhrzoUw40zX2l/MZZBRPybf5+QIoUG+rvwG X-Received: by 2002:a9d:7083:: with SMTP id l3mr7069225otj.193.1580472216262; Fri, 31 Jan 2020 04:03:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580472216; cv=none; d=google.com; s=arc-20160816; b=EK3IAdUuDA5E722Csv52FAvZGVT5oDFuPPO0vunPQD4K0bPVglIfiiZeWYrPXiWeGA enK304fPUtQ9X07mZz2dWNhlF0nfyUsNLFr+g/U1sip/ChsjtSBMq/hkpybqF9sTbtHH dsehGA4aaB6sMz8q7A2/PWMsYgQSo+fwdW+AcvCAMSDZnivu4q38Kcfpv1c/SrEUVn81 m9GrE7Ra/DEDH0Fx31vjzvPw2MoNqc7O2emqL/z7FJA+hnGRWNZUmabjPdmQfX5TJHGt YBwImPOMIqwDYwQ3Pa3fMfXJ/oad/cq3LGdJL6fNxgRcFkbMDiQtvBD2W5mf1/vZK0Kx guSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=mbDxoFJm2oj+qhmVC/5UqLWBu4cSJFdbmCZh1//SVQ4=; b=KIMnXGFOcobPPRc2zz8lvwmPl+XaLCnTFd9FICTwsbDm9ApocS0BHYm2AhlwFVHgdP ClEHOkhsxlUoUshk3bfdif1o9UeKLC0IG9rubDG20j+XBhLFU7Ttws2jI9Fud7uYqEy7 zDvDn0NF6sT6JaaxznXOCxLrXO8wzcZQ0s9nmTRkLgL4BjQ+KXYLdV24UA65KSS39LCc XZbZBHtg1JGjc+hiJJth54SKQSJ+ZiWLnf8pCSfzSc8gQLa9gopxWkoqiq5ZDxIP/Q6s KSuo8V6QNgHZkgp21DUdmnSa+BmbAHUXcIR31SdGTRKfzdIE5DA1/RcGHbt5VH66wao3 FlUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mYoMDYgf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l20si4413687otd.292.2020.01.31.04.03.09; Fri, 31 Jan 2020 04:03:36 -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; dkim=pass header.i=@linaro.org header.s=google header.b=mYoMDYgf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728497AbgAaMCH (ORCPT + 99 others); Fri, 31 Jan 2020 07:02:07 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:34635 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728428AbgAaMCG (ORCPT ); Fri, 31 Jan 2020 07:02:06 -0500 Received: by mail-wm1-f67.google.com with SMTP id s144so8654298wme.1 for ; Fri, 31 Jan 2020 04:02:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mbDxoFJm2oj+qhmVC/5UqLWBu4cSJFdbmCZh1//SVQ4=; b=mYoMDYgfxsoqJFWW3pc1GvButWs7I+ctO4pZCarC+mZtnIJe0Gdqgy27ddJxZxcrz7 SVx7e5lutA81dKlggkTmmmtmSVncGLDGm0cC6fKfjlA0u6DzPGaoLKOEdiEu8oIvwOUT +1x0QGJQD7mIOcsV4HkaPQeHYUxlekwTim81WrJ50UNbhnGtjcOSdsxF8V5n9g7ndF4C 74zpfo3MZvg3Z8jbr0DqnZXLAoAU+CLGgVQmrV2UUQaaNtSZy204apfDLTeEZ9JAzQQw pEXULMN0WgEbIONtu00fIhLezf5FgM3nUMS84Vj5W2qW+vA+qYnJE4psO6bRKgt8WDHH 9sRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mbDxoFJm2oj+qhmVC/5UqLWBu4cSJFdbmCZh1//SVQ4=; b=p7Sas5ERRlGeyNQ9648rnbkT7SaziaRz8Q/D+WIi48NPjTbKHY7W8CKYyuVqbq8E8i TxOh3u9+/1/7AO1hXFDTrNAthGWPi3HalPs9EqOzchYaUKVWu0+JZwzrdtYl5NaD4mTa BkYD6VSb6kKg9DPcFdo+h/cHE/Yjmf2I49gLHtJddWFoYwz+txfcurZwG5iHhtjsX0kh e+Srt733WZCdA6TxwRh3rKgoAaKzuY3mvNKo4qP60dpTzPwdmcz96nEu7cI6OxQm1qWL MuhRcQ27CnMnnTTDRrkkMT0GxBNJ4D16chtSu337FLAPJKnFroUnl2Kp2LGpQjvf11yz csLA== X-Gm-Message-State: APjAAAU0hFeu1Yn5re0j/CQ32Ywza/NV/Nb9GzDcKdWAdvfUAtlhzGpi oyN0p/AlQw+gixsrIp4rKTfK2Zbu9WtJUVxisZyd9w== X-Received: by 2002:a05:600c:248:: with SMTP id 8mr11681147wmj.1.1580472123485; Fri, 31 Jan 2020 04:02:03 -0800 (PST) MIME-Version: 1.0 References: <1580198925-50411-1-git-send-email-makarand.pawagi@nxp.com> <20200128110916.GA491@e121166-lin.cambridge.arm.com> <12531d6c569c7e14dffe8e288d9f4a0b@kernel.org> In-Reply-To: <12531d6c569c7e14dffe8e288d9f4a0b@kernel.org> From: Ard Biesheuvel Date: Fri, 31 Jan 2020 13:01:51 +0100 Message-ID: Subject: Re: [EXT] Re: [PATCH] bus: fsl-mc: Add ACPI support for fsl-mc To: Marc Zyngier Cc: Makarand Pawagi , Calvin Johnson , stuyoder@gmail.com, nleeder@codeaurora.org, Ioana Ciornei , Cristi Sovaiala , Hanjun Guo , Will Deacon , Lorenzo Pieralisi , Pankaj Bansal , 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 , "" , "Rafael J. Wysocki" , Linux Kernel Mailing List , Shameerali Kolothum Thodi , Sudeep Holla , Robin Murphy Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 31 Jan 2020 at 12:06, Marc Zyngier wrote: > > On 2020-01-31 10:35, Makarand Pawagi wrote: > >> -----Original Message----- > >> From: Lorenzo Pieralisi > >> Sent: Tuesday, January 28, 2020 4:39 PM > >> To: Makarand Pawagi > >> Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; linux-arm- > >> kernel@lists.infradead.org; linux-acpi@vger.kernel.org; > >> linux@armlinux.org.uk; > >> jon@solid-run.com; Cristi Sovaiala ; > >> Laurentiu > >> Tudor ; Ioana Ciornei > >> ; > >> Varun Sethi ; Calvin Johnson > >> ; > >> Pankaj Bansal ; guohanjun@huawei.com; > >> sudeep.holla@arm.com; rjw@rjwysocki.net; lenb@kernel.org; > >> stuyoder@gmail.com; tglx@linutronix.de; jason@lakedaemon.net; > >> maz@kernel.org; shameerali.kolothum.thodi@huawei.com; will@kernel.org; > >> robin.murphy@arm.com; nleeder@codeaurora.org > >> Subject: [EXT] Re: [PATCH] bus: fsl-mc: Add ACPI support for fsl-mc > >> > >> Caution: EXT Email > >> > >> On Tue, Jan 28, 2020 at 01:38:45PM +0530, Makarand Pawagi wrote: > >> > ACPI support is added in the fsl-mc driver. Driver will parse MC DSDT > >> > table to extract memory and other resorces. > >> > > >> > Interrupt (GIC ITS) information will be extracted from MADT table by > >> > drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c. > >> > > >> > IORT table will be parsed to configure DMA. > >> > > >> > Signed-off-by: Makarand Pawagi > >> > --- > >> > drivers/acpi/arm64/iort.c | 53 +++++++++++++++++++++ > >> > drivers/bus/fsl-mc/dprc-driver.c | 3 +- > >> > drivers/bus/fsl-mc/fsl-mc-bus.c | 48 +++++++++++++------ > >> > drivers/bus/fsl-mc/fsl-mc-msi.c | 10 +++- > >> > drivers/bus/fsl-mc/fsl-mc-private.h | 4 +- > >> > drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c | 71 > >> ++++++++++++++++++++++++++++- > >> > include/linux/acpi_iort.h | 5 ++ > >> > 7 files changed, 174 insertions(+), 20 deletions(-) > >> > > >> > diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c > >> > index 33f7198..beb9cd5 100644 > >> > --- a/drivers/acpi/arm64/iort.c > >> > +++ b/drivers/acpi/arm64/iort.c > >> > @@ -15,6 +15,7 @@ > >> > #include > >> > #include > >> > #include > >> > +#include > >> > #include > >> > #include > >> > > >> > @@ -622,6 +623,29 @@ static int iort_dev_find_its_id(struct device > >> > *dev, u32 req_id, } > >> > > >> > /** > >> > + * iort_get_fsl_mc_device_domain() - Find MSI domain related to a > >> > +device > >> > + * @dev: The device. > >> > + * @mc_icid: ICID for the fsl_mc device. > >> > + * > >> > + * Returns: the MSI domain for this device, NULL otherwise */ struct > >> > +irq_domain *iort_get_fsl_mc_device_domain(struct device *dev, > >> > + u32 mc_icid) { > >> > + struct fwnode_handle *handle; > >> > + int its_id; > >> > + > >> > + if (iort_dev_find_its_id(dev, mc_icid, 0, &its_id)) > >> > + return NULL; > >> > + > >> > + handle = iort_find_domain_token(its_id); > >> > + if (!handle) > >> > + return NULL; > >> > + > >> > + return irq_find_matching_fwnode(handle, DOMAIN_BUS_FSL_MC_MSI); > >> > +} > >> > >> NAK > >> > >> I am not willing to take platform specific code in the generic IORT > >> layer. > >> > >> ACPI on ARM64 works on platforms that comply with SBSA/SBBR > >> guidelines: > >> > >> > >> https://developer.arm.com/architectures/platform-design/server-systems > >> > >> Deviating from those requires butchering ACPI specifications (ie IORT) > >> and > >> related kernel code which goes totally against what ACPI is meant for > >> on ARM64 > >> systems, so there is no upstream pathway for this code I am afraid. > >> > > Reason of adding this platform specific function in the generic IORT > > layer is > > That iort_get_device_domain() only deals with PCI bus > > (DOMAIN_BUS_PCI_MSI). > > > > fsl-mc objects when probed, need to find irq_domain which is associated > > with > > the fsl-mc bus (DOMAIN_BUS_FSL_MC_MSI). It will not be possible to do > > that > > if we do not add this function because there are no other suitable APIs > > exported > > by IORT layer to do the job. > > I think we all understood the patch. What both Lorenzo and myself are > saying is > that we do not want non-PCI support in IORT. > IORT supports platform devices (aka named components) as well, and there is some support for platform MSIs in the GIC layer. So it may be possible to hide your exotic bus from the OS entirely, and make the firmware instantiate a DSDT with device objects and associated IORT nodes that describe whatever lives on that bus as named components. That way, you will not have to change the OS at all, so your hardware will not only be supported in linux v5.7+, it will also be supported by OSes that commercial distro vendors are shipping today. *That* is the whole point of using ACPI. If you are going to bother and modify the OS, you lose this advantage, and ACPI gives you no benefit over DT at all.