From patchwork Tue May 26 18:53:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 225264 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.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLACK,USER_AGENT_GIT autolearn=unavailable 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 B7E03C433E2 for ; Tue, 26 May 2020 19:24:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8F09620888 for ; Tue, 26 May 2020 19:24:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590521073; bh=dEoJRVIXdZx8Bpu5GvIroeoIICrvc6cdlbgsrV+vVzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mF0sorxgfZXuAoOxHQIwhzXmtEufVmhKfhJVe7JIc/DuFg46pnSAI2fuTPcwchJ2w ebJhXjqNmMCph7iuK5IJeq+AhQMUmxLR+ByTroGCagO0mfsB/5cGAcpFC753IMG6wz PkDkv8pZdkSO3mzfZCJ4aazbzNexZB+685qCaLBA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391710AbgEZTHj (ORCPT ); Tue, 26 May 2020 15:07:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:36430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391709AbgEZTHj (ORCPT ); Tue, 26 May 2020 15:07:39 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 68D3020873; Tue, 26 May 2020 19:07:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590520058; bh=dEoJRVIXdZx8Bpu5GvIroeoIICrvc6cdlbgsrV+vVzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0CiEnfjhPvOzCsE2S9v8KP/GuvkYFRurl839qcGjx2hp9cdGBn82z1eV0t9/7S+RD EWNa2xgDbNeTfYl7Z3RmW0vNmVKhosHO7yexihIv0vnpY9I55DgV3/ZMkKHDP2g8WX xCS1i75iJexmDcE6q6bXR4rHGedImwYhOkhDyG0Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joerg Roedel , Qian Cai , Sasha Levin Subject: [PATCH 5.4 043/111] iommu/amd: Call domain_flush_complete() in update_domain() Date: Tue, 26 May 2020 20:53:01 +0200 Message-Id: <20200526183937.017341854@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526183932.245016380@linuxfoundation.org> References: <20200526183932.245016380@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Joerg Roedel [ Upstream commit f44a4d7e4f1cdef73c90b1dc749c4d8a7372a8eb ] The update_domain() function is expected to also inform the hardware about domain changes. This needs a COMPLETION_WAIT command to be sent to all IOMMUs which use the domain. Signed-off-by: Joerg Roedel Tested-by: Qian Cai Link: https://lore.kernel.org/r/20200504125413.16798-4-joro@8bytes.org Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/amd_iommu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index bc7771498342..32de8e7bb8b4 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -2386,6 +2386,7 @@ static void update_domain(struct protection_domain *domain) domain_flush_devices(domain); domain_flush_tlb_pde(domain); + domain_flush_complete(domain); } static int dir2prot(enum dma_data_direction direction)