Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5256383imm; Tue, 18 Sep 2018 06:49:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaTgGOqSoWz0jII0041F/kR8lyj7i1K9jEQmIMzJWIIpGkWn+rh1Nw9sC06LdlABM1BUmsv X-Received: by 2002:a63:ba55:: with SMTP id l21-v6mr28215392pgu.399.1537278550068; Tue, 18 Sep 2018 06:49:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537278550; cv=none; d=google.com; s=arc-20160816; b=cC8R8Mp5QnQ9rlbbfk6t1HifDt8xI6ygQuXZ+8xP02jjN5ZlBmCvB32fRhCHaZiLgT kogYnf5YuidZV5l+V+Zxtk5kpffXwtdeNqNlkefDD4/2NBbwfwt2e1l2UXBTcFJ5W13T bL8llVCrIP6TshinaR3wVAU1lF2M8DkblZzNsVH4/iTN4wjPBIu/sEQTuvRn9K90KJ99 xak2h9nx/oX2bw/rEzKH7G2sKnMAUdxXqVtqOxeMoBbgItMzi770EtFo3yQ/qarrcoHp pCDIXRFR69IsQk+B6oFZA6ZQobZAdUczRHZteI2QycIwV6GeDWxtBwCckCKHbdHb2xOg rODQ== 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=LhOK9aXI9y+zQ/hpJymR8lbiOyjNCY+D/Zh33TDK+W45sqr1QAOo7Fr3KA01RZb2LT A6lF/mlue0g/2E87NfZ2nKxt94S94+lhdLntJRXoKo7kOFNslAQglt8vMt4qDY9BtUP4 Y5jiEJpBvTzE1ybgtomd37/DS5l8TDnS+R4Hl22+SYy92IgwD4WBzu0ZucVynYso1Ikp qpFlNGxdmXz91p1fyBTh/qt/pmfCVXci6mQ9i+jddtNwMZnpjBT6fX1DluDRltcRjC4U F4QVk72rUvHzHR9zNOXFTRxXV1J0JIC9ob1MR/GY3m4TC6dw7nLShGo6dlgYxMBJ2yF7 qkrw== 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 h17-v6si18583600pgj.214.2018.09.18.06.48.54; Tue, 18 Sep 2018 06:49:10 -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 S1729859AbeIRTVK (ORCPT + 99 others); Tue, 18 Sep 2018 15:21:10 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:57159 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729656AbeIRTVJ (ORCPT ); Tue, 18 Sep 2018 15:21:09 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.09498876|-1;CH=green;FP=7487995090241864675|1|1|1|0|-1|-1|-1;HT=e01e01454;MF=ren_guo@c-sky.com;NM=1;PH=DS;RN=15;RT=15;SR=0;TI=SMTPD_---.CsTi4vb_1537278498; Received: from localhost(mailfrom:ren_guo@c-sky.com fp:SMTPD_---.CsTi4vb_1537278498) by smtp.aliyun-inc.com(10.147.42.198); Tue, 18 Sep 2018 21:48:18 +0800 From: Guo Ren To: tglx@linutronix.de, jason@lakedaemon.net, marc.zyngier@arm.com, robh+dt@kernel.org, mark.rutland@arm.com, arnd@arndb.de, robh@kernel.org, sfr@canb.auug.org.au Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arch@vger.kernel.org, c-sky_gcc_upstream@c-sky.com, gnu-csky@mentor.com, green.hu@gmail.com, Guo Ren Subject: [PATCH V7 1/2] csky/dma: bugfix dma_sync_for_cpu/device Date: Tue, 18 Sep 2018 21:48:13 +0800 Message-Id: <1ccf1bed89758a5a9b57ac2ce6d11ca898a1b9ae.1537276837.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