Received: by 10.223.164.202 with SMTP id h10csp570178wrb; Wed, 8 Nov 2017 23:06:32 -0800 (PST) X-Google-Smtp-Source: ABhQp+TGEjHhi1CqxXG6vJRS2TuSnodb+r3aPHm1XIhkSEV5aMGTCiaiQLWk677pYVDzSGqJ3c2m X-Received: by 10.84.214.9 with SMTP id h9mr2812141pli.261.1510211192439; Wed, 08 Nov 2017 23:06:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510211192; cv=none; d=google.com; s=arc-20160816; b=FzJfb4DuWvJTeoHgW8JNIKbOLHXKtqsbHcbUEv7Xzb9RJJ+sK+I9Il3Wv+JEmdOoN7 LpoFh1D6ri7iL35RpvQ7IL0bj2sBeAiYLd6LPEQSJF0B4/t9SFAgahnOiJL8cHNro/zr LQ2vHS6xBjlg24r65E3KBf6ZSgjZHvyL9FG0VCbzUxSxjneh5vCc44nbKXZ9fHo1obr8 /krFVHMtEaiVOB1v+sWB3mQcRdTNSdgcJ1RBxVK5iEZv4RbbrlFOvC3C7RQAKUIV7Zxs J45di5QYNVBTNQM15ECd/pUSFNlnYFOQ1qfl6rGGLTsc0TfKSP+fKK6UYZu3ddE/lWFb NTQQ== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=SczLaxQgvKwMDYb0p/OjTZ9orSDCn9D+t4rAt4osTrE=; b=dDqn0pWFgsIjUXvS35CGkv+3v6tUl1YUae9zCBQonR8QB5oNGq+6eikRn7+noFyH8G NGRcsuRT+7AtoRhtLUwuAJZJx8OpqGdmjSlLW5DHrvkFKi1N/6MM31/oHYOO8Lh35Z3k sJOguDO/ZIs3rO4xAVBRYwloD5hzCf3ll4aqtEqSChietIQpcnkXmQBcgjMcSxEjDkUf iwg3kL+k8AHRXzdomhkdxvLFL2GO9G06thBeyq2v600I9LJ1Ssm/kowIVeJgOQHl5cYI 0SrPbHsuEfwXtwpn/ILbkUUdGQU1f7enmcWMnhCGIFRmAr2DhUojKAKSFDCZOhQgOvXn Qy2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WI9Oqcjw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t19si5295920plo.425.2017.11.08.23.06.21; Wed, 08 Nov 2017 23:06:32 -0800 (PST) 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=pass header.i=@gmail.com header.s=20161025 header.b=WI9Oqcjw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752653AbdKIHFo (ORCPT + 82 others); Thu, 9 Nov 2017 02:05:44 -0500 Received: from mail-ua0-f195.google.com ([209.85.217.195]:53086 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751225AbdKIHFk (ORCPT ); Thu, 9 Nov 2017 02:05:40 -0500 Received: by mail-ua0-f195.google.com with SMTP id p33so86604uag.9; Wed, 08 Nov 2017 23:05:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=SczLaxQgvKwMDYb0p/OjTZ9orSDCn9D+t4rAt4osTrE=; b=WI9OqcjwF71hozePLrEy+93it2Anmh2DRikOzXoS3yHsI4VfAC0eWWEthrYNx3pZSe efWH7aMluvsHPA9rTcGOfZ6tjo4nKzv7L/Qt9TJpJh7Xq07LGJvpM37KLlcTVWnykXH3 X0LWLurCKa+R43H9wZ42AP9ekZed+b8SRGpufSWNtKNkOeIAXQ0pp3GcJoyV4HoXQPyx AY8y2yZ50vADoOkJ8ZICSk5n/Vp+N5ypcgV4tIVeNW/TRpFwu6RAK5WBq07Ua+EM/ZVg LOCPoSVnUS3EsMM77fDOfQu2iH8ys+RmOgCmcjnwsJK5UPBkUpH/HdXfdX79d9Ucox1f V88Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=SczLaxQgvKwMDYb0p/OjTZ9orSDCn9D+t4rAt4osTrE=; b=AkvW+zr9EOgZl9V5nx2wm2Z7N6wdJvqjGpmSjkSel0ANNpMBTxJOXM+guPWugm5of4 x+loifD9pqX0JrZjhhq4M9uEZdJ0AB7WI9FL41LIc+RhYFLXGgALc8905jSpQgJ6Zi1k yF21wR+w4KBdSvYlsKQiKnxquU9D0FwcdleAvJW6o8P2nCtRTKH8P/Ou6gjleZQm7jkd L+syHIgCvhnh92WXtKJJinfh4KZknMw4QHvO9eYnsTdsKUqeKJB6sbXCrzmrOvVVFpHh bau/gPYfzk7SqB7TNKTERMg30n3hVGMlmm8cGsgGQZhDpEcIZPtCVNZi2Y59b1g7Ru6s z1rg== X-Gm-Message-State: AJaThX7dHjnDV8kRW1ort41uKgNpC1z3LGpXzU0RwjctbhGNzIvH24+I 17RDCxkQuaTTa8/BJrXSFducE3+GpMDadw81Nq4= X-Received: by 10.176.21.174 with SMTP id i43mr2542552uae.142.1510211139657; Wed, 08 Nov 2017 23:05:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.159.62.8 with HTTP; Wed, 8 Nov 2017 23:04:59 -0800 (PST) In-Reply-To: References: <4e9acf2ec55fb26ddb290ca2d955eeea628e0a77.1510118606.git.green.hu@gmail.com> From: Greentime Hu Date: Thu, 9 Nov 2017 15:04:59 +0800 Message-ID: Subject: Re: [PATCH 12/31] nds32: Device specific operations To: Arnd Bergmann Cc: Greentime , Linux Kernel Mailing List , linux-arch , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring , Networking , Vincent Chen , deanbo422@gmail.com 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 2017-11-08 17:04 GMT+08:00 Arnd Bergmann : > On Wed, Nov 8, 2017 at 6:55 AM, Greentime Hu wrote: > >> + >> +#define ioremap(cookie,size) __ioremap(cookie,size,0,1) >> +#define ioremap_nocache(cookie,size) __ioremap(cookie,size,0,1) >> +#define iounmap(cookie) __iounmap(cookie) > >> +#include > > asm-generic/io.h now provides an ioremap_nocache() helper along with > ioremap_uc/ioremap_wc/ioremap_wt, so I think you can remove the > ioremap_nocache definition here. You might also be able to remove > __ioremap and __iounmap, and only provide ioremap/iounmap, plus > the identity macro 'define ioremap ioremap' Thanks. I will try to use generic ioremap_nocache() helper in the next version patch. >> +void __iomem *__ioremap(unsigned long phys_addr, size_t size, >> + unsigned long flags, unsigned long align) > > The 'align' argument is unused here, and not used on other architectures > either. > Thanks. I will remove this argument in the next version patch. >> +{ >> + struct vm_struct *area; >> + unsigned long addr, offset, last_addr; >> + pgprot_t prot; >> + >> + /* Don't allow wraparound or zero size */ >> + last_addr = phys_addr + size - 1; >> + if (!size || last_addr < phys_addr) >> + return NULL; >> + >> + /* >> + * Mappings have to be page-aligned >> + */ >> + offset = phys_addr & ~PAGE_MASK; >> + phys_addr &= PAGE_MASK; >> + size = PAGE_ALIGN(last_addr + 1) - phys_addr; >> + >> + /* >> + * Ok, go for it.. >> + */ >> + area = get_vm_area(size, VM_IOREMAP); > > Better use get_vm_area_caller here to have the ioremap areas show up > in a more useful form in /proc/vmallocinfo Thanks. I will use get_vm_area_caller() in the next version patch. > Please also have a look at what you can do for memremap(). > > Since you have no cacheable version of ioremap_wb/wt, it will > return an uncached mapping all the time, which is not ideal. Thanks. I will study kernel/memremap.c From 1583488162234795833@xxx Wed Nov 08 09:06:30 +0000 2017 X-GM-THRID: 1583483429061741337 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread