Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2190755imm; Thu, 27 Sep 2018 08:48:13 -0700 (PDT) X-Google-Smtp-Source: ACcGV612WG6TOlDZJ2CgM8JB3St7thbU0x6BdiPIFh6jJIvC4dQ/G1BtqEy85Hj1QX4f2yxNp769 X-Received: by 2002:a62:aa17:: with SMTP id e23-v6mr12084321pff.211.1538063293533; Thu, 27 Sep 2018 08:48:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538063293; cv=none; d=google.com; s=arc-20160816; b=D568bQCTWhqLYOVTF6Cf4zvw69ocsFEtnAXZcz5RIcmAeS+z6/4CNZtAPvyNlSmzCO M4Rnuv2uDiG6MVurfG6GY0xCWdjRtZYBA5XdoMadjtPuBA48vmqQXBrWS6M+O+J02ojv bEF019bqa9ftv+30zaGfEdmBNkEvFr0ijarroCCOKya9yf5x6vQlzPg6aFoScj6Rj2t4 6MkiMVN6QeDiDie+yBL1n0AhVhOId698gDPib9aEuIYe52aDdgfLt/STjkdsx5k+ZhEg SlgrVUpFx8xFAzwqs0ysRemUJsFHgaTXTeSKMJgnWXft9XK3cksE7tBatGa4e5iXfTdu M0UQ== 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:dkim-signature; bh=1zBh5mEOQ9Sv2VGO+pxtSOFZXimR6h4G5AnCYfbyTgg=; b=dW1rjaKn7xy72Uv06NfcvVO9Hj2VCJIH7Rzi/Fi0DLdDLBa5ytOzOdeXmvb0cCLMlh h2M944SWsF6bltckIpy/3aSqB43p30el5CBTndXEgZiuqLvD3w/++xTdoNblNXyUhC/k f7pd3BjvKouJEfMcKrDoHo2+tJSHGNUrO0rBXTV61h6uu5IUvx0FGXYe24Zssg6gF+R0 BWz5POQ2ImxbcDrOzoiQzkjkwBbOlmdr6+Lk6oNF60IwetbCUSOC13QEZrPyajTX+Fga Ea8OnojJtqyFeT0lRWfGcFw+sUTIQXYyB+Cs4BlYPuAgeTg4RNLxINtNle4kKk8yanL5 5fbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=V1R9PqrG; 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 k28-v6si2216353pgf.308.2018.09.27.08.47.56; Thu, 27 Sep 2018 08:48:13 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=V1R9PqrG; 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 S1728195AbeI0WGj (ORCPT + 99 others); Thu, 27 Sep 2018 18:06:39 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:43296 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727212AbeI0WGi (ORCPT ); Thu, 27 Sep 2018 18:06:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1zBh5mEOQ9Sv2VGO+pxtSOFZXimR6h4G5AnCYfbyTgg=; b=V1R9PqrGZHF3G+AZeUiNZ/5fy LkIz9JANZv7ShalJTnJQPx2AUnlMRFLqzmlHZQMYSfeCGD9hrlI9QVzKC3xWOiIz2LkW9AkHEHqdB /2rjlKSqJIj4/NR79zLXkuSpXdbJh3YIqpZ81iV9sgAiuX3lesRaVsLNeutXWldUm+6Yc+8ER4/ZK LipmNflAnXXHSW5r535MMV1fQyBtvhcaPgBpKYhTabdeLM3cJWRB0ttKpY2jWX/wAzh2rh4Avxk4J eCw3PMA0MvUUAl/MnYqEL8X2MdSoUKqoiZ5bONAW+UIh5CBFEOAEqpRq9LZ3cL0DmZ+bbwuJKQYop jsQvvLrMw==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5YVp-0006Hv-Hm; Thu, 27 Sep 2018 15:47:33 +0000 Date: Thu, 27 Sep 2018 08:47:33 -0700 From: Christoph Hellwig To: Guo Ren 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: <20180927154733.GA15985@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +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) > + if (DMA_ATTR_NON_CONSISTENT & attrs) > + BUG(); Please don't bug on unknown attributs, they can be safely ignored. > +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.