Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2085179imm; Sat, 29 Sep 2018 10:05:07 -0700 (PDT) X-Google-Smtp-Source: ACcGV60zD4dUfDE4/xAYsxAFtE+SuP6WxCgkJFnc/jR9mF++q+zcrIrpfuJhM+j3hBgcl1vpOiNf X-Received: by 2002:a63:9712:: with SMTP id n18-v6mr3589949pge.69.1538240707453; Sat, 29 Sep 2018 10:05:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538240707; cv=none; d=google.com; s=arc-20160816; b=ExCL72uP/tEuLdy8CLDarOqOyaH9K66y3bpBwAbGIRWafQm2w/O/5TBETlvxHbBvra Qkv3oyZT05hU8DQJxSa1lL9TxYoaNBuEBwfUxESSHGCp3tZc6g4CL7dypfeaAlM537VN RMNxlP9vtpXEYV7cAU32oBMwrFlDrBU5Ke6av3EM1gcKyCJHS0pBfNMv27lXdK4un/bY 8jxzoU1sIXb75Nz+dbjJ25936B7J4nwdelVAgBY3RqoMWCUcF6WrvM44oUFMn+F7Lq0O InQYLZZALO5N1QSxOIAeE7xLwYStqOKD1kQf7vy4U0w7Fw6MZ4TMFs074Lv0iZzWxa4Y A8Jg== 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=Qx4Z4hJ0Cf92s15/Olbuh93A/NqOREhEy/69E5C7Fek=; b=q5pnSpzGANWpsYwU6Kb3UYOenPviwKQqx9WLCh5OuS+1UOzq+2dzC6cjDexS8rSjRI l/KHPaF5DbAmJRyfapseCGfcZB8+gyMszIeIutIfSWrTZgVPaunpL3RA7hn/thktTJr3 qbpcsQGXa3vySilrDGFRtdlNmtVVB89qmUY8nhf/pC17GyaW3j8NIhTqgIyNdNGfmPTs 5Y5mNPJR7Wt/8DqhuuoflrNmjUPNe5iKDQZFioJOSjqZXFZuQ/EhD2PwL2AOpgFtipAA 0BlfK3hgdhHFc5efq7dfy1+sF5yXDL53DHceRSjK5uvOO+9ab283ZptUSMWdLS1TKSbZ lGRA== 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 6-v6si1216128plb.230.2018.09.29.10.04.52; Sat, 29 Sep 2018 10:05:07 -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 S1728548AbeI2Xdk (ORCPT + 99 others); Sat, 29 Sep 2018 19:33:40 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:33400 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728377AbeI2Xdj (ORCPT ); Sat, 29 Sep 2018 19:33:39 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07670777|-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_---.CxVngT6_1538240657; Received: from localhost(mailfrom:ren_guo@c-sky.com fp:SMTPD_---.CxVngT6_1538240657) by smtp.aliyun-inc.com(10.147.40.233); Sun, 30 Sep 2018 01:04:17 +0800 Date: Sun, 30 Sep 2018 01:04:16 +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: <20180929170415.GD27796@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, I like 2th. > > + if (DMA_ATTR_NON_CONSISTENT & attrs) > > + BUG(); > > Please don't bug on unknown attributs, they can be safely ignored. No BUG(), return NULL. > > > +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. Ops ... BIG BUG, must be fixed immediately, thank you. Best Regards Guo Ren