Linux-RISC-V Archive on lore.kernel.org
 help / color / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: "Tomer Maimon" <tmaimon77@gmail.com>,
	"Nori, Sekhar" <nsekhar@ti.com>,
	guoren@kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	"Heiko Stübner" <heiko@sntech.de>,
	linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	"Kevin Hilman" <khilman@baylibre.com>,
	"Ludovic Desroches" <Ludovic.Desroches@microchip.com>,
	"NXP Linux Team" <linux-imx@nxp.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"moderated list:H8/300 ARCHITECTURE"
	<uclinux-h8-devel@lists.sourceforge.jp>,
	"Marc Zyngier" <marc.zyngier@arm.com>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	linux-unisoc@lists.infradead.org,
	"Krzysztof Halasa" <khalasa@piap.pl>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Scott Branden" <sbranden@broadcom.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Ralf Baechle" <ralf@linux-mips.org>,
	"Paul Burton" <paul.burton@mips.com>,
	"Sascha Hauer" <kernel@pengutronix.de>,
	"Claudiu Beznea" <Claudiu.Beznea@microchip.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"James Hogan" <jhogan@kernel.org>,
	"Palmer Dabbelt" <palmer@sifive.com>,
	"Eric Anholt" <eric@anholt.net>,
	"thierry.reding@gmail.com" <thierry.reding@gmail.com>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Yoshinori Sato" <ysato@users.sourceforge.jp>,
	"Lyra Zhang" <zhang.lyra@gmail.com>,
	"Daniel Lezcano" <daniel.lezcano@linaro.org>,
	"Jon Hunter" <jonathanh@nvidia.com>,
	"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
	"Kukjin Kim" <kgene@kernel.org>,
	"Alexandre TORGUE" <alexandre.torgue@st.com>,
	MSM <linux-arm-msm@vger.kernel.org>,
	"Sudeep Holla" <sudeep.holla@arm.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"John Stultz" <john.stultz@linaro.org>,
	linux-rpi-kernel <linux-rpi-kernel@lists.infradead.org>,
	"open list:ARM/Amlogic Meson..."
	<linux-amlogic@lists.infradead.org>,
	"Linux ARM" <linux-arm-kernel@lists.infradead.org>,
	"Barry Song" <baohua@kernel.org>,
	"Imre Kaloz" <kaloz@openwrt.org>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Patrice CHOTARD" <patrice.chotard@st.com>,
	"Stefan Wahren" <wahrenst@gmx.net>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
	"Neil Armstrong" <narmstrong@baylibre.com>,
	linux-tegra@vger.kernel.org, "Fabio Estevam" <festevam@gmail.com>,
	"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	"Benjamin Fair" <benjaminfair@google.com>,
	"Alexander Shiyan" <shc_work@mail.ru>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Nancy Yuen" <yuenn@google.com>, "Chen-Yu Tsai" <wens@csie.org>,
	bcm-kernel-feedback-list <bcm-kernel-feedback-list@broadcom.com>,
	"Orson Zhai" <orsonzhai@gmail.com>,
	"open list:SYNOPSYS ARC ARCHITECTURE"
	<linux-snps-arc@lists.infradead.org>,
	"Ray Jui" <rjui@broadcom.com>,
	"Vladimir Zapolskiy" <vz@mleia.com>,
	"John Crispin" <john@phrozen.org>,
	tali.perry1@gmail.com, "Avi Fishman" <avifishman70@gmail.com>,
	"Patrick Venture" <venture@google.com>,
	"Ley Foon Tan" <lftan@altera.com>,
	linux-oxnas@groups.io, "Shawn Guo" <shawnguo@kernel.org>,
	"Andreas Färber" <afaerber@suse.de>,
	"Baruch Siach" <baruch@tkos.co.il>,
	"Maxime Ripard" <maxime.ripard@bootlin.com>,
	"Liviu Dudau" <liviu.dudau@arm.com>,
	linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org,
	"OpenBMC Maillist" <openbmc@lists.ozlabs.org>,
	"Russell King" <linux@armlinux.org.uk>,
	"Andy Gross" <agross@kernel.org>,
	"Sylvain Lemieux" <slemieux.tyco@gmail.com>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>,
	aou@eecs.berkeley.edu, "Rob Herring" <robh+dt@kernel.org>,
	"moderated list:ARM/Mediatek SoC support"
	<linux-mediatek@lists.infradead.org>,
	"Santosh Shilimkar" <ssantosh@kernel.org>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Michal Simek" <monstr@monstr.eu>,
	"Baolin Wang" <baolin.wang@linaro.org>,
	"Vineet Gupta" <vgupta@synopsys.com>,
	"Nicolas Ferre" <Nicolas.Ferre@microchip.com>,
	"Tony Prisk" <linux@prisktech.co.nz>,
	"moderated list:NIOS2 ARCHITECTURE"
	<nios2-dev@lists.rocketboards.org>
Subject: Re: [PATCH 4/7] dt-bindings: chosen: Add clocksource and clockevent selection
Date: Wed, 11 Sep 2019 01:03:03 +0100
Message-ID: <CACRpkda4mmpbPWa2nD93CvD6HWzcTUDzyyLdQxC2gNB7XiJF3w@mail.gmail.com> (raw)
In-Reply-To: <20190910151055.GX21254@piout.net>

On Tue, Sep 10, 2019 at 4:11 PM Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
> On 10/09/2019 16:08:26+0100, Sudeep Holla wrote:
> > On Tue, Sep 10, 2019 at 02:51:50PM +0000, Claudiu.Beznea@microchip.com wrote:

> > In that case, why can't we identify capability that with the compatibles
> > for this timer IP ?
> >
> > IOW, I don't like the proposal as it's hardware limitation.
>
> To be clear, bot timers are exactly the same but can't be clocksource
> and clockevent at the same time. Why would we have different compatibles
> for the exact same IP?

In that case why not just pick the first one you find as clocksource
and the second one as clock event? As they all come to the
same timer of init function two simple local state variables can
solve that:

static bool registered_clocksource;
static bool registered_clockevent;

probe(timer) {
   if (!registered_clocksource) {
       register_clocksource(timer);
       registrered_clocksource = true;
       return;
   }
   if (!registered_clockevent) {
       register_clockevent(timer);
       registered_clockevent = true;
       return;
   }
   pr_info("surplus timer %p\n", timer);
}

Clocksource and clockevent are natural singletons so there is
no need to handle more than one of each in a driver for identical
hardware.

With the Integrator AP timer there is a real reason to select one over
the other but as I replied to that patch it is pretty easy to just identify
which block has this limitation by simply commenting out the IRQ
line for it from the device tree.

Maybe there is something about this I don't understand.

Yours,
Linus Walleij

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply index

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-10 13:47 [PATCH 0/7] add support for clocksource/clockevent DT selection Claudiu Beznea
2019-09-10 13:47 ` [PATCH 1/7] clocksource/drivers/c-sky: request timer_of_init only for probing CPU Claudiu Beznea
2019-09-10 13:47 ` [PATCH 2/7] clocksource: change timer registration macros Claudiu Beznea
2019-09-10 14:49   ` Marc Zyngier
2019-09-10 14:57     ` Claudiu.Beznea
2019-09-10 13:47 ` [PATCH 3/7] clocksource/timer_of: use BIT() macro Claudiu Beznea
2019-09-10 13:47 ` [PATCH 4/7] dt-bindings: chosen: Add clocksource and clockevent selection Claudiu Beznea
2019-09-10 14:32   ` Sudeep Holla
2019-09-10 14:51     ` Claudiu.Beznea
2019-09-10 15:08       ` Sudeep Holla
2019-09-10 15:10         ` Alexandre Belloni
2019-09-11  0:03           ` Linus Walleij [this message]
2019-09-11  7:18             ` Claudiu.Beznea
2019-09-12 14:18               ` Linus Walleij
2019-09-30 14:32               ` Rob Herring
2019-10-02 13:32                 ` Claudiu.Beznea
2019-09-11  7:34   ` Neil Armstrong
2019-09-11  9:14     ` Alexandre Belloni
2019-09-10 13:47 ` [PATCH 5/7] clocksource/drivers/timer-of: add support support for timer's functionalities Claudiu Beznea
2019-09-10 13:47 ` [PATCH 6/7] drivers/clocksource/timer-of: keep declaration on one line Claudiu Beznea
2019-09-10 13:47 ` [PATCH 7/7] clocksource/drivers/integrator-ap: parse the chosen node Claudiu Beznea
2019-09-10 23:48   ` Linus Walleij
2019-09-11  7:14     ` Claudiu.Beznea
2019-09-10 16:05 ` [PATCH 0/7] add support for clocksource/clockevent DT selection John Stultz
2019-09-11  6:52   ` Claudiu.Beznea
2019-09-11 16:06     ` John Stultz
2019-09-25 17:19 ` Daniel Lezcano
2019-09-26  8:42   ` Claudiu.Beznea
2019-10-02 13:35     ` Claudiu.Beznea
2019-10-03 10:43       ` Claudiu.Beznea
2019-10-13 18:16         ` Daniel Lezcano
2019-10-15  9:23           ` Claudiu.Beznea
2019-10-18 20:24             ` Daniel Lezcano
2019-10-21  8:58               ` Claudiu.Beznea
2019-10-21 14:17                 ` Daniel Lezcano

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACRpkda4mmpbPWa2nD93CvD6HWzcTUDzyyLdQxC2gNB7XiJF3w@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=Claudiu.Beznea@microchip.com \
    --cc=Ludovic.Desroches@microchip.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=afaerber@suse.de \
    --cc=agross@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alexandre.torgue@st.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=avifishman70@gmail.com \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linaro.org \
    --cc=baruch@tkos.co.il \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=benjaminfair@google.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=eric@anholt.net \
    --cc=f.fainelli@gmail.com \
    --cc=festevam@gmail.com \
    --cc=guoren@kernel.org \
    --cc=heiko@sntech.de \
    --cc=jhogan@kernel.org \
    --cc=john.stultz@linaro.org \
    --cc=john@phrozen.org \
    --cc=jonathanh@nvidia.com \
    --cc=kaloz@openwrt.org \
    --cc=kernel@pengutronix.de \
    --cc=kgene@kernel.org \
    --cc=khalasa@piap.pl \
    --cc=khilman@baylibre.com \
    --cc=krzk@kernel.org \
    --cc=lftan@altera.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-oxnas@groups.io \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux-unisoc@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=linux@prisktech.co.nz \
    --cc=liviu.dudau@arm.com \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=monstr@monstr.eu \
    --cc=narmstrong@baylibre.com \
    --cc=nios2-dev@lists.rocketboards.org \
    --cc=nsekhar@ti.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=orsonzhai@gmail.com \
    --cc=palmer@sifive.com \
    --cc=patrice.chotard@st.com \
    --cc=paul.burton@mips.com \
    --cc=ralf@linux-mips.org \
    --cc=rjui@broadcom.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=sboyd@kernel.org \
    --cc=sbranden@broadcom.com \
    --cc=shawnguo@kernel.org \
    --cc=shc_work@mail.ru \
    --cc=slemieux.tyco@gmail.com \
    --cc=ssantosh@kernel.org \
    --cc=sudeep.holla@arm.com \
    --cc=tali.perry1@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=thierry.reding@gmail.com \
    --cc=tmaimon77@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=uclinux-h8-devel@lists.sourceforge.jp \
    --cc=venture@google.com \
    --cc=vgupta@synopsys.com \
    --cc=vz@mleia.com \
    --cc=wahrenst@gmx.net \
    --cc=wens@csie.org \
    --cc=ysato@users.sourceforge.jp \
    --cc=yuenn@google.com \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-RISC-V Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-riscv/0 linux-riscv/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-riscv linux-riscv/ https://lore.kernel.org/linux-riscv \
		linux-riscv@lists.infradead.org
	public-inbox-index linux-riscv

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-riscv


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git