Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp741040imm; Fri, 28 Sep 2018 06:09:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV60bNq5ZDgATaRqriI3SdeSk0VZzLJYU2mWiXIHihBCUHInzA5QGc1Cmi8q1HlqT0sFn4Ym3 X-Received: by 2002:a63:7744:: with SMTP id s65-v6mr15230073pgc.197.1538140192818; Fri, 28 Sep 2018 06:09:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538140192; cv=none; d=google.com; s=arc-20160816; b=mfeZsOnL8ZGXhQPzZG+gFS7n7PEpGnIlsiSQVYnY4opY8aZd1M439mZH+mbEQJ1bPM dpTAMXd+aJZidHtIO79TY50/R/xIpqOuUWs4ANirLTd6nDe8OBJJLYo1dC4M/K2I18E1 HJdC+5S9pIJi0fLs4fYTNBBjFKUsfQLPF8lW1YTJ8982oZrNzU/cW+ElBhyp4/mJHBMy dtSEbwfGTuqdOTIVfvXLQTkPRyB0C1LsLdKIRAw0XE/U3vBDmYvpCkvmJ0JueOBvUvrc nge+PIqyIAC8Sgg+w28hCCPSjNW98ffId58n5qkq0A0NhQ+PiSH60JmSndmwzE6+hDzz OmcQ== 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=c8UreTc0yyDeySbJbdOXbxkeRlRUO85A/PQYIBc3y/M=; b=ZtCCHZvj7O7llpu4vgQ5nJ0c7IywerO8NSzK2/Rhm4Hz0OY+2ntTsPfDP5wSxemZg8 QQrY9WrgCHT9mIewWfgXMY6Z888aCyMQ18ubPwP+PJmk5U6n3NSEPsulRfTcaC70koeJ cfM+watICJazmsAkHbqWil28ufGdxuScD2aQx75NLhMIYJ3YlikEUyRjiYMJjfFYovb/ n+aS2c4fXvtiw4HzOcHfezYRhHQ9akupHJGLp4QeYVZPIMLxMClGDC1mzoeKF4pn0fNU MW49hgVDLWZvJNfK80HHRaCusBT8tFilzNe64yN6T4HBPTzbdlSOVL0m1gy3izpnkwxT Zawg== 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 d1-v6si5018675pld.322.2018.09.28.06.09.36; Fri, 28 Sep 2018 06:09:52 -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 S1728921AbeI1TdG (ORCPT + 99 others); Fri, 28 Sep 2018 15:33:06 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:41815 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726586AbeI1TdF (ORCPT ); Fri, 28 Sep 2018 15:33:05 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.0767815|-1;CH=green;FP=0|0|0|0|0|-1|-1|-1;HT=e01l07423;MF=ren_guo@c-sky.com;NM=1;PH=DS;RN=18;RT=18;SR=0;TI=SMTPD_---.Cx.iGg-_1538140128; Received: from localhost(mailfrom:ren_guo@c-sky.com fp:SMTPD_---.Cx.iGg-_1538140128) by smtp.aliyun-inc.com(10.147.41.120); Fri, 28 Sep 2018 21:08:49 +0800 Date: Fri, 28 Sep 2018 21:08:48 +0800 From: Guo Ren To: Christoph Hellwig Cc: akpm@linux-foundation.org, arnd@arndb.de, daniel.lezcano@linaro.org, davem@davemloft.net, gregkh@linuxfoundation.org, jason@lakedaemon.net, marc.zyngier@arm.com, mark.rutland@arm.com, mchehab+samsung@kernel.org, peterz@infradead.org, robh@kernel.org, robh+dt@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, devicetree@vger.kernel.org, green.hu@gmail.com Subject: Re: [PATCH V6 07/33] csky: MMU and page table management Message-ID: <20180928130847.GA2082@guoren-Inspiron-7460> References: <20180927154733.GA15985@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180927154733.GA15985@infradead.org> 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 Thu, Sep 27, 2018 at 08:47:33AM -0700, Christoph Hellwig wrote: > > +static void *csky_dma_alloc_atomic( > > + struct device *dev, > > + size_t size, > > + dma_addr_t *dma_handle > > + ) > > Can you please use normal kernel coding style? Closing brace on the > same line, either two tab indents for the arguments or align them to the > first argument: > > static void *csky_dma_alloc_atomic(struct device *dev, size_t size, > dma_addr_t *dma_handle) > > or: > > static void *csky_dma_alloc_atomic(struct device *dev, size_t size, > dma_addr_t *dma_handle) Ok. > > > + if (DMA_ATTR_NON_CONSISTENT & attrs) > > + BUG(); > > Please don't bug on unknown attributs, they can be safely ignored. Ok. > > > +void arch_sync_dma_for_device(struct device *dev, phys_addr_t paddr, > > + size_t size, enum dma_data_direction dir) > > +{ > > + struct page *page = pfn_to_page(paddr >> PAGE_SHIFT); > > + unsigned long offset = paddr & ~PAGE_MASK; > > + unsigned long vaddr; > > + > > + if (PageHighMem(page)) > > + vaddr = (unsigned long) kmap_atomic(page); > > This isn't going to work as the size might be larger than PAGE_SIZE. Yes, you are right. I must fix it up. Thank you Best Regards Guo Ren