From patchwork Tue May 26 13:01:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1298017 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49WYzl2DrZz9sSt; Tue, 26 May 2020 23:03:15 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1jdZEX-0005ip-TD; Tue, 26 May 2020 13:03:05 +0000 Received: from mail-pf1-f196.google.com ([209.85.210.196]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jdZDl-0005Cl-Qr for kernel-team@lists.ubuntu.com; Tue, 26 May 2020 13:02:17 +0000 Received: by mail-pf1-f196.google.com with SMTP id 23so10146410pfy.8 for ; Tue, 26 May 2020 06:02:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MVPVvoeJwKlqYg0T4UfIPTaiRTW2eNhqwaGJ0u55L5E=; b=cbA+Tl0HtSZyJg6O1KOlR6B3hxLxhF5Q6JrXS1gC6vQVKStfaiWj2iUpSPqM94nrhE OYmVANN5RPjm7e82xImC8/lVobL/IeNdIInrhZ1nMOSu5RrRe5xv5Av1pGWjfpQI6RyA 2aJJgtXIjsTvBC5FLmTtf2oXS8qCzo5F+R0XB0xMACMKBrX+tTiX+Dc3cIQDrK/Wfvba UvtRSARx2+Rdfkb5SJ5FaHZBP3wJuBJpSy7IwhesZiN8UK70v/wuJao70ObQIFeXYNMN yl2VBwckBpNDMuYlNrjghvx8WpFO8sTz3oiLho13fqUvZYeYZpJR2LP7jDnoDYnN8WWT s/xA== X-Gm-Message-State: AOAM531wUFNyVfkEHhRFE088WlxQV0m2tpi16iPMaKSI0mYNHyaF1OWE C1KH2MJ5Xf9ArBikzkxi9OXMVzJToXI= X-Google-Smtp-Source: ABdhPJwrkql+voIHcrc1W5M36DTETMFXK1LlmXy0w3pb7yjENGRHQXqasqotxBKL/XrP2nigxAoBjw== X-Received: by 2002:aa7:8ad0:: with SMTP id b16mr21262530pfd.129.1590498134615; Tue, 26 May 2020 06:02:14 -0700 (PDT) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id s94sm15918201pjb.20.2020.05.26.06.02.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 06:02:13 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 03/60][SRU][OEM-5.6] ACPI/IORT: Remove direct access of dev->iommu_fwspec Date: Tue, 26 May 2020 21:01:07 +0800 Message-Id: <20200526130204.238445-4-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200526130204.238445-1-vicamo.yang@canonical.com> References: <20200526130204.238445-1-vicamo.yang@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Joerg Roedel BugLink: https://bugs.launchpad.net/bugs/1876707 Use the accessor functions instead of directly dereferencing dev->iommu_fwspec. Signed-off-by: Joerg Roedel Tested-by: Hanjun Guo Reviewed-by: Jean-Philippe Brucker Link: https://lore.kernel.org/r/20200326150841.10083-3-joro@8bytes.org (cherry picked from commit 6990ec796a7470740e6fb108dd30948b1ac9beb9) Signed-off-by: You-Sheng Yang --- drivers/acpi/arm64/iort.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index ed3d2d1a7ae9..7d04424189df 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c @@ -1015,6 +1015,7 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev) return ops; if (dev_is_pci(dev)) { + struct iommu_fwspec *fwspec; struct pci_bus *bus = to_pci_dev(dev)->bus; struct iort_pci_alias_info info = { .dev = dev }; @@ -1027,8 +1028,9 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev) err = pci_for_each_dma_alias(to_pci_dev(dev), iort_pci_iommu_init, &info); - if (!err && iort_pci_rc_supports_ats(node)) - dev->iommu_fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS; + fwspec = dev_iommu_fwspec_get(dev); + if (fwspec && iort_pci_rc_supports_ats(node)) + fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS; } else { int i = 0;