From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_DBL_ABUSE_MALW,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E24B9C33CB2 for ; Fri, 31 Jan 2020 11:06:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AE33420707 for ; Fri, 31 Jan 2020 11:06:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JCfZbcYV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE33420707 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IHmVcXxSOGxPbia7fwNtiuTXT91pA9unHpn3GoJ9iOo=; b=JCfZbcYVR+Ggj6 5vdJvNfQEGCjMLGZjpu6cYMfl4uMVH6SghM+ZOQZ22vxtqUv2NGde5FWv82fTzXvazXK00I0W74cp 17Iw/4IiD7GYQDtrCgUixtbyPR7bRjITuPbqSymRH5fjz8D10Lib2zy6x+0oclSOtYGKB4CUiGx4o ZU82FGDr/cKeWI16oPxZ2crjjoxAO//n1gq0kc6DlWfkNO0qWksfhLR6MWIiRavch85inctxJpglb 6e/EikLhCCZJijjBUEtY3n0lKPKpOE8rCvsyIrStvEY21sY39hwr3i//WejRu2kx9ETVAD/UHCQ2E ziYCkF7e/13GJ4GEbp6A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ixU84-0003Ow-GP; Fri, 31 Jan 2020 11:06:28 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ixU81-0003N0-0e for linux-arm-kernel@lists.infradead.org; Fri, 31 Jan 2020 11:06:27 +0000 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 D0A7231B; Fri, 31 Jan 2020 03:06:18 -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 976083F67D; Fri, 31 Jan 2020 03:06:15 -0800 (PST) Date: Fri, 31 Jan 2020 11:06:10 +0000 From: Lorenzo Pieralisi To: Makarand Pawagi Subject: Re: [EXT] Re: [PATCH] bus: fsl-mc: Add ACPI support for fsl-mc Message-ID: <20200131110610.GA32701@e121166-lin.cambridge.arm.com> References: <1580198925-50411-1-git-send-email-makarand.pawagi@nxp.com> <20200128110916.GA491@e121166-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200131_030625_148745_1423858A X-CRM114-Status: GOOD ( 28.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Calvin Johnson , "stuyoder@gmail.com" , "nleeder@codeaurora.org" , Ioana Ciornei , Cristi Sovaiala , "guohanjun@huawei.com" , "will@kernel.org" , "maz@kernel.org" , Pankaj Bansal , "jon@solid-run.com" , "linux@armlinux.org.uk" , "linux-acpi@vger.kernel.org" , "lenb@kernel.org" , "jason@lakedaemon.net" , Andy Wang , Varun Sethi , "tglx@linutronix.de" , "linux-arm-kernel@lists.infradead.org" , Laurentiu Tudor , Paul Yang , "netdev@vger.kernel.org" , "rjw@rjwysocki.net" , "linux-kernel@vger.kernel.org" , "shameerali.kolothum.thodi@huawei.com" , "sudeep.holla@arm.com" , "robin.murphy@arm.com" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jan 31, 2020 at 10:35:48AM +0000, 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. And that's by design. I don't know what the FSL bus is and I don't want to know, what I am telling you is that the ACPI code in the mainline is sufficient to support SBSA compliant HW and that's what we support with ACPI on ARM64. We won't hack the kernel (and ACPI tables) up to boot with ACPI on non-compliant platforms, I don't know how I can be any clearer than that. All is needed to configure the (platform dev/PCI->IOMMU->ITS) chain is in the ACPI/IORT specifications and again, that's by design, adding DSDT objects and hacking the kernel to make it work "like DT" won't cut it, you are solving the wrong problem here, boot this platform with a device tree, it is a problem that has been solved a long time ago and it is supported in the mainline kernel. Thanks, Lorenzo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel