Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp736307imm; Thu, 13 Sep 2018 07:02:42 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZTmYUZFDonmML9yEXFrQPTuwzkuvynIEpdMvfzhihcPCtUm23qq8QAMPDhnXBSu6QeDFA7 X-Received: by 2002:aa7:831b:: with SMTP id t27-v6mr7653844pfm.81.1536847362552; Thu, 13 Sep 2018 07:02:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536847362; cv=none; d=google.com; s=arc-20160816; b=PCptniON88Su0ga6F0wzp53vDdt5HX/vZMuLfs9B+kvrCwPwbUVc//OvLXx4F05nQc DwlqS9rWaNL2ukGDaqE10VWDRYoOSym/vO3bhNlYzruA1YUCMSqT4bHjsETOmXlQj+3n TlS/tNvvDWKAPP2jNQ45FQxGnHDpNz3hYfaSRZJG0XAWqcgEFsKcCnH/3drLD3Sy9kTR HruyDQ+S95i5w0VOOdlgI/mE9Cjuvb3OC+C7cCzrhrrmmUAdqDRKjKDseYhJn2lQv+xJ nkv9eBaDvyJG4spu+mm2GxlAjl1HXL1soI4yHwxDa0WK5Ws3lTbxfX6qg3shqS5aoyFY PO4A== 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=f4GNGHJeX7Q9q1SXN9GpFJoN2rjjU0DvxEKJW/M2I2A=; b=ZxOaaUTkA5PkUvc+VWFivAhXeA6F74H8ZLfVZsuz3mo8rt1lrieoqfaxyN2Wqrdm+a FkoF33hZbmMM1kpV9lorWYHM82jH/DgYoaROJHkIxgq2iQrqFxk7C6K34+irlof817FM EFZam5gbUPWd/Lhzrz99yVQlMlpLiBBmtfFrFC9CiD69afb6+AisAl2APkMgkEAIpf3S wJaiJx6hPb0o3ZUW1+/EgjHfBCrr8lUYIpAPfEr5Dqi+gOYCOMBN4coRLW+mS8BuMPWy U9nYkLTLPJiuolbVspVJ17bs6Z04ueYFKvA9XvENeumworIpPCpvRZ/Xjovpv+1t21JX 97xQ== 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 37-v6si4200651plq.316.2018.09.13.07.02.22; Thu, 13 Sep 2018 07:02:42 -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 S1731943AbeIMTLu (ORCPT + 99 others); Thu, 13 Sep 2018 15:11:50 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35162 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729933AbeIMTLt (ORCPT ); Thu, 13 Sep 2018 15:11:49 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 91963D2E; Thu, 13 Sep 2018 14:02:11 +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.18 115/197] iommu/omap: Fix cache flushes on L2 table entries Date: Thu, 13 Sep 2018 15:31:04 +0200 Message-Id: <20180913131846.148475608@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@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.18-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 @@ -550,7 +550,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); @@ -738,7 +738,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); /*