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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3B2BCC433F5 for ; Wed, 6 Apr 2022 15:52:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=WNzRBtq3sORLWpnKqvIcmC8YdwO25oBDrJUvtQPt0rs=; b=nAJAw974P9r5w3 glhw50L3DgqffxSi9ta/wQVEY1aubmqxoFeiSfkCssX/2MtX05Oem22iXAoXFMJ5ElEPmpLzUhTBx 0CG8yL852sL4coB0Sc2VMQ8b2q2DcgimslLvy+RHwZp5Ek3LxL8t2eUQSZe4/r+ELZs92N2VPA2Vk IRuoeWH2U6bagAQdjQhgOlFINbt7TpYB1OIsdKaSNS4KrOAosVF2JZ8Ti/WV0lf4isYZd0SoT0K/U GV9J3neVuJBLEH44GuvhEta+o+mrQoLUhL33JB+XFyOOltB6nsWu0mdLzQmy9owoF7Fi+xxWCU3ff heBvTQdJxSVp1ohEH8tg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nc7wN-006yZZ-Vp; Wed, 06 Apr 2022 15:51:28 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nc7wC-006yTU-9H for linux-arm-kernel@lists.infradead.org; Wed, 06 Apr 2022 15:51:18 +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 E1BC012FC; Wed, 6 Apr 2022 08:51:14 -0700 (PDT) Received: from lpieralisi (unknown [10.57.21.160]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BC8973F73B; Wed, 6 Apr 2022 08:51:12 -0700 (PDT) Date: Wed, 6 Apr 2022 16:51:13 +0100 From: Lorenzo Pieralisi To: Shameer Kolothum Cc: linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, iommu@lists.linux-foundation.org, linuxarm@huawei.com, joro@8bytes.org, robin.murphy@arm.com, will@kernel.org, wanghuiqiang@huawei.com, guohanjun@huawei.com, steven.price@arm.com, Sami.Mujawar@arm.com, jon@solid-run.com, eric.auger@redhat.com, laurentiu.tudor@nxp.com, yangyicong@huawei.com Subject: Re: [PATCH v9 07/11] ACPI/IORT: Add a helper to retrieve RMR info directly Message-ID: <20220406155113.GC27518@lpieralisi> References: <20220404124209.1086-1-shameerali.kolothum.thodi@huawei.com> <20220404124209.1086-8-shameerali.kolothum.thodi@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220404124209.1086-8-shameerali.kolothum.thodi@huawei.com> 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-20220406_085116_471102_988607E7 X-CRM114-Status: GOOD ( 17.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Apr 04, 2022 at 01:42:05PM +0100, Shameer Kolothum wrote: > This will provide a way for SMMU drivers to retrieve StreamIDs > associated with IORT RMR nodes and use that to set bypass settings > for those IDs. > > Signed-off-by: Shameer Kolothum > --- > drivers/acpi/arm64/iort.c | 29 +++++++++++++++++++++++++++++ > include/linux/acpi_iort.h | 8 ++++++++ > 2 files changed, 37 insertions(+) Reviewed-by: Lorenzo Pieralisi > diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c > index 1147387cfddb..fb2b0163c27d 100644 > --- a/drivers/acpi/arm64/iort.c > +++ b/drivers/acpi/arm64/iort.c > @@ -1402,6 +1402,35 @@ int iort_dma_get_ranges(struct device *dev, u64 *size) > return nc_dma_get_range(dev, size); > } > > +/** > + * iort_get_rmr_sids - Retrieve IORT RMR node reserved regions with > + * associated StreamIDs information. > + * @iommu_fwnode: fwnode associated with IOMMU > + * @head: Resereved region list > + */ > +void iort_get_rmr_sids(struct fwnode_handle *iommu_fwnode, > + struct list_head *head) > +{ > + iort_iommu_rmr_get_resv_regions(iommu_fwnode, NULL, head); > +} > +EXPORT_SYMBOL_GPL(iort_get_rmr_sids); > + > +/** > + * iort_put_rmr_sids - Free all the memory allocated for RMR reserved regions. > + * @iommu_fwnode: fwnode associated with IOMMU > + * @head: Resereved region list > + */ > +void iort_put_rmr_sids(struct fwnode_handle *iommu_fwnode, > + struct list_head *head) > +{ > + struct iommu_resv_region *entry, *next; > + > + iort_iommu_put_resv_regions(NULL, head); > + list_for_each_entry_safe(entry, next, head, list) > + kfree(entry); > +} > +EXPORT_SYMBOL_GPL(iort_put_rmr_sids); > + > static void __init acpi_iort_register_irq(int hwirq, const char *name, > int trigger, > struct resource *res) > diff --git a/include/linux/acpi_iort.h b/include/linux/acpi_iort.h > index eb3c28853110..774b8bc16573 100644 > --- a/include/linux/acpi_iort.h > +++ b/include/linux/acpi_iort.h > @@ -33,6 +33,10 @@ struct irq_domain *iort_get_device_domain(struct device *dev, u32 id, > enum irq_domain_bus_token bus_token); > void acpi_configure_pmsi_domain(struct device *dev); > int iort_pmsi_get_dev_id(struct device *dev, u32 *dev_id); > +void iort_get_rmr_sids(struct fwnode_handle *iommu_fwnode, > + struct list_head *head); > +void iort_put_rmr_sids(struct fwnode_handle *iommu_fwnode, > + struct list_head *head); > /* IOMMU interface */ > int iort_dma_get_ranges(struct device *dev, u64 *size); > int iort_iommu_configure_id(struct device *dev, const u32 *id_in); > @@ -47,6 +51,10 @@ static inline struct irq_domain *iort_get_device_domain( > struct device *dev, u32 id, enum irq_domain_bus_token bus_token) > { return NULL; } > static inline void acpi_configure_pmsi_domain(struct device *dev) { } > +static inline > +void iort_get_rmr_sids(struct fwnode_handle *iommu_fwnode, struct list_head *head) { } > +static inline > +void iort_put_rmr_sids(struct fwnode_handle *iommu_fwnode, struct list_head *head) { } > /* IOMMU interface */ > static inline int iort_dma_get_ranges(struct device *dev, u64 *size) > { return -ENODEV; } > -- > 2.25.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel