Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1604292
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Fu Wei <fu.wei@linaro.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v21 01/13] clocksource: arm_arch_timer: introduce two functions to get the frequency from mmio and sysreg. |
| Date | Mon, 20 Mar 2017 10:50:01 +0100 |
| Message-ID | <tn26R-2MC-1@gated-at.bofh.it> (permalink) |
| References | <t7WG5-ld-3@gated-at.bofh.it> <t7WG6-ld-19@gated-at.bofh.it> <tm4u6-21N-33@gated-at.bofh.it> <tn054-1qT-23@gated-at.bofh.it> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=B1x1dhAvuwZTStXYLCqk1EoCQjTXjbic/RhK8QXN+Us=; b=DblShzM+r570B6QRGsNThHLQNfKc7QNSj9B5XP0PjiAxtx46TaqRP9qiDVZ4/EyWbf 3MH64mxqWwSssXBcO0lH+Z0uqwx7z1cfEOJeP+3vXuf4GImJ8l7AesKgFfRd6L42e6NJ StdT7enlL9WzEAOlk1gAtZznw3Tl4HFERGOUw= |
| 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=B1x1dhAvuwZTStXYLCqk1EoCQjTXjbic/RhK8QXN+Us=; b=X/3+O+WJDscjVGHeRbHSUAHYAZ72xYUyYTtSWwFcM505O9Hcj7w2kbaalrsPmzBkZv rjYAhaKyBDr7W7KFjKooAcJ+bHghBCSfKHPXf1uZHQErT+GW02ys2Cdiplm0J4c140Ws j+g8mJOzbtM2b+EEXtWYa2OnARs4FyDR6bfT8pPVyDY2osEFCZKtwxvkp7gUCV8NGO7m AAUEMIGZ7ESRafXD8jrXzopPkm9lPftTojTLc0PBMzi6PXzPYpfKHVUyIVLxJgW8zgTW 6kmarw7kuwZVirUYWcdEKb54bLaj/oWL1hHcaWk52MMZ6NXa1Ad5f3EST8kDQB2wKj8g SPjg== |
| X-Gm-Message-State | AFeK/H0k09BuvInhLVT1ccyzozJhnZs2kqPDi7yvn1C88yS+r933+Wtc230cW5hYmQhdncyoq1kRZPsZtzBNa47V |
| X-Received | by 10.36.37.84 with SMTP id g81mr9611980itg.106.1490003010330; Mon, 20 Mar 2017 02:43:30 -0700 (PDT) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 72 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | "Rafael J. Wysocki" <rjw@rjwysocki.net>, Len Brown <lenb@kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, Thomas Gleixner <tglx@linutronix.de>, Marc Zyngier <marc.zyngier@arm.com>, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, Sudeep Holla <sudeep.holla@arm.com>, Hanjun Guo <hanjun.guo@linaro.org>, linux-arm-kernel@lists.infradead.org, Linaro ACPI Mailman List <linaro-acpi@lists.linaro.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, ACPI Devel Maling List <linux-acpi@vger.kernel.org>, rruigrok@codeaurora.org, "Abdulhamid, Harb" <harba@codeaurora.org>, Christopher Covington <cov@codeaurora.org>, Timur Tabi <timur@codeaurora.org>, G Gregory <graeme.gregory@linaro.org>, Al Stone <al.stone@linaro.org>, Jon Masters <jcm@redhat.com>, Wei Huang <wei@redhat.com>, Arnd Bergmann <arnd@arndb.de>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will.deacon@arm.com>, Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>, Leo Duran <leo.duran@amd.com>, Wim Van Sebroeck <wim@iguana.be>, Guenter Roeck <linux@roeck-us.net>, linux-watchdog@vger.kernel.org, Tomasz Nowicki <tn@semihalf.com>, Christoffer Dall <christoffer.dall@linaro.org>, Julien Grall <julien.grall@arm.com> |
| X-Original-Date | Mon, 20 Mar 2017 17:43:29 +0800 |
| X-Original-Message-ID | <CADyBb7vawnjnL6Phxc_owTnEK0qf95cYAUWPga9axGqEWc46Ww@mail.gmail.com> |
| X-Original-References | <20170206185015.12296-1-fu.wei@linaro.org> <20170206185015.12296-2-fu.wei@linaro.org> <20170317180513.GB15909@leverpostej> <CADyBb7vZ4G+q1y6w6OVQ7i-ZiTtcdx_w2BOSWqy=2jWhAV6Hmw@mail.gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1604292 |
Show key headers only | View raw
Hi Mark,
On 20 March 2017 at 15:36, Fu Wei <fu.wei@linaro.org> wrote:
> Hi Mark,
>
> On 18 March 2017 at 02:05, Mark Rutland <mark.rutland@arm.com> wrote:
>> On Tue, Feb 07, 2017 at 02:50:03AM +0800, fu.wei@linaro.org wrote:
>>> +static u32 arch_timer_get_sysreg_freq(void)
>>> +{
>>> + /*
>>> + * Try to get the frequency from the CNTFRQ of sysreg.
>>> + */
>>> + return arch_timer_get_cntfrq();
>>> +}
>>
>> We already have arch_timer_get_cntfrq(), so I don't see the point in
>> this wrapper.
>>
>>> +static u32 arch_timer_get_mmio_freq(void __iomem *cntbase)
>>> +{
>>> + /*
>>> + * Try to get the frequency from the CNTFRQ of timer frame registers.
>>> + * Note: please verify cntbase in caller.
>>> + */
>>> + return readl_relaxed(cntbase + CNTFRQ);
>>> +}
>>
>> Wrapping the MMIO read makes sense if we're going to do this in more
>> than one place, so I'm happy with this wrapper.
>>
>> If you can s/arch_timer_get_mmio_freq/arch_timer_get_cntfrq/, and drop
>
> sorry, May I guess that is
> "s/arch_timer_get_mmio_freq/arch_timer_get_mmio_cntfrq/"
> or
> "s/arch_timer_get_mmio_freq/arch_timer_mem_get_cntfrq/"
>
> which one do you prefer? :-)
keeping using arch_timer_get_cntfrq(); for per-CPU arch timer, then
+static u32 arch_timer_mem_get_cntfrq(void __iomem *cntbase)
+{
+ return readl_relaxed(cntbase + CNTFRQ);
+}
+
Is that OK for you?
>
>> the comments, then this looks fine to me.
>>
>> Thanks,
>> Mark.
>
>
>
> --
> Best regards,
>
> Fu Wei
> Software Engineer
> Red Hat
--
Best regards,
Fu Wei
Software Engineer
Red Hat
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH v21 01/13] clocksource: arm_arch_timer: introduce two functions to get the frequency from mmio and sysreg. Mark Rutland <mark.rutland@arm.com> - 2017-03-17 19:10 +0100
Re: [PATCH v21 01/13] clocksource: arm_arch_timer: introduce two functions to get the frequency from mmio and sysreg. Fu Wei <fu.wei@linaro.org> - 2017-03-20 08:40 +0100
Re: [PATCH v21 01/13] clocksource: arm_arch_timer: introduce two functions to get the frequency from mmio and sysreg. Fu Wei <fu.wei@linaro.org> - 2017-03-20 10:50 +0100
Re: [PATCH v21 01/13] clocksource: arm_arch_timer: introduce two functions to get the frequency from mmio and sysreg. Mark Rutland <mark.rutland@arm.com> - 2017-03-20 11:50 +0100
Re: [PATCH v21 01/13] clocksource: arm_arch_timer: introduce two functions to get the frequency from mmio and sysreg. Fu Wei <fu.wei@linaro.org> - 2017-03-20 12:20 +0100
csiph-web