Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp663239oof; Tue, 25 Sep 2018 03:02:11 -0700 (PDT) X-Google-Smtp-Source: ACcGV63QfEQTIymhplDYHrijdneFIduqp7PkA5mNYVXG5bFKJTNHPNjIo5zQBwLGA8L/cWG9lx20 X-Received: by 2002:a63:4443:: with SMTP id t3-v6mr332122pgk.102.1537869731897; Tue, 25 Sep 2018 03:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537869731; cv=none; d=google.com; s=arc-20160816; b=FheXFh6H/mK4vMYugwz2vNpDxTYzVZ/8XIr1FL1j5lK+pSHUdjhpxpp28zsvFD3isv JFoj3scU8JQoHhS9OfQKh1WAQFtypcxlL0qVzABponZWVmNsI8/pK30pgaR0luejuKiy KyvIDNuI+DXdCZyj8QkSGAjppkt0rqjL01ytDKn+qqP2HjBRaLtrFJhExuiadD5KR01g s9DLiNkcAeDOJr9LJv+DhXv2rV7okwFEYVV97rWCPPWDGXV1FPpjyu19dp2U6qfZm9qz hW+VHXZcTtqN0Oj7jLPRtwRocWfCL0SL3n+aPBBksu0E+EONYdrEaLnJcy0b48Dc9VUi y+3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=ojpoY/RW/BGU1Dxs0TXMFSXc2L/ph/XzGeGA11gBzBw=; b=dV91KeKgpcFTRgmbh6yHxexGojn8XzBf4cs8svqjCmgNXvjoaOyFGEhkQEpO89230l fQVjqgzKIg6jJFI++yJYq3VvKKQAItHlTOu5JUZjaNMkvLmg5QXvaWSyEsNbNmmrbRTt hc4203PxfmP4DKjDhsTUv8md99tAeEf4CK8baMXIC/5mcBQfVLhPkaOLpdBW8g1oHDfX qYz1//oiP1izrgU9jQ/Ehviypek4ZaFnxxe8g3Lf3WKxIpf0gbgNMbNvYyYfOJeKJe0k DmKCJf5LFc+ro/aqdTZ66y5NeLm3NYjMptvBXlDQcMYU+xB91zN8EUHeCzSSiBt4b5Qm WC/Q== 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 bf9-v6si2007503plb.507.2018.09.25.03.01.56; Tue, 25 Sep 2018 03:02:11 -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 S1728733AbeIYQGw (ORCPT + 99 others); Tue, 25 Sep 2018 12:06:52 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:44301 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726927AbeIYQGw (ORCPT ); Tue, 25 Sep 2018 12:06:52 -0400 Received: by mail-qt1-f194.google.com with SMTP id k38-v6so12642379qtk.11; Tue, 25 Sep 2018 03:00:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ojpoY/RW/BGU1Dxs0TXMFSXc2L/ph/XzGeGA11gBzBw=; b=raUWyuWL0fPEfNFSHodl70WMgTTIUkg3xRqf/pd9nDQjEExCGF/z13/etPj5kM454k nUFWLG5C/3VtyxgHiizQIxr9DV7/awIEPvsgsVpvBPpXIRxtQbg5I6sp404IXYKgC5kK rJMZeMDQnU/Ep4+t20OA/9wWU2q8QyWmRYkWM7mTn8lsUw4x7Xd8tZABw+wEEa7GStu8 ppTZR2V+ZuGU0RqI+WzS3QKjcxO/Wt9rQ3eH1cFUxA8m4zSM4+qzYix867iIi7AjXYet qjYhEKICDJn4AvNndtU5L21LdB7I5Lfb0BE0PpCSCaZlfCE0yelHnU199vFNKmaJnXRS lVSA== X-Gm-Message-State: ABuFfogyKylfXqpF2UlU9LrUAybIKmuKPEyjIxJvSC/FcOlOthiIbeDc 0F8kwNLTtMGwJCORBR7nhAhhfnLHkAHByEEf04I= X-Received: by 2002:aed:2bc6:: with SMTP id e64-v6mr171540qtd.132.1537869605174; Tue, 25 Sep 2018 03:00:05 -0700 (PDT) MIME-Version: 1.0 References: <1ccf1bed89758a5a9b57ac2ce6d11ca898a1b9ae.1537276837.git.ren_guo@c-sky.com> <20180925094601.GA2102@guoren> In-Reply-To: <20180925094601.GA2102@guoren> From: Arnd Bergmann Date: Tue, 25 Sep 2018 11:59:48 +0200 Message-ID: Subject: Re: [PATCH V7 1/2] csky/dma: bugfix dma_sync_for_cpu/device To: Guo Ren 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 Content-Type: text/plain; charset="UTF-8" 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: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. Arnd