From mboxrd@z Thu Jan 1 00:00:00 1970 From: Baoquan He Subject: [PATCH v7 RESEND 09/12] iommu: Assign the direct mapped domain to group->domain Date: Mon, 2 Jan 2017 15:39:55 +0800 Message-ID: <1483342798-6542-10-git-send-email-bhe@redhat.com> References: <1483342798-6542-1-git-send-email-bhe@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1483342798-6542-1-git-send-email-bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: iommu@lists.linux-foundation.org In iommu_request_dm_for_dev(), devices of group have all been attached to newly created direct mapped domain. We should store the domain into group->domain so that it works for iommu_get_domain_for_dev() and get_domain(). Signed-off-by: Baoquan He --- drivers/iommu/iommu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index e5cb9b1..7ac0293 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -1625,6 +1625,7 @@ int iommu_request_dm_for_dev(struct device *dev) if (group->default_domain) iommu_domain_free(group->default_domain); group->default_domain = dm_domain; + group->domain = dm_domain; pr_info("Using direct mapping for device %s\n", dev_name(dev)); -- 2.5.5