Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp718990imm; Thu, 13 Sep 2018 06:47:18 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbHz+wENqBJ5OF6XOFKMvFohg+mLkwvA72UmE3kbdu4GEo6S+Tp59KnnM9lCbAbljt/8BOW X-Received: by 2002:a62:9ed1:: with SMTP id f78-v6mr7661444pfk.206.1536846438288; Thu, 13 Sep 2018 06:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536846438; cv=none; d=google.com; s=arc-20160816; b=VnmWmcGGw8yOnGLlXmoQ3uZpYIpVdFAH4x2beqz4IZPnUif+tIDM0CwPQnr5qbRqnA rGFHx5EVfceX7Glt9rrZf/hWrFFbnvTTB+9RvmLnSm0DuxlyL5SQKXt2TMLmrdLWPh4T XpWZRL4PvPo68ISeDlV+MapgWMGRxXzKtViPhonfWSHel2JUCGP7zSWJNoRGhguDPUax 6zYX6RPYMbX0n5wMJaapjvbPNRg2rjNOii5hPZTEMHKhKBlsAKL+f+zxDPNV9zk6QDhZ FoBhOC/wryX8z+9N+ktvIWD+xp838lIdVxGGmYR7cfhFVquopxPHRRz+ztJgO9Hidrrh RFEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=yQTK9mOI+CsuQuD7m9NWdtGyqvgt4YbVKXcPHVGaRrM=; b=uzsLtFndiwQrnoh8JcSNcRM2oh65lN4DQWryG1BfCyneTvZaYv1BN8n3GPhQZb/60i hwqUjf7wKUWZAqyCrkCxKsAEaoVn+DI6pv7hq7IRCgCANFsLspx8Y3Qa43QxAL9EJ13m D0wAkNy8lyGD2Im4H5RBIgzNy2sDPNT4hnT7iQt2bhpGeTYO8zIv5pUm4+JFzuRPDcHx vbzx26XHxA3CZFer5ismRjZmxVCKs0Kz23yRH92LJOlU6tVXDarFFS6Zs3igz2Yf04yL eAWFHH43L93batgxziAKzwNzOfjoFUEtbsrz9gVLz+NnwjhfxLyP9asvcAvjUA/O1aD8 KeXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2-v6si3860065pgp.256.2018.09.13.06.47.03; Thu, 13 Sep 2018 06:47:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729771AbeIMSzN (ORCPT + 99 others); Thu, 13 Sep 2018 14:55:13 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60724 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727391AbeIMSzM (ORCPT ); Thu, 13 Sep 2018 14:55:12 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 037C6D19; Thu, 13 Sep 2018 13:45:38 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Suman Anna , Ralf Goebel , Joerg Roedel , Sasha Levin Subject: [PATCH 4.14 068/115] iommu/omap: Fix cache flushes on L2 table entries Date: Thu, 13 Sep 2018 15:31:28 +0200 Message-Id: <20180913131827.894058131@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131823.327472833@linuxfoundation.org> References: <20180913131823.327472833@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ralf Goebel [ Upstream commit 04c532a1cdc7e423656c07937aa4b5c1c2b064f9 ] The base address used for DMA operations on the second-level table did incorrectly include the offset for the table entry. The offset was then added again which lead to incorrect behavior. Operations on the L1 table are not affected. The calculation of the base address is changed to point to the beginning of the L2 table. Fixes: bfee0cf0ee1d ("iommu/omap: Use DMA-API for performing cache flushes") Acked-by: Suman Anna Signed-off-by: Ralf Goebel Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/iommu/omap-iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -529,7 +529,7 @@ static u32 *iopte_alloc(struct omap_iomm pte_ready: iopte = iopte_offset(iopgd, da); - *pt_dma = virt_to_phys(iopte); + *pt_dma = iopgd_page_paddr(iopgd); dev_vdbg(obj->dev, "%s: da:%08x pgd:%p *pgd:%08x pte:%p *pte:%08x\n", __func__, da, iopgd, *iopgd, iopte, *iopte); @@ -717,7 +717,7 @@ static size_t iopgtable_clear_entry_core } bytes *= nent; memset(iopte, 0, nent * sizeof(*iopte)); - pt_dma = virt_to_phys(iopte); + pt_dma = iopgd_page_paddr(iopgd); flush_iopte_range(obj->dev, pt_dma, pt_offset, nent); /*