From patchwork Mon May 10 14:17:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 433156 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp2896425jao; Mon, 10 May 2021 07:27:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDbsPZY0M0DxSgIpKphOJMkIKpeWz9NBvpB/zNjPBjUrcjciW9Vd6mUVAMCXnnk8XfEgse X-Received: by 2002:a05:6e02:102:: with SMTP id t2mr23229599ilm.182.1620656833716; Mon, 10 May 2021 07:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620656833; cv=none; d=google.com; s=arc-20160816; b=VszkeUboggd7y0JvjNbjJXK4KKra3EMEJ/P3FEaZ3mRmFfqVZraxJo2+e3RjWn9KkK dM8w8u6FR7pSavBSkMssBuxrkcayPqVzAj8jppmrwbiIkpqwg78VAmCGBV2jznm8awJM 0dT8ertFK4vT4oIUKlcn1eaoHt7iWRD22NobsQ99P6EyfgoP2WT6dn53e69r8L2n9/oZ tljFIPu0oCTUviXzFsMKyYw2or5mh4jWT/k3HmwkhhiaFtgr1Db9Q507XlCBZzS9yBGF bAcaos5Y2qd58fn8IorfKPyhTIyYMMWv3c9xo2kvDPcsHhL0zVX5Aa73E9C2DhSv2H7z Qc6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=SzCYQZ/VBH1JsO6cMEhAmAAnS29aBCeeOLJ6f21e8GQ=; b=A8Pi5lfGypJLpSjbtD7f4+AHv2dDm8HVxMAt+t4/fq3flA7dBt+yuE1xdiYEphDhA6 N+oL9QgNDbmLbXtcOqPhbhy9GzBNyz5Z2mex1D5fLrDLrdBjsnrUXBBocN2+e6XR1t7E EhMyhlGAYF8BQxDSCQ02k/7LUPs+Nah595Or9gyx/oAwINw5nuB0j0zqR0A/OQWrthS5 u3hFwjjbS+Jfj5769foIvRYOk8bqEQySs/7gAthcWtfBQWggkOyiOOylf557dpKltypt OnSVBFUkzQJxYc9EKH7I8NW/3as1fPv1p6A0X5Bx6xVr/YA0MC5CN1dbGUuVa8X7dpTQ Lxbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a13si13610863ilr.121.2021.05.10.07.27.13 for ; Mon, 10 May 2021 07:27:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241702AbhEJO2Q (ORCPT ); Mon, 10 May 2021 10:28:16 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2682 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238913AbhEJOZs (ORCPT ); Mon, 10 May 2021 10:25:48 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Ff39B6D7Yz1BKw3; Mon, 10 May 2021 22:19:58 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.498.0; Mon, 10 May 2021 22:22:27 +0800 From: John Garry To: , , , , CC: , , , , , , John Garry Subject: [PATCH v2 11/15] dma-iommu: Reconfig group domain Date: Mon, 10 May 2021 22:17:25 +0800 Message-ID: <1620656249-68890-12-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1620656249-68890-1-git-send-email-john.garry@huawei.com> References: <1620656249-68890-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Call iommu_reconfig_dev_group_dma() from iommu_setup_dma_ops() to reconfig the group domain, if necessary. Signed-off-by: John Garry --- drivers/iommu/dma-iommu.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.26.2 diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 574d7a901fd2..1d58c7a2d85d 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -1358,6 +1358,9 @@ void iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size) * underlying IOMMU driver needs to support via the dma-iommu layer. */ if (domain->type == IOMMU_DOMAIN_DMA) { + iommu_reconfig_dev_group_dma(dev); + /* domain may be stale ... */ + domain = iommu_get_domain_for_dev(dev); if (iommu_dma_init_domain(domain, dma_base, size, dev)) goto out_err; dev->dma_ops = &iommu_dma_ops;