Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp779617oof; Tue, 25 Sep 2018 04:40:24 -0700 (PDT) X-Google-Smtp-Source: ACcGV61J0piZ6CLV3RNUdySU2RvCU6iy11wBWLJ9lYJzoFD4vZk20dtm67X0fm44OwubYIZiSkeG X-Received: by 2002:a62:1314:: with SMTP id b20-v6mr720650pfj.230.1537875624233; Tue, 25 Sep 2018 04:40:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537875624; cv=none; d=google.com; s=arc-20160816; b=XWuIVRLwSqw9TCeCPd7Fi3yPm9ZbWmnTFJas4Bj4XpdFpGIOj6sSL1n3e/2EEgNp+4 iBtcCxfHqBs21dlwsw6bXUST/KXi7dXpi+B6k9CneD6fzrNybfLoSTymaLRbLt/roNiU 34+U15FTFF7N001HcaeqY5hxTseGL0y0MLIBMOQcSbD+YaH/op5rGCAIB1IJjhBN4MBk R8i8bCQAgNUisvUnQ02qWw0cdbWAM8hXX68eZ/E3x+k9n5s4WXlAGpsE15KIJIMRv1uM j0MZDuI+xkeUWXVUVrn1rKUZZUzaoqCl+9S4vVY6QgSDinGR3yho3FGr9fzK28GsT4yw eGeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=LkzR5S0wK5AU7yM1bkZGNOlAum5gRLKhRz1KRhTHaKE=; b=URiF5j+YtL2Pkw/JIIkO8lU4qTDJeDizLQsd0nLA+r47Y3Zl+qui/1/tjGzKDH2gj3 GeWoGNB7+cDeB1tCR9mGJaF9b946Rzo+smh5C6YUc6JIcGeENXh/et+d79T7x0SceZAS Vlx3JKy0XtgfXfJEisCZidqk2MGwd42VE/xdSD1uxi89b/koPOIlZp/CF3RaopDwCcNe 9xSZ2HRCP8rU7sBpwfIo8zIIbD1CwMVzQHmUIlPzHId6GZds8nlQvh33okkGfKiILBy3 2JOrQillqMNOS6nXluNzHDYLudgdT7YemTFLkVqlD5nb4dX6RCFWAqm6k5rKW5fisd2p MAlw== 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 l70-v6si2257817pga.498.2018.09.25.04.40.07; Tue, 25 Sep 2018 04:40:24 -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 S1728721AbeIYRqK (ORCPT + 99 others); Tue, 25 Sep 2018 13:46:10 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:45019 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726435AbeIYRqK (ORCPT ); Tue, 25 Sep 2018 13:46:10 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07463478|-1;CH=blue;FP=0|0|0|0|0|-1|-1|-1;HT=e01e01542;MF=ren_guo@c-sky.com;NM=1;PH=DS;RN=14;RT=14;SR=0;TI=SMTPD_---.Cve4qQ8_1537875504; Received: from localhost(mailfrom:ren_guo@c-sky.com fp:SMTPD_---.Cve4qQ8_1537875504) by smtp.aliyun-inc.com(10.147.43.230); Tue, 25 Sep 2018 19:38:25 +0800 Date: Tue, 25 Sep 2018 19:38:24 +0800 From: Guo Ren To: Arnd Bergmann Cc: Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring , Mark Rutland , Rob Herring , Stephen Rothwell , Linux Kernel Mailing List , DTML , linux-arch , c-sky_gcc_upstream@c-sky.com, gnu-csky@mentor.com, Greentime Hu Subject: Re: [PATCH V7 1/2] csky/dma: bugfix dma_sync_for_cpu/device Message-ID: <20180925113824.GA7183@guoren> References: <1ccf1bed89758a5a9b57ac2ce6d11ca898a1b9ae.1537276837.git.ren_guo@c-sky.com> <20180925094601.GA2102@guoren> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 25, 2018 at 11:59:48AM +0200, Arnd Bergmann wrote: > On Tue, Sep 25, 2018 at 11:46 AM Guo Ren wrote: > > > > On Mon, Sep 24, 2018 at 10:38:04PM +0200, Arnd Bergmann wrote: > > > On Tue, Sep 18, 2018 at 3:48 PM Guo Ren wrote: > > > > > > > > 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 > > > > > > Same comment as for the other patch: Explain why the original > > > version is wrong first. When giving a reference to some other > > > discussion, use the "Link" tag above your Signed-off-by line. > > > To point to a discussion on lkml, lore.kernel.org is the > > > recommended archive, so it would become > > > > > > Link: https://lore.kernel.org/lkml/20180518215548.GH17671@n2100.armlinux.org.uk/ > > Ok, I'll improve the comment: > > > > Fixup dma_mapping error in linux-4.19-rc3, and we must implement all > > DMA_TO_DEVICE/FROM_DEVICE/BIDIRECTIONAL for both sync_dma_for_device/cpu. > > The implementation of arch should follow the following rules: > > > > ... > > That seems ok, but it's better to start with a description of the problem > rather than the 'Fixup dma_mapping error in linux-4.19-rc3' part. > I would write this like: > > | The arch_sync_dma_for_cpu()/arch_sync_dma_for_device() > | implementation is broken for some combinations that end up > | in a BUG() instead of performing the necessary flushes. > | > | The implementation of arch should follow the following rules: > | ... > > The imperative 'Fix up dma_mapping error ...' is what belongs > into the subject line, and is ideally revisited at the end of the > changelog comment if you want to add more detail about what > you do. Nice tips, Thx. I'll continue to improve my comments. Best Regards Guo Ren