From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751861AbbEYDng (ORCPT ); Sun, 24 May 2015 23:43:36 -0400 Received: from mail-oi0-f50.google.com ([209.85.218.50]:35971 "EHLO mail-oi0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751043AbbEYDnd (ORCPT ); Sun, 24 May 2015 23:43:33 -0400 MIME-Version: 1.0 In-Reply-To: <20150521152838.GB16668@roeck-us.net> References: <=fu.wei@linaro.org> <1432197156-16947-1-git-send-email-fu.wei@linaro.org> <1432197156-16947-7-git-send-email-fu.wei@linaro.org> <555DB4C4.5090606@roeck-us.net> <555DD8EE.1060607@codeaurora.org> <20150521152838.GB16668@roeck-us.net> Date: Mon, 25 May 2015 11:43:31 +0800 Message-ID: Subject: Re: [PATCH v2 6/7] Watchdog: introduce ARM SBSA watchdog driver From: Fu Wei To: Guenter Roeck Cc: Timur Tabi , Suravee Suthikulpanit , Linaro ACPI Mailman List , linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Wei Fu , G Gregory , Al Stone , Hanjun Guo , Ashwin Chaugule , Arnd Bergmann , vgandhi@codeaurora.org, wim@iguana.be, Jon Masters , Leo Duran , Jon Corbet , Mark Rutland Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Guenter, On 21 May 2015 at 23:28, Guenter Roeck wrote: > On Thu, May 21, 2015 at 08:09:02AM -0500, Timur Tabi wrote: >> Guenter Roeck wrote: >> >> >> >>+static unsigned int sbsa_gwdt_get_timeleft(struct watchdog_device *wdd) >> >>+{ >> >>+ struct sbsa_gwdt *gwdt = to_sbsa_gwdt(wdd); >> >>+ u64 timeleft = sbsa_gwdt_get_wcv(wdd) - arch_counter_get_cntvct(); >> >>+ >> > >> >Still not happy about the use of arch_counter_get_cntvct >> >instead of using the clock subsystem. I am quite sure this could be done, >> >possibly through arch_sys_counter, though at this point I am getting wary >> >of bringing it up, so I guess I'll just let it go. >> >> You made the same comment with my driver, and I keep asking for >> clarification. The clk_get_sys() API does not work on my system, because >> there are not clocks defined. That must be an ACPI limitation that I can't >> fix. >> > Would it be possible to define such clocks ? > >> The alternative to arch_counter_get_cntvct() is arch_timer_read_counter(), >> which is not exported. So we have two choices, >> >> 1) Continue to use arch_counter_get_cntvct(), which works on all ARM64 >> platforms that this driver supports anyway >> >> 2) Export arch_timer_read_counter() >> >> I prefer option #1. >> > Do we have any feedback from the arm maintainers ? > > My problem is that I don't want to be the first one to permit using > those functions outside architecture and clock code. If we do this, > we should get an Ack from an arm maintainer specifically for the use > of arch_counter_get_cntvct() and arch_timer_get_rate(). IMO, we may need to use arch_timer_read_counter. Reason: Once the Linux kernel has KVM support and is in hyp mode. we may need to use arch_counter_get_cntpct. So arch_timer driver have helped us to make arch_timer_read_counter point to the right function. and arch_timer_read_counter is in the include/clocksource/arm_arch_timer.h, just like arch_timer_get_rate as a interface > > Thanks, > Guenter > -- > To unsubscribe from this list: send the line "unsubscribe devicetree" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Best regards, Fu Wei Software Engineer Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch Ph: +86 21 61221326(direct) Ph: +86 186 2020 4684 (mobile) Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fu Wei Subject: Re: [PATCH v2 6/7] Watchdog: introduce ARM SBSA watchdog driver Date: Mon, 25 May 2015 11:43:31 +0800 Message-ID: References: <=fu.wei@linaro.org> <1432197156-16947-1-git-send-email-fu.wei@linaro.org> <1432197156-16947-7-git-send-email-fu.wei@linaro.org> <555DB4C4.5090606@roeck-us.net> <555DD8EE.1060607@codeaurora.org> <20150521152838.GB16668@roeck-us.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <20150521152838.GB16668-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org> Sender: linux-watchdog-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Guenter Roeck Cc: Timur Tabi , Suravee Suthikulpanit , Linaro ACPI Mailman List , linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Wei Fu , G Gregory , Al Stone , Hanjun Guo , Ashwin Chaugule , Arnd Bergmann , vgandhi-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, wim-IQzOog9fTRqzQB+pC5nmwQ@public.gmane.org, Jon Masters , Leo Duran , Jon Corbet , Mark Rutland List-Id: devicetree@vger.kernel.org Hi Guenter, On 21 May 2015 at 23:28, Guenter Roeck wrote: > On Thu, May 21, 2015 at 08:09:02AM -0500, Timur Tabi wrote: >> Guenter Roeck wrote: >> >> >> >>+static unsigned int sbsa_gwdt_get_timeleft(struct watchdog_device *wdd) >> >>+{ >> >>+ struct sbsa_gwdt *gwdt = to_sbsa_gwdt(wdd); >> >>+ u64 timeleft = sbsa_gwdt_get_wcv(wdd) - arch_counter_get_cntvct(); >> >>+ >> > >> >Still not happy about the use of arch_counter_get_cntvct >> >instead of using the clock subsystem. I am quite sure this could be done, >> >possibly through arch_sys_counter, though at this point I am getting wary >> >of bringing it up, so I guess I'll just let it go. >> >> You made the same comment with my driver, and I keep asking for >> clarification. The clk_get_sys() API does not work on my system, because >> there are not clocks defined. That must be an ACPI limitation that I can't >> fix. >> > Would it be possible to define such clocks ? > >> The alternative to arch_counter_get_cntvct() is arch_timer_read_counter(), >> which is not exported. So we have two choices, >> >> 1) Continue to use arch_counter_get_cntvct(), which works on all ARM64 >> platforms that this driver supports anyway >> >> 2) Export arch_timer_read_counter() >> >> I prefer option #1. >> > Do we have any feedback from the arm maintainers ? > > My problem is that I don't want to be the first one to permit using > those functions outside architecture and clock code. If we do this, > we should get an Ack from an arm maintainer specifically for the use > of arch_counter_get_cntvct() and arch_timer_get_rate(). IMO, we may need to use arch_timer_read_counter. Reason: Once the Linux kernel has KVM support and is in hyp mode. we may need to use arch_counter_get_cntpct. So arch_timer driver have helped us to make arch_timer_read_counter point to the right function. and arch_timer_read_counter is in the include/clocksource/arm_arch_timer.h, just like arch_timer_get_rate as a interface > > Thanks, > Guenter > -- > To unsubscribe from this list: send the line "unsubscribe devicetree" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Best regards, Fu Wei Software Engineer Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch Ph: +86 21 61221326(direct) Ph: +86 186 2020 4684 (mobile) Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021 -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html