Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCB0CC43331 for ; Fri, 27 Mar 2020 03:31:26 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 89F2920722 for ; Fri, 27 Mar 2020 03:31:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 89F2920722 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 5D5D1261D5; Fri, 27 Mar 2020 03:31:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E-Q29w07bJBS; Fri, 27 Mar 2020 03:31:24 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 843CF26249; Fri, 27 Mar 2020 03:31:24 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 62F22C18DA; Fri, 27 Mar 2020 03:31:24 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id A8EB3C0177 for ; Fri, 27 Mar 2020 03:31:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 90B8C880C8 for ; Fri, 27 Mar 2020 03:31:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7n8fG72Cn6cG for ; Fri, 27 Mar 2020 03:31:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from huawei.com (szxga04-in.huawei.com [45.249.212.190]) by whitealder.osuosl.org (Postfix) with ESMTPS id 519A785C7D for ; Fri, 27 Mar 2020 03:31:21 +0000 (UTC) Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id EF603D7CE21F66CD2DAD; Fri, 27 Mar 2020 11:31:15 +0800 (CST) Received: from [127.0.0.1] (10.177.223.23) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Fri, 27 Mar 2020 11:31:11 +0800 Subject: Re: [PATCH v4 02/16] ACPI/IORT: Remove direct access of dev->iommu_fwspec To: Joerg Roedel , References: <20200326150841.10083-1-joro@8bytes.org> <20200326150841.10083-3-joro@8bytes.org> From: Hanjun Guo Message-ID: <82dea1be-4a2e-e914-c607-8aeb924eb36f@huawei.com> Date: Fri, 27 Mar 2020 11:30:53 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20200326150841.10083-3-joro@8bytes.org> Content-Language: en-US X-Originating-IP: [10.177.223.23] X-CFilter-Loop: Reflected Cc: Jean-Philippe Brucker , Joerg Roedel , Will Deacon , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Thierry Reding , linux-mediatek@lists.infradead.org, Andy Gross , Sudeep Holla , Matthias Brugger , Sean Paul , Robin Murphy X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On 2020/3/26 23:08, Joerg Roedel wrote: > From: Joerg Roedel > > Use the accessor functions instead of directly dereferencing > dev->iommu_fwspec. > > Tested-by: Hanjun Guo > Reviewed-by: Jean-Philippe Brucker > Signed-off-by: Joerg Roedel > --- > 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)) Should we check !err as well? Thanks Hanjun > + fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS; > } else { > int i = 0; > > _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu