From patchwork Fri Nov 22 10:49:57 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: 180030 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp66550ilf; Fri, 22 Nov 2019 03:16:07 -0800 (PST) X-Google-Smtp-Source: APXvYqxb1m3D4aERnelZOLYYScSAuqSDh70jlXQAzu62nuOb9z93FM8YsOFojKxttIS4t514k/lh X-Received: by 2002:aa7:d1c2:: with SMTP id g2mr379129edp.164.1574421367741; Fri, 22 Nov 2019 03:16:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574421367; cv=none; d=google.com; s=arc-20160816; b=KAnhfagbkIBTCPRosqfQpGJS8LrAWf2Dv6OoVVqZsls9zYzevu/EY9odb0VyKeCWN8 dVbIbKzUnXJmsE8iJzShOTOsw5yuIW0i8C+OOxha59B1ggyT01SB4Ej2sEsSm54gZK76 KTVc3g0IgZ5BQnHsEza8tyanDUnIwuR+BQ/09njfGwk0vkgWK+R2r6/d1Gmy6y3/BshA xbI/Y0VnORe7ymyXKPM+NJHmU52O3cOxeDUfAuGz9S/CvAKM0UaZdoF6LTRLnQsSS7Mj DBeycVcqxkUZkJ5NXQy/JLZ31ED8ckzrXopxDNy6VAzFdGG4C2WDiKeQfdfE6kRj2bzd eSfw== 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=lDs5y1/lUK+eWeeJx//ERXKdVvxWdj4EMLwCwstQME4=; b=mcRxJTFlcea92a82KNEvXK2rnTqqB4Cvr6RiYGMXgltg8SCUZrgF9HiktC23xu73D9 MBXHrH7wIOmf/ddJbafoEkz/SNlV2XvNI0r2KcvkX5/HZi5wWPT6dKdMld0hYjyaG3vQ ucaq9XsITUB2/H3By0NkhOqTMLC18XO4C38bp9CggvP9calqH4+Ek1X5UmbMeXQEX1E0 gST1f0SlNRrgZlJ8B7o63KA4Jf3FhIK6owtmbSQY7vtP5AhTbnGVKp8gser9NV0ur74B MJrmPhhEcOfVdHS8NfekzcTIrB4XNXyXYtziJyF4E/jUXDhjjY3Reeb7qP/mKidyesHG Jb3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tZrmxDqs; 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 j6si3801343ejb.419.2019.11.22.03.16.07; Fri, 22 Nov 2019 03:16:07 -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=tZrmxDqs; 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 S1729763AbfKVKvI (ORCPT + 7 others); Fri, 22 Nov 2019 05:51:08 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:44406 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729512AbfKVKvH (ORCPT ); Fri, 22 Nov 2019 05:51:07 -0500 Received: by mail-wr1-f66.google.com with SMTP id i12so7991587wrn.11 for ; Fri, 22 Nov 2019 02:51:05 -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=lDs5y1/lUK+eWeeJx//ERXKdVvxWdj4EMLwCwstQME4=; b=tZrmxDqsZ1RxyI07RNeundpwyg3krx2pcdHCNpZvL3eVD3KsQ239cK0WPxnijQt1Sx Fs/hoURodhjYShc3UsRO8wvWP3TJghstOvwU0hqvTLFGlHfjPbK+N8DC9RWKjJr0OSfG U8/SeO0cY0wZsBiqU23iCYDvR8R/mftguKFjWVo1gq4EDGNowS6VNXbBbPpDaZ6ANKju QvHqIx0HkGQc9XfDWtkRsWeWzQvhDGRGubK/9H01T5zo/uIfdNyzFvyaivP26qcnRGV1 2W+UM6kD51rYLCCVA698kX5jZc+fgUZ9zv8aIXlsnfVKBPQMWGC6BGoWZw80BqSyjx13 75PQ== 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=lDs5y1/lUK+eWeeJx//ERXKdVvxWdj4EMLwCwstQME4=; b=mhQ4X9SERdSTyd/zhWX2q2QCkiS53r/m7oXKUTX4mKuTCofCy+8vMHglsQj/3vDZyc 3djiJ2Fz09W3PfNdxvCtrTEvGxkzubjUR36gJ7qNe5oAg+CNKjuvdbbzvWbuK82Jc82A 1UuZlibTskT2VSrAoGzFecZk+dV8yKmWgsvMN+A7pEe4Tt+gqckgfctEV8LF+R2K4S3l lfKHHxyQiprVEy9QXIopjtGAXhG5KL2BtL8AeGAfBLM4oBRBjUvR9NuAdj3KvqbvN2EP bCbvW95bCXeI1cPm3eZ0woToTsr6QpbB6VmEyUvVuziMKMUo8WJWvaywrZlertgtt9Vu x3+A== X-Gm-Message-State: APjAAAW4xJGTis55ro/TsHQpVKVQLdAdv/uSxa+ksH1ZFxOPU6T+8Y+u mVQ2BFHr/KpXe7sZUAxm6pQU6OICOes= X-Received: by 2002:adf:9f43:: with SMTP id f3mr17102828wrg.76.1574419864067; Fri, 22 Nov 2019 02:51:04 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-204-106.adslplus.ch. [188.155.204.106]) by smtp.gmail.com with ESMTPSA id o133sm2088197wmb.4.2019.11.22.02.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2019 02:51:03 -0800 (PST) From: Jean-Philippe Brucker To: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, virtualization@lists.linux-foundation.org, linux-pci@vger.kernel.org, virtio-dev@lists.oasis-open.org Cc: rjw@rjwysocki.net, lenb@kernel.org, lorenzo.pieralisi@arm.com, guohanjun@huawei.com, sudeep.holla@arm.com, gregkh@linuxfoundation.org, joro@8bytes.org, bhelgaas@google.com, mst@redhat.com, jasowang@redhat.com, jacob.jun.pan@intel.com, eric.auger@redhat.com, sebastien.boeuf@intel.com, kevin.tian@intel.com Subject: [RFC 10/13] iommu/virtio: Update IORT fwnode Date: Fri, 22 Nov 2019 11:49:57 +0100 Message-Id: <20191122105000.800410-11-jean-philippe@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122105000.800410-1-jean-philippe@linaro.org> References: <20191122105000.800410-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 When the virtio-iommu uses the PCI transport and the topology is described with IORT, register the PCI fwnode with IORT. Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/virtio-iommu.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.24.0 diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index 8efa368134c0..9847552faecc 100644 --- a/drivers/iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -7,6 +7,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include #include #include @@ -989,6 +990,8 @@ static int viommu_set_fwnode(struct viommu_dev *viommu) set_primary_fwnode(dev, fwnode); } + /* Tell IORT about a PCI device's fwnode */ + iort_iommu_update_fwnode(dev, dev->fwnode); iommu_device_set_fwnode(&viommu->iommu, dev->fwnode); return 0; } @@ -1000,6 +1003,8 @@ static void viommu_clear_fwnode(struct viommu_dev *viommu) if (!dev->fwnode) return; + iort_iommu_update_fwnode(dev, NULL); + if (is_software_node(dev->fwnode)) { struct fwnode_handle *fwnode = dev->fwnode;