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] [thread-next>] [day] [month] [year] [list]
Message-ID: <81da473f-54d7-2a00-61ec-9351cdfcaaf3@baylibre.com>
Date:   Wed, 11 Sep 2019 09:34:27 +0200
From:   Neil Armstrong <narmstrong@...libre.com>
To:     Claudiu Beznea <claudiu.beznea@...rochip.com>,
        daniel.lezcano@...aro.org, 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,
        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 4/7] dt-bindings: chosen: Add clocksource and clockevent
 selection

Hi,

On 10/09/2019 15:47, Claudiu Beznea wrote:
> From: Alexandre Belloni <alexandre.belloni@...tlin.com>
> 
> Some timer drivers may behave either as clocksource or clockevent
> or both. Until now, in case of platforms with multiple hardware
> resources of the same type, the drivers were chosing the first
> registered hardware resource as clocksource/clockevent and the
> next one as clockevent/clocksource. Other were using different
> compatibles (one for each functionality, although its about the
> same hardware). Add DT bindings to be able to choose the
> functionality of a timer.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@...tlin.com>
> Signed-off-by: Claudiu Beznea <claudiu.beznea@...rochip.com>
> ---
>  Documentation/devicetree/bindings/chosen.txt | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/chosen.txt b/Documentation/devicetree/bindings/chosen.txt
> index 45e79172a646..aad3034cdbdf 100644
> --- a/Documentation/devicetree/bindings/chosen.txt
> +++ b/Documentation/devicetree/bindings/chosen.txt
> @@ -135,3 +135,23 @@ e.g.
>  		linux,initrd-end = <0x82800000>;
>  	};
>  };
> +
> +linux,clocksource and linux,clockevent
> +--------------------------------------
> +
> +Those nodes have a timer property. This property is a phandle to the timer to be
> +chosen as the clocksource or clockevent. This is only useful when the platform
> +has multiple identical timers and it is not possible to let linux make the
> +correct choice.
> +
> +/ {
> +	chosen {
> +		linux,clocksource {
> +			timer = <&timer0>;
> +		};
> +
> +		linux,clockevent {
> +			timer = <&timer1>;
> +		};
> +	};
> +};
> 

Why not in aliases ?

aliases {
    clocksource0 = &timer0;
    clockevent0 = &timer1;
};

since we can have multiple of each, we should not limit ourselves to 1 clkevent
and 1 clksource.

In the aliases case, each driver would expose both capabilities, and the core would select
what to enable.

Neil

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ