From patchwork Thu Dec 19 16:30:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 182135 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp702319iln; Thu, 19 Dec 2019 08:31:29 -0800 (PST) X-Google-Smtp-Source: APXvYqwQUvvHTmpeZZ/Tm3us6vB/OqSdjN5MZd61VZ2ciHae6qbX+XJ+oUaL7IvQH3NwYxDGho0J X-Received: by 2002:aca:f1c2:: with SMTP id p185mr2539043oih.87.1576773089118; Thu, 19 Dec 2019 08:31:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576773089; cv=none; d=google.com; s=arc-20160816; b=um2OpTuAEox2A0HNqSgSXcGmNtbapPFhK3eU9v49mFbEsdyDggdxhL8/vYqykAkqXY UERlAw2E/ydpM99xC+j0xqC7lgT7+xJjI/CUm++3wJ+huoAj9r02WzCkXTmqTrKoTzdT W7z4EF4/rjSlfFUdqDT9LCUZHdV2hyubrz+Y8UNUUV+Z10OlTs09o/0CmETulM4KM7OS CehLyTj9FOGjmBG4HxiFqxExW+7JfyAHBiegjcIderFeRI0D6zpOeIToR33Keu+v0Ehm e9AVAEpTVWkSyh4k2fKAAiBMtJoysuyFH4R5yu6lP6q+g/sMq2YQG90ZqK2HYLmyNWIG Rafg== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SVox6K0aClSgQAj4ZePzlVYlKOAA5RM1JxWE0eeJ+CM=; b=YtqAozdug+eOaOHeDJILdcCXIzqAlU1g5iSho0zEG/pT4ZUHfVQDEtCgOERRa9NL6E /BCYiZPXV+rxjH9Ri4FlPO5yrNacY+Y4p0obTr064ZwfU1iNCZZqP0dsHfwrBCAu3HHM oqkYgRXaiRbVa9BS0xeH4vmDFJD3p9MR59HkeCzJ1pC62GnI4Ag2P0KwLu3Gi6cqCEDm 95c3f1UUxKS1s5CVtPOCz0plc29v4tumfhTgZiF10Fza6uXuqD07la5b7DRISvl+VmSJ vlyueoQL7u41ifJf3x19H4aJvNx56tsQzIkI2/MXkV0ISfIUk0fM/9b5ettO9AUwVgfX blgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KsJmWTGB; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-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 n25si2200080oij.175.2019.12.19.08.31.28; Thu, 19 Dec 2019 08:31:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-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=KsJmWTGB; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-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 S1726963AbfLSQb1 (ORCPT + 7 others); Thu, 19 Dec 2019 11:31:27 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:43176 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726906AbfLSQb0 (ORCPT ); Thu, 19 Dec 2019 11:31:26 -0500 Received: by mail-wr1-f67.google.com with SMTP id d16so6592418wre.10 for ; Thu, 19 Dec 2019 08:31:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SVox6K0aClSgQAj4ZePzlVYlKOAA5RM1JxWE0eeJ+CM=; b=KsJmWTGBulFgtHxInjLbvLy9PpRX0GteBfzNXmUrDZJrH+ZYaBQIa1dHh47VnHT3Us G2OJX3xgvKyS2XK3zuqcw1ZOXlKDVBJQRRMVF0nOr9xyj+lDw01Q6Jd6vR/rkeYccEHt yJOWYb/rjfBgXbMc7wgknxeamdVg+ZZN29ommW/LnpTHOjUz0VpuiDmfABbg1QOhKWEP BK79LYU2nE8gQz8QcvCdTDHowZsM7F9ia5UVAVVs4wcvu3pPH0s1tj25cZ4VQrLWBmC5 SAfWsR+i6gOKs+s2DrspT9Ahp+NfOeXnTsawx79CvIM08A0Wu8V+jAyezZPtTeJVSYeM zLKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SVox6K0aClSgQAj4ZePzlVYlKOAA5RM1JxWE0eeJ+CM=; b=OhD6875XFOTdtSgFcDdu9YHyE7P8K1tM0Wcq7fSviHmMHKLwyrz6/uNSNrPwpIIrTq o91cJeIjoGk2whtlJtRk8yewTzUeUaUb8mSyzL1uYcOI1ihZDSaFp15e3LwOGwFoKDX9 YeyROP8zkLf9bYRUvKA0ZdmgAV6dLTbMkqT8X29oxsuCQqKEVhpJGrqQkaDYFNvjmHRZ Kmv25BlX/ASCkrxm5r+jUqi9uESlfyY//9E0sFnWP0r8hKEFOq8CUWgqxPrXPiN6eGWB qhX+TPLSYAVMa6e25o/pc0gE3JTRDLIPpezW2CeXKzzj4E/CmjPI0yPaqsl4voKRFMIQ HfEA== X-Gm-Message-State: APjAAAX/bknP+w4kVqErlx04p4Xh3/OX27w1/BR21laTrgwUsFAYE8cY i83wW5iVWMURzP+fP+ZuQH05Jw== X-Received: by 2002:adf:eb48:: with SMTP id u8mr9977279wrn.283.1576773084271; Thu, 19 Dec 2019 08:31:24 -0800 (PST) Received: from localhost.localdomain (adsl-84-227-176-239.adslplus.ch. [84.227.176.239]) by smtp.gmail.com with ESMTPSA id u22sm7092068wru.30.2019.12.19.08.31.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 08:31:23 -0800 (PST) From: Jean-Philippe Brucker To: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, devicetree@vger.kernel.org, iommu@lists.linux-foundation.org Cc: joro@8bytes.org, robh+dt@kernel.org, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, guohanjun@huawei.com, sudeep.holla@arm.com, rjw@rjwysocki.net, lenb@kernel.org, will@kernel.org, robin.murphy@arm.com, bhelgaas@google.com, eric.auger@redhat.com, jonathan.cameron@huawei.com, zhangfei.gao@linaro.org Subject: [PATCH v4 04/13] ACPI/IORT: Parse SSID property of named component node Date: Thu, 19 Dec 2019 17:30:24 +0100 Message-Id: <20191219163033.2608177-5-jean-philippe@linaro.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219163033.2608177-1-jean-philippe@linaro.org> References: <20191219163033.2608177-1-jean-philippe@linaro.org> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Named component nodes in the IORT tables describe the number of Substream ID bits (aka. PASID) supported by the device. Propagate this value to the fwspec structure in order to enable PASID for platform devices. Acked-by: Hanjun Guo Reviewed-by: Eric Auger Reviewed-by: Jonathan Cameron Signed-off-by: Jean-Philippe Brucker --- drivers/acpi/arm64/iort.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) -- 2.24.1 diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index 33f71983e001..39f389214ecf 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c @@ -11,6 +11,7 @@ #define pr_fmt(fmt) "ACPI: IORT: " fmt #include +#include #include #include #include @@ -924,6 +925,20 @@ static int iort_pci_iommu_init(struct pci_dev *pdev, u16 alias, void *data) return iort_iommu_xlate(info->dev, parent, streamid); } +static void iort_named_component_init(struct device *dev, + struct acpi_iort_node *node) +{ + struct acpi_iort_named_component *nc; + struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev); + + if (!fwspec) + return; + + nc = (struct acpi_iort_named_component *)node->node_data; + fwspec->num_pasid_bits = FIELD_GET(ACPI_IORT_NC_PASID_BITS, + nc->node_flags); +} + /** * iort_iommu_configure - Set-up IOMMU configuration for a device. * @@ -978,6 +993,9 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev) if (parent) err = iort_iommu_xlate(dev, parent, streamid); } while (parent && !err); + + if (!err) + iort_named_component_init(dev, node); } /*