mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sander Vanheule <sander@svanheule.net>
To: Chris Packham <chris.packham@alliedtelesis.co.nz>,
	tglx@linutronix.de,  robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org,  tsbogend@alpha.franken.de,
	daniel.lezcano@linaro.org, paulburton@kernel.org,
	 peterz@infradead.org, mail@birger-koblitz.de, bert@biot.com,
	john@phrozen.org
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	 linux-mips@vger.kernel.org, kabel@kernel.org,
	ericwouds@gmail.com,
	Markus Stockhausen <markus.stockhausen@gmx.de>
Subject: Re: [PATCH v3 7/9] clocksource: realtek: Add timer driver for rtl-otto platforms
Date: Sat, 29 Jun 2024 23:03:12 +0200	[thread overview]
Message-ID: <e0f0f6ceb37225dd3d85038773b09c7ceee96499.camel@svanheule.net> (raw)
In-Reply-To: <20240627043317.3751996-8-chris.packham@alliedtelesis.co.nz>

Hi Chris,

On Thu, 2024-06-27 at 16:33 +1200, Chris Packham wrote:
> The timer/counter block on the Realtek SoCs provides up to 5 timers. It
> also includes a watchdog timer but this isn't being used currently (it
> will be added as a separate wdt driver).

Do you mean the watchdog timer supported by drivers/watchdog/realtek_otto_wdt.c? Or are
you referring to another watchdog timer?

> One timer will be used per CPU as a local clock event generator. An
> additional timer will be used as an overal stable clocksource.
> 
> Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
> Signed-off-by: Sander Vanheule <sander@svanheule.net>
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---

For reference, I submitted a driver for the same hardware back in 2022, but didn't manage
to follow up to finalize the submission:

https://lore.kernel.org/all/cover.1642369117.git.sander@svanheule.net/


> +
> +/* Module initialization part. */
> +static DEFINE_PER_CPU(struct timer_of, rttm_to) = {
> +	.flags				= TIMER_OF_BASE | TIMER_OF_CLOCK |
> TIMER_OF_IRQ,
> +	.of_irq = {
> +		.flags			= IRQF_PERCPU | IRQF_TIMER,

In the original review of this code, I had some doubts about the use of IRQF_PERCPU. Maybe
the people in Cc can shed some light on this.

If I understand correctly, the SoC interrupts these timers use are not per-cpu interrupts.
(For comparison, AFAICT the MIPS CPU interrupts are)



> +		.handler		= rttm_timer_interrupt,
> +	},
> +	.clkevt = {
> +		.rating			= 400,
> +		.features		= CLOCK_EVT_FEAT_PERIODIC |
> CLOCK_EVT_FEAT_ONESHOT,

If the use of IRQF_PERCPU is appropriate, I wonder if the driver should also use
CLOCK_EVT_FEAT_PERCPU.


Best,
Sander


  parent reply	other threads:[~2024-06-29 21:03 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-27  4:33 [PATCH v3 0/9] mips: Support for RTL9302C Chris Packham
2024-06-27  4:33 ` [PATCH v3 1/9] mips: dts: realtek: use "serial" instead of "uart" in node name Chris Packham
2024-06-27 10:59   ` Marek Behún
2024-06-27  4:33 ` [PATCH v3 2/9] mips: dts: realtek: add device_type property to cpu node Chris Packham
2024-06-27 11:01   ` Marek Behún
2024-06-27  4:33 ` [PATCH v3 3/9] dt-bindings: vendor-prefixes: Add Cameo Communications Chris Packham
2024-06-27  7:39   ` Krzysztof Kozlowski
2024-06-27  4:33 ` [PATCH v3 4/9] dt-bindings: mips: realtek: Add rtl930x-soc compatible Chris Packham
2024-06-27  7:39   ` Krzysztof Kozlowski
2024-06-27  4:33 ` [PATCH v3 5/9] dt-bindings: timer: Add schema for realtek,otto-timer Chris Packham
2024-06-27  7:40   ` Krzysztof Kozlowski
2024-06-29 20:40   ` Sander Vanheule
2024-07-01  2:15     ` Chris Packham
2024-06-27  4:33 ` [PATCH v3 6/9] dt-bindings: interrupt-controller: realtek,rtl-intc: Add rtl9300-intc Chris Packham
2024-06-27  5:37   ` Rob Herring (Arm)
2024-06-27  7:41   ` Krzysztof Kozlowski
2024-06-30 22:12     ` Chris Packham
2024-07-01  3:02       ` Chris Packham
2024-06-27  4:33 ` [PATCH v3 7/9] clocksource: realtek: Add timer driver for rtl-otto platforms Chris Packham
2024-06-27 11:17   ` Marek Behún
2024-07-01  4:41     ` Chris Packham
2024-06-29 21:03   ` Sander Vanheule [this message]
2024-07-01  2:07     ` Chris Packham
2024-06-30  1:10   ` kernel test robot
2024-06-27  4:33 ` [PATCH v3 8/9] mips: generic: add fdt fixup for Realtek reference board Chris Packham
2024-06-27 11:19   ` Marek Behún
2024-06-27 17:48   ` Rob Herring
2024-06-30 22:39     ` Chris Packham
2024-06-27  4:33 ` [PATCH v3 9/9] mips: dts: realtek: Add RTL9302C board Chris Packham
2024-06-27 14:42 ` [PATCH v3 0/9] mips: Support for RTL9302C Rob Herring
2024-06-30 23:43   ` Chris Packham
2024-07-01  3:26     ` Chris Packham

Reply instructions:

You may reply publicly 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=e0f0f6ceb37225dd3d85038773b09c7ceee96499.camel@svanheule.net \
    --to=sander@svanheule.net \
    --cc=bert@biot.com \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=conor+dt@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ericwouds@gmail.com \
    --cc=john@phrozen.org \
    --cc=kabel@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=mail@birger-koblitz.de \
    --cc=markus.stockhausen@gmx.de \
    --cc=paulburton@kernel.org \
    --cc=peterz@infradead.org \
    --cc=robh@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tsbogend@alpha.franken.de \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®