From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guo Ren Subject: Re: [PATCH V7 1/2] csky/dma: bugfix dma_sync_for_cpu/device Date: Tue, 25 Sep 2018 19:38:24 +0800 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 Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: linux-arch.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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Date: Tue, 25 Sep 2018 19:38:24 +0800 From: Guo Ren 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: Sender: linux-arch-owner@vger.kernel.org List-ID: 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 Message-ID: <20180925113824.kDxjt7h4ZRrjWpNTnVQ3ZjQUZg0B2CPIkC7DGOqAADE@z> 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