Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113091
b: refs/heads/master
c: 446139a
h: refs/heads/master
i:
  113089: dcde51c
  113087: ba797fa
v: v3
  • Loading branch information
David S. Miller committed Sep 2, 2008
1 parent 8bb12d3 commit ccb2e10
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 53 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cdb3592a20b41377a28a0737dc9af95e53024470
refs/heads/master: 446139a8f7078d96159a936fd6059660db425405
7 changes: 0 additions & 7 deletions trunk/arch/sparc/include/asm/bugs.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,11 @@
#include <asm/cpudata.h>
#endif

#ifdef CONFIG_SPARC64
#include <asm/sstate.h>
#endif

extern unsigned long loops_per_jiffy;

static void __init check_bugs(void)
{
#if defined(CONFIG_SPARC32) && !defined(CONFIG_SMP)
cpu_data(0).udelay_val = loops_per_jiffy;
#endif
#ifdef CONFIG_SPARC64
sstate_running();
#endif
}
13 changes: 0 additions & 13 deletions trunk/arch/sparc/include/asm/sstate.h

This file was deleted.

3 changes: 0 additions & 3 deletions trunk/arch/sparc64/kernel/hvapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <asm/hypervisor.h>
#include <asm/oplib.h>
#include <asm/sstate.h>

/* If the hypervisor indicates that the API setting
* calls are unsupported, by returning HV_EBADTRAP or
Expand Down Expand Up @@ -184,8 +183,6 @@ void __init sun4v_hvapi_init(void)
if (sun4v_hvapi_register(group, major, &minor))
goto bad;

sun4v_sstate_init();

return;

bad:
Expand Down
4 changes: 0 additions & 4 deletions trunk/arch/sparc64/kernel/reboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <linux/module.h>
#include <linux/pm.h>

#include <asm/sstate.h>
#include <asm/oplib.h>
#include <asm/prom.h>

Expand All @@ -24,7 +23,6 @@ EXPORT_SYMBOL(pm_power_off);

void machine_power_off(void)
{
sstate_poweroff();
if (strcmp(of_console_device->type, "serial") || scons_pwroff)
prom_halt_power_off();

Expand All @@ -33,7 +31,6 @@ void machine_power_off(void)

void machine_halt(void)
{
sstate_halt();
prom_halt();
panic("Halt failed!");
}
Expand All @@ -42,7 +39,6 @@ void machine_restart(char *cmd)
{
char *p;

sstate_reboot();
p = strchr(reboot_command, '\n');
if (p)
*p = 0;
Expand Down
67 changes: 45 additions & 22 deletions trunk/arch/sparc64/kernel/sstate.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/* sstate.c: System soft state support.
*
* Copyright (C) 2007 David S. Miller <davem@davemloft.net>
* Copyright (C) 2007, 2008 David S. Miller <davem@davemloft.net>
*/

#include <linux/kernel.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>

#include <asm/hypervisor.h>
#include <asm/sstate.h>
#include <asm/spitfire.h>
#include <asm/oplib.h>
#include <asm/head.h>
#include <asm/io.h>
Expand Down Expand Up @@ -50,31 +51,34 @@ static const char rebooting_msg[32] __attribute__((aligned(32))) =
static const char panicing_msg[32] __attribute__((aligned(32))) =
"Linux panicing";

void sstate_booting(void)
static int sstate_reboot_call(struct notifier_block *np, unsigned long type, void *_unused)
{
do_set_sstate(HV_SOFT_STATE_TRANSITION, booting_msg);
}
const char *msg;

void sstate_running(void)
{
do_set_sstate(HV_SOFT_STATE_NORMAL, running_msg);
}
switch (type) {
case SYS_DOWN:
default:
msg = rebooting_msg;
break;

void sstate_halt(void)
{
do_set_sstate(HV_SOFT_STATE_TRANSITION, halting_msg);
}
case SYS_HALT:
msg = halting_msg;
break;

void sstate_poweroff(void)
{
do_set_sstate(HV_SOFT_STATE_TRANSITION, poweroff_msg);
}
case SYS_POWER_OFF:
msg = poweroff_msg;
break;
}

void sstate_reboot(void)
{
do_set_sstate(HV_SOFT_STATE_TRANSITION, rebooting_msg);
do_set_sstate(HV_SOFT_STATE_TRANSITION, msg);

return NOTIFY_OK;
}

static struct notifier_block sstate_reboot_notifier = {
.notifier_call = sstate_reboot_call,
};

static int sstate_panic_event(struct notifier_block *n, unsigned long event, void *ptr)
{
do_set_sstate(HV_SOFT_STATE_TRANSITION, panicing_msg);
Expand All @@ -87,18 +91,37 @@ static struct notifier_block sstate_panic_block = {
.priority = INT_MAX,
};

void __init sun4v_sstate_init(void)
static int __init sstate_init(void)
{
unsigned long major, minor;

if (tlb_type != hypervisor)
return 0;

major = 1;
minor = 0;
if (sun4v_hvapi_register(HV_GRP_SOFT_STATE, major, &minor))
return;
return 0;

hv_supports_soft_state = 1;

prom_sun4v_guest_soft_state();

do_set_sstate(HV_SOFT_STATE_TRANSITION, booting_msg);

atomic_notifier_chain_register(&panic_notifier_list,
&sstate_panic_block);
register_reboot_notifier(&sstate_reboot_notifier);

return 0;
}

core_initcall(sstate_init);

static int __init sstate_running(void)
{
do_set_sstate(HV_SOFT_STATE_NORMAL, running_msg);
return 0;
}

late_initcall(sstate_running);
3 changes: 0 additions & 3 deletions trunk/arch/sparc64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
#include <asm/tsb.h>
#include <asm/hypervisor.h>
#include <asm/prom.h>
#include <asm/sstate.h>
#include <asm/mdesc.h>
#include <asm/cpudata.h>
#include <asm/irq.h>
Expand Down Expand Up @@ -1717,8 +1716,6 @@ void __init paging_init(void)
kern_base = (prom_boot_mapping_phys_low >> 22UL) << 22UL;
kern_size = (unsigned long)&_end - (unsigned long)KERNBASE;

sstate_booting();

/* Invalidate both kernel TSBs. */
memset(swapper_tsb, 0x40, sizeof(swapper_tsb));
#ifndef CONFIG_DEBUG_PAGEALLOC
Expand Down

0 comments on commit ccb2e10

Please sign in to comment.