Linux-Hardening mirror
 help / color / mirror / Atom feed
From: Enlin Mu <enlin.mu@outlook.com>
To: manivannan.sadhasivam@linaro.org, daniel.lezcano@linaro.org,
	tglx@linutronix.de, inux-arm-kernel@lists.infradead.org,
	linux-unisoc@lists.infradead.org, enlin.mu@unisoc.com,
	enlinmu@gmail.com
Cc: linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: [PATCH] clocksource/drivers/rda: Add sched_clock_register   for RDA8810PL SoC
Date: Sun, 28 Apr 2024 10:17:38 +0100	[thread overview]
Message-ID: <TYSPR04MB7084133A983DD3EBE69F4A808A142@TYSPR04MB7084.apcprd04.prod.outlook.com> (raw)

From: Enlin Mu <enlin.mu@unisoc.com>

Add sched_clock_register  during init
bootup log before this patch:
[    8.044000] UBIFS (ubi0:4): Mounting in unauthenticated mode
[    8.044000] UBIFS error (ubi0:4 pid 176): ubifs_read_superblock: bad superblock, error 4
[    8.048000]  magic          0x6101831
[    8.048000]  crc            0x68cacdd8

bootup log after this patch:
[    8.131116] UBIFS (ubi0:4): Mounting in unauthenticated mode
[    8.132096] UBIFS error (ubi0:4 pid 176): ubifs_read_superblock: bad superblock, error 4
[    8.133352]  magic          0x6101831
[    8.133905]  crc            0x68cacdd8

Signed-off-by: Enlin Mu <enlin.mu@unisoc.com>
---
 drivers/clocksource/timer-rda.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/timer-rda.c b/drivers/clocksource/timer-rda.c
index fd1199c189bf..0be8e05970e2 100644
--- a/drivers/clocksource/timer-rda.c
+++ b/drivers/clocksource/timer-rda.c
@@ -13,6 +13,7 @@
 
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/sched_clock.h>
 
 #include "timer-of.h"
 
@@ -153,7 +154,7 @@ static struct timer_of rda_ostimer_of = {
 	},
 };
 
-static u64 rda_hwtimer_read(struct clocksource *cs)
+static u64 rda_hwtimer_clocksource_read(void)
 {
 	void __iomem *base = timer_of_base(&rda_ostimer_of);
 	u32 lo, hi;
@@ -167,6 +168,11 @@ static u64 rda_hwtimer_read(struct clocksource *cs)
 	return ((u64)hi << 32) | lo;
 }
 
+static u64 rda_hwtimer_read(struct clocksource *cs)
+{
+	return rda_hwtimer_clocksource_read();
+}
+
 static struct clocksource rda_hwtimer_clocksource = {
 	.name           = "rda-timer",
 	.rating         = 400,
@@ -185,6 +191,7 @@ static int __init rda_timer_init(struct device_node *np)
 		return ret;
 
 	clocksource_register_hz(&rda_hwtimer_clocksource, rate);
+	sched_clock_register(rda_hwtimer_clocksource_read, 64, rate);
 
 	clockevents_config_and_register(&rda_ostimer_of.clkevt, rate,
 					0x2, UINT_MAX);
-- 
2.39.2


                 reply	other threads:[~2024-04-28  9:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=TYSPR04MB7084133A983DD3EBE69F4A808A142@TYSPR04MB7084.apcprd04.prod.outlook.com \
    --to=enlin.mu@outlook.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=enlin.mu@unisoc.com \
    --cc=enlinmu@gmail.com \
    --cc=inux-arm-kernel@lists.infradead.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-unisoc@lists.infradead.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=tglx@linutronix.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).