Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3131027imm; Mon, 24 Sep 2018 16:43:09 -0700 (PDT) X-Google-Smtp-Source: ACcGV62WAlqRbXOVSnyLBh8vz5vGXxJFcnbAQXO2m0HVOmy77TtAvnXoYh3lj9ftJY23kYITE7jM X-Received: by 2002:a17:902:b411:: with SMTP id x17-v6mr862464plr.248.1537832589125; Mon, 24 Sep 2018 16:43:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537832589; cv=none; d=google.com; s=arc-20160816; b=Tj87fnwjYpPxCRgpFWbZI8/t2qB/HUzEvlS63jh5jOZZroI+0PoTgkG19VF7rtFo5G iKsDi3mIjMchyL/vV76Ghq6rs0P15BwAwFY0fdWNPH7w+8zfIUbeSuAHKse6bD9KConf 1qcWVW7A5n9zbg1k1ruo0WuSoarJKyymp6xlJLkCnHliTcAmwZmlYWBA/6VCO8qWlc+d MyGf5ci/4jKMcGEFYItcApbxb/hoBN6U85+1NKG22Mq/8t193ax0N3uDJp+M0uR7prI5 FGsyYEgPqh1Zyg0BlDv7iPJx50NL9wZoQBI8xto1HMA9AG7SQvhPqWZCDZCkaUcbld+k gG1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from; bh=gc5emRsQKTbyRLL3YJlWvL6vB81b0CIF4SuaIHHnPp8=; b=nmO8wbPEC19YjCYsGNVZbO235QUs/XH7O/U+LcJ3TnNXHS0psxuN2R5hvrrnbJzog5 9y0TlR6EhP5ukCSv73ybfHkNwl9d56kiUa+EbXhbraFJyR7EoUdEFxKroJlpq1IKFkfB npUXA5ObaXsS0lHSyour6tUCzK5PeAY7YjMrVc/td22M+3DccQ/YePivZ0VKLYNoEZ8A u+63uNY5ba8EYv2pORnkjEB8geHdisjrF0kBHo0LSCVhSGAOyVHxle4ktTfdRuhlwTfS IuXQcrDXXsitOQNMqHp8CC6XZDHSQeuu4kDgsKKhzLH3v0iGQUxDBdVEc6OwmQjA6gmb JjrA== 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 a143-v6si629766pfd.241.2018.09.24.16.42.54; Mon, 24 Sep 2018 16:43:09 -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 S1728195AbeIYFpx (ORCPT + 99 others); Tue, 25 Sep 2018 01:45:53 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:52530 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725982AbeIYFpw (ORCPT ); Tue, 25 Sep 2018 01:45:52 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.09466494|-1;CH=blue;FP=7487994540486050787|1|1|14|0|-1|-1|-1;HT=e01e04463;MF=ren_guo@c-sky.com;NM=1;PH=DS;RN=19;RT=19;SR=0;TI=SMTPD_---.CvLsIvB_1537832457; Received: from localhost(mailfrom:ren_guo@c-sky.com fp:SMTPD_---.CvLsIvB_1537832457) by smtp.aliyun-inc.com(10.147.44.145); Tue, 25 Sep 2018 07:40:57 +0800 From: Guo Ren To: akpm@linux-foundation.org, arnd@arndb.de, daniel.lezcano@linaro.org, davem@davemloft.net, gregkh@linuxfoundation.org, jason@lakedaemon.net, marc.zyngier@arm.com, mark.rutland@arm.com, mchehab+samsung@kernel.org, peterz@infradead.org, robh@kernel.org, robh+dt@kernel.org, tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, devicetree@vger.kernel.org, green.hu@gmail.com, palmer@sifive.com, Guo Ren Subject: [PATCH V5 20/30] csky/dma: bugfix dma_sync_for_cpu/device Date: Tue, 25 Sep 2018 07:39:23 +0800 Message-Id: <1ccf1bed89758a5a9b57ac2ce6d11ca898a1b9ae.1537789737.git.ren_guo@c-sky.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ref: https://lkml.org/lkml/2018/5/18/1068 map for_cpu for_device unmap TO_DEV writeback none writeback none TO_CPU invalidate invalidate* invalidate invalidate* BIDIR writeback invalidate writeback invalidate Signed-off-by: Guo Ren --- arch/csky/mm/dma-mapping.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/csky/mm/dma-mapping.c b/arch/csky/mm/dma-mapping.c index 16c2087..30a2041 100644 --- a/arch/csky/mm/dma-mapping.c +++ b/arch/csky/mm/dma-mapping.c @@ -217,7 +217,8 @@ void arch_sync_dma_for_device(struct device *dev, phys_addr_t paddr, break; case DMA_FROM_DEVICE: case DMA_BIDIRECTIONAL: - BUG(); + dma_wbinv_range(vaddr + offset, vaddr + offset + size); + break; default: BUG(); } @@ -240,7 +241,7 @@ void arch_sync_dma_for_cpu(struct device *dev, phys_addr_t paddr, switch (dir) { case DMA_TO_DEVICE: - BUG(); + break; case DMA_FROM_DEVICE: case DMA_BIDIRECTIONAL: dma_wbinv_range(vaddr + offset, vaddr + offset + size); -- 2.7.4