lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <99688909-929a-a1c2-5dfe-be98b50b6328@linaro.org>
Date:   Mon, 21 Oct 2019 16:17:35 +0200
From:   Daniel Lezcano <daniel.lezcano@...aro.org>
To:     Claudiu.Beznea@...rochip.com, robh+dt@...nel.org,
        mark.rutland@....com, linux@...linux.org.uk, nsekhar@...com,
        bgolaszewski@...libre.com, monstr@...str.eu, john@...ozen.org,
        ralf@...ux-mips.org, paul.burton@...s.com, jhogan@...nel.org,
        lftan@...era.com, tglx@...utronix.de, vgupta@...opsys.com,
        marc.zyngier@....com, patrice.chotard@...com,
        mcoquelin.stm32@...il.com, alexandre.torgue@...com,
        eric@...olt.net, wahrenst@....net, f.fainelli@...il.com,
        rjui@...adcom.com, sbranden@...adcom.com,
        bcm-kernel-feedback-list@...adcom.com, linus.walleij@...aro.org,
        shc_work@...l.ru, kgene@...nel.org, krzk@...nel.org,
        ysato@...rs.sourceforge.jp, liviu.dudau@....com,
        sudeep.holla@....com, lorenzo.pieralisi@....com,
        shawnguo@...nel.org, s.hauer@...gutronix.de, kernel@...gutronix.de,
        festevam@...il.com, linux-imx@....com, baohua@...nel.org,
        Nicolas.Ferre@...rochip.com, alexandre.belloni@...tlin.com,
        Ludovic.Desroches@...rochip.com, baruch@...s.co.il,
        u.kleine-koenig@...gutronix.de, guoren@...nel.org,
        kaloz@...nwrt.org, khalasa@...p.pl, ssantosh@...nel.org,
        vz@...ia.com, slemieux.tyco@...il.com, khilman@...libre.com,
        avifishman70@...il.com, tmaimon77@...il.com, tali.perry1@...il.com,
        venture@...gle.com, yuenn@...gle.com, benjaminfair@...gle.com,
        afaerber@...e.de, manivannan.sadhasivam@...aro.org,
        narmstrong@...libre.com, agross@...nel.org, palmer@...ive.com,
        aou@...s.berkeley.edu, heiko@...ech.de, orsonzhai@...il.com,
        baolin.wang@...aro.org, zhang.lyra@...il.com,
        maxime.ripard@...tlin.com, wens@...e.org, thierry.reding@...il.com,
        jonathanh@...dia.com, linux@...sktech.co.nz,
        john.stultz@...aro.org, sboyd@...nel.org, matthias.bgg@...il.com
Cc:     devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-mips@...r.kernel.org,
        nios2-dev@...ts.rocketboards.org,
        linux-snps-arc@...ts.infradead.org,
        linux-stm32@...md-mailman.stormreply.com,
        linux-rpi-kernel@...ts.infradead.org,
        linux-samsung-soc@...r.kernel.org,
        uclinux-h8-devel@...ts.sourceforge.jp,
        linux-amlogic@...ts.infradead.org, openbmc@...ts.ozlabs.org,
        linux-oxnas@...ups.io, linux-arm-msm@...r.kernel.org,
        linux-unisoc@...ts.infradead.org, linux-riscv@...ts.infradead.org,
        linux-rockchip@...ts.infradead.org, linux-tegra@...r.kernel.org,
        linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH 0/7] add support for clocksource/clockevent DT selection

On 21/10/2019 10:58, Claudiu.Beznea@...rochip.com wrote:
> Hi Daniel,
> 
> On 18.10.2019 23:24, Daniel Lezcano wrote:
>> Hi Claudiu,
>>
>> On 15/10/2019 11:23, Claudiu.Beznea@...rochip.com wrote:
>>
>> [ ... ]
>>
>>> The timer clock source could be divided by MR.PRES + 1.
>>>
>>> So, I used the clock-frequency DT binding to let user choose the timer's
>>> frequency. Based on the value provided via this DT binding the best clock
>>> source and prescaler is chosen via mchp_pit64b_pres_prepare() function.
>>
>> I'm willing to take the driver but I doubt the purpose of the
>> clock-frequency is to let the user choose the frequency.
>>
> 
> I found this approach in the following already integrated drivers:
> drivers/clocksource/armv7m_systick.c
> drivers/clocksource/bcm2835_timer.c
> drivers/clocksource/bcm_kona_timer.c
> drivers/clocksource/mips-gic-timer.c
> drivers/clocksource/mps2-timer.c
> drivers/clocksource/timer-qcom.c
> drivers/clocksource/arm_arch_timer.c
> 
> Looking through the documentation of these, most of them document this DT
> property as the frequency of the clock that drivers the timer, but none of
> them seems to have some IP internal dividers so that the timer to tick at
> different frequency than the clock that feeds the IP. From the
> documentation of the above drivers;
> drivers/clocksource/armv7m_systick.c
> 	- clock-frequency : The rate in HZ in input of the ARM SysTick
> 
> drivers/clocksource/bcm2835_timer.c
> 	- clock-frequency : The frequency of the clock that drives the counter, in
> Hz.
> drivers/clocksource/bcm_kona_timer.c
> 	- clock-frequency: frequency that the clock operates
> 
> drivers/clocksource/mips-gic-timer.c
> 	clock-frequency : Clock frequency at which the GIC timers operate.
> drivers/clocksource/mps2-timer.c
> 	- clock-frequency : The rate in HZ in input of the ARM MPS2 timer
> 
> drivers/clocksource/timer-qcom.c
> 	- clock-frequency : The frequency of the debug timer and the general
> purpose
>                     timer(s) in Hz in that order.
> 
> 
> This is why I also chose this DT bindings.
> 
> If you want I can stick to a fixed frequency hard coded in the driver.
> Please let me know if this would be OK for you.

Yes, the clock-frequency is used to specify the frequency when the
information can not be retrieved from the clock. The goal is not to
specify a frequency and compute from there a prescalar value.

Hardcoding the frequency is fine or hardcode the divider and compute the
frequency from the clock rate.



-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ