xtensa: drop platform_heartbeat

platform_heartbeat is called from the timer interrupt handler, but
there may be no periodic timer interrupts on xtensa, so the frequency of
platform_heartbeat calls may be unrelated to HZ. Drop the callback and
reimplement its only user with a timer.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
This commit is contained in:
Max Filippov 2023-06-06 17:43:47 -07:00
parent f9f6ff8c5a
commit 71a5fd7d89
4 changed files with 12 additions and 20 deletions

View File

@ -47,11 +47,6 @@ extern void platform_power_off (void);
*/
extern void platform_idle (void);
/*
* platform_heartbeat is called every HZ
*/
extern void platform_heartbeat (void);
/*
* platform_calibrate_ccount calibrates cpu clock freq (CONFIG_XTENSA_CALIBRATE)
*/

View File

@ -32,7 +32,6 @@ _F(void, restart, (void), { while(1); });
_F(void, halt, (void), { while(1); });
_F(void, power_off, (void), { while(1); });
_F(void, idle, (void), { __asm__ __volatile__ ("waiti 0" ::: "memory"); });
_F(void, heartbeat, (void), { });
#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
_F(void, calibrate_ccount, (void),

View File

@ -121,10 +121,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
set_linux_timer(get_linux_timer());
evt->event_handler(evt);
/* Allow platform to do something useful (Wdog). */
platform_heartbeat();
return IRQ_HANDLED;
}

View File

@ -23,6 +23,7 @@
#include <linux/platform_device.h>
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/timer.h>
#include <asm/processor.h>
#include <asm/platform.h>
@ -70,16 +71,17 @@ void __init platform_setup(char** cmdline)
/* Heartbeat. Let the LED blink. */
void platform_heartbeat(void)
{
static int i, t;
static void xt2000_heartbeat(struct timer_list *unused);
if (--t < 0)
{
t = 59;
led_print(7, i ? ".": " ");
i ^= 1;
}
static DEFINE_TIMER(heartbeat_timer, xt2000_heartbeat);
static void xt2000_heartbeat(struct timer_list *unused)
{
static int i;
led_print(7, i ? "." : " ");
i ^= 1;
mod_timer(&heartbeat_timer, jiffies + HZ / 2);
}
//#define RS_TABLE_SIZE 2
@ -137,7 +139,7 @@ static int __init xt2000_setup_devinit(void)
{
platform_device_register(&xt2000_serial8250_device);
platform_device_register(&xt2000_sonic_device);
mod_timer(&heartbeat_timer, jiffies + HZ / 2);
return 0;
}