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 40E6EC19F53 for ; Tue, 30 Apr 2024 13:58:01 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bJv1l4rmcKxRunNBV93gsXJZZucTKGPTqwQo4CXnk50=; b=nL6srtkw7ygDDr 3U3seZZBXBSMpMRbHZYWG7zcUDpTyKJXryxDjCDnz0e0DeygTTYlpBHwu8q6C61hIj+lxBCy4zleT mYCVaiDu9jZIAFnKFvhqJZhRMyitEpo+s9Ag8dgmpf14z4jRewrbF/htZuxlMITypivlf22Tzz01d SAgIkgdetdiwjZhLRAzfhPFBYZ8m7OU8PLR2Jvihw03tNhX8DJis0d+eM/DuSjWumicncCPy2cPbj lWEDEtJUir79HwrdhFaFrXOjGr9hDEfOqJB7kYwyokD1ZfWlG9sDNcxnu8WFbCe7XeSIPxyyx6qHi ic9BoC/09fu39B/9SjaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1nzT-00000006clX-0zA4; Tue, 30 Apr 2024 13:57:51 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1nzQ-00000006cl5-0f5W for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2024 13:57:49 +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 D53042F4; Tue, 30 Apr 2024 06:58:11 -0700 (PDT) Received: from [10.1.196.40] (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7A8343F793; Tue, 30 Apr 2024 06:57:43 -0700 (PDT) Message-ID: <46eba57e-edbf-4fe5-8cc6-5fe11bf7aca0@arm.com> Date: Tue, 30 Apr 2024 14:57:42 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] iommu/of: Support ats-supported device-tree property To: Jean-Philippe Brucker , will@kernel.org, lpieralisi@kernel.org, kw@linux.com, robh@kernel.org, bhelgaas@google.com, krzk+dt@kernel.org, conor+dt@kernel.org, liviu.dudau@arm.com, sudeep.holla@arm.com, joro@8bytes.org Cc: nicolinc@nvidia.com, ketanp@nvidia.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, devicetree@vger.kernel.org References: <20240429113938.192706-2-jean-philippe@linaro.org> <20240429113938.192706-4-jean-philippe@linaro.org> From: Robin Murphy Content-Language: en-GB In-Reply-To: <20240429113938.192706-4-jean-philippe@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_065748_284736_D41800EE X-CRM114-Status: GOOD ( 15.71 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 29/04/2024 12:39 pm, Jean-Philippe Brucker wrote: > Device-tree declares whether a PCI root-complex supports ATS by setting > the "ats-supported" property. Copy this flag into device fwspec to let > IOMMU drivers quickly check if they can enable ATS for a device. I don't think this functionally conflicts with what I've got going on in this area at the moment, and although the way it fits around the other error handling seems a bit obtuse and clunky IMO, apparently that's the fault of the existing ACPI implementation, so for now, Reviewed-by: Robin Murphy > Signed-off-by: Jean-Philippe Brucker > Tested-by: Ketan Patil > --- > drivers/iommu/of_iommu.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c > index 3afe0b48a48db..082b94c2b3291 100644 > --- a/drivers/iommu/of_iommu.c > +++ b/drivers/iommu/of_iommu.c > @@ -105,6 +105,14 @@ static int of_iommu_configure_device(struct device_node *master_np, > of_iommu_configure_dev(master_np, dev); > } > > +static void of_pci_check_device_ats(struct device *dev, struct device_node *np) > +{ > + struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev); > + > + if (fwspec && of_property_read_bool(np, "ats-supported")) > + fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS; > +} > + > /* > * Returns: > * 0 on success, an iommu was configured > @@ -147,6 +155,7 @@ int of_iommu_configure(struct device *dev, struct device_node *master_np, > pci_request_acs(); > err = pci_for_each_dma_alias(to_pci_dev(dev), > of_pci_iommu_init, &info); > + of_pci_check_device_ats(dev, master_np); > } else { > err = of_iommu_configure_device(master_np, dev, id); > } _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel