Received: by 10.192.165.148 with SMTP id m20csp5021572imm; Tue, 24 Apr 2018 12:16:47 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Px+myIlMGbdfDPisM7fZTqNKXN4oXWmUwUt+iuQDr1klKAfV/57tNjf4h2uWCIHfhqJ0V X-Received: by 2002:a17:902:284b:: with SMTP id e69-v6mr25539379plb.240.1524597407283; Tue, 24 Apr 2018 12:16:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524597407; cv=none; d=google.com; s=arc-20160816; b=gdUFYaaLifSU8JdQKmDMDRX7KLPoj771GkQ1tSmZVXxtORj0bTgA5SbrYzZ0w71l9p uL/MBB+x4BGQ3o8hDq5DuuWdhW0E7eUmAkmxBZZmNIkM8NXJdN+nYBfJpsWPrvczoMUp Q7hzXA0POIMPBHHS+Cz9ulI+Pv92OxcXEp90tHD/FIgaJpNRIYwywI+H9pei1kTva25p e9nFUynZbld3RVyXn3FfHnOLeLR9A9yX6rs+/kWV+VDxVt0yltJoQ2afCiSbGlufvXNH 8bKq2olqtRbHFLOmgP0bdW3sik0QFGClmPbhaI5A7zAfz9GUOUrJtCgu+eNLeh5wa/hw QOTw== 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:arc-authentication-results; bh=s8kQuWO1c6rLUVsu5V21xJBifgI7/IQUC5XQT2CtngI=; b=EZb11aXhJ6xExmlDtddZv7XBF9VR2nS72HHzgnwjal/fcMmPZpeoEV/U9Vu0jPYNkZ JTQ8kUSMYPOVbcUPPYUPLuBikODtnAYN9VJtRnpzPWxS7rr0oWRl7ksKPCA6fEKd9qkV BUHWT2SeAvyI+QiInq1Di4V+KBOYPFOGJ6oCSVJfYzWzsB7qq+rikbpoMiMcPEu5bwhB cKACygQZBUXvk83RU+KD74RPHeMeDyOLC9P81l8ReC9+BHaj7Ym8OqQJxKOuwv5nW852 SiyvYBfAfSW2d1WJfdgiC0NhysMeUze0uGzoGLZ2YgxfdhjyKciXzx1r96oF7IOOfEtd O5ew== 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 r12si10489474pfd.193.2018.04.24.12.16.32; Tue, 24 Apr 2018 12:16:47 -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 S1751698AbeDXTPQ (ORCPT + 99 others); Tue, 24 Apr 2018 15:15:16 -0400 Received: from verein.lst.de ([213.95.11.211]:32796 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751417AbeDXTPK (ORCPT ); Tue, 24 Apr 2018 15:15:10 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id A3A4868DB7; Tue, 24 Apr 2018 21:16:40 +0200 (CEST) Date: Tue, 24 Apr 2018 21:16:40 +0200 From: Christoph Hellwig To: Greentime Hu Cc: Christoph Hellwig , linux-arch , Michal Simek , Vincent Chen , linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-hexagon@vger.kernel.org, linux-m68k@lists.linux-m68k.org, nios2-dev@lists.rocketboards.org, openrisc@lists.librecores.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux , linux-xtensa@linux-xtensa.org, Linux Kernel Mailing List Subject: Re: [PATCH 13/22] nds32: use generic dma_noncoherent_ops Message-ID: <20180424191640.GA32495@lst.de> References: <20180420080313.18796-1-hch@lst.de> <20180420080313.18796-14-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greentime, thanks for testing the patch! It looks like nds32 doesn't have a buildbot yet, so this code didn't even get syntax checkin, sorry. Below is the incremental fixes based on this thread. Can you check if my tree works if you just revert the "nds32: use generic dma_noncoherent_ops" commit? diff --git a/arch/nds32/kernel/dma.c b/arch/nds32/kernel/dma.c index 688f1a03dee6..48018275e7f4 100644 --- a/arch/nds32/kernel/dma.c +++ b/arch/nds32/kernel/dma.c @@ -330,7 +330,7 @@ void arch_sync_dma_for_device(struct device *dev, phys_addr_t paddr, void *addr = kmap_atomic_pfn(PHYS_PFN(paddr)); unsigned long start = (unsigned long)addr; - switch (direction) { + switch (dir) { case DMA_FROM_DEVICE: break; case DMA_TO_DEVICE: @@ -350,12 +350,12 @@ void arch_sync_dma_for_cpu(struct device *dev, phys_addr_t paddr, void *addr = kmap_atomic_pfn(PHYS_PFN(paddr)); unsigned long start = (unsigned long)addr; - switch (direction) { + switch (dir) { case DMA_TO_DEVICE: break; case DMA_FROM_DEVICE: case DMA_BIDIRECTIONAL: - cpu_dma_inval_range(start, end); + cpu_dma_inval_range(start, start + size); break; default: BUG();