[Skiboot] [PATCH 8/8] Remove dead POWER7 code

Stewart Smith stewart at flamingspork.com
Sun Nov 10 04:48:32 AEDT 2019


On Thu, Nov 7, 2019, at 5:52 AM, Nicholas Piggin wrote:
> diff --git a/core/direct-controls.c b/core/direct-controls.c
> index 507a16f50..424b3d94c 100644
> --- a/core/direct-controls.c
> +++ b/core/direct-controls.c
> @@ -522,9 +522,6 @@ int dctl_set_special_wakeup(struct cpu_thread *t)
>  	struct cpu_thread *c = t->primary;
>  	int rc = OPAL_SUCCESS;
>  
> -	if (proc_gen != proc_gen_p9 && proc_gen != proc_gen_p8)
> -		return OPAL_UNSUPPORTED;
> -

It looks like this changes the behaviour when we don't have code to set special wakeup. 

we'd actually fall through to attempting the p8 special wakeup code, which is probably going to awkwardly fail on non-p8. I don't *think* there's a check higher up the call stack that'd catch it

maybe this patch here instead:
--- a/core/direct-controls.c
+++ b/core/direct-controls.c
@@ -520,16 +520,13 @@ static int p9_sreset_thread(struct cpu_thread *cpu)
 int dctl_set_special_wakeup(struct cpu_thread *t)
 {
        struct cpu_thread *c = t->primary;
-       int rc = OPAL_SUCCESS;
-
-       if (proc_gen != proc_gen_p9 && proc_gen != proc_gen_p8)
-               return OPAL_UNSUPPORTED;
+       int rc = OPAL_UNSUPPORTED;
 
        lock(&c->dctl_lock);
        if (c->special_wakeup_count == 0) {
                if (proc_gen == proc_gen_p9)
                        rc = p9_core_set_special_wakeup(c);
-               else /* (proc_gen == proc_gen_p8) */
+               else if (proc_gen == proc_gen_p8)
                        rc = p8_core_set_special_wakeup(c);
        }
        if (!rc)


> @@ -544,9 +541,6 @@ int dctl_clear_special_wakeup(struct cpu_thread *t)
>  	struct cpu_thread *c = t->primary;
>  	int rc = OPAL_SUCCESS;
>  
> -	if (proc_gen != proc_gen_p9 && proc_gen != proc_gen_p8)
> -		return OPAL_UNSUPPORTED;
> -
>  	lock(&c->dctl_lock);
>  	if (!c->special_wakeup_count)
>  		goto out;

Same here.

> --- a/core/fast-reboot.c
> +++ b/core/fast-reboot.c
> @@ -103,12 +103,6 @@ void fast_reboot(void)
>  {
>  	static int fast_reboot_count = 0;
>  
> -	if (!chip_quirk(QUIRK_MAMBO_CALLOUTS) &&
> -			(proc_gen != proc_gen_p8 && proc_gen != proc_gen_p9)) {
> -		prlog(PR_DEBUG,
> -		      "RESET: Fast reboot not available on this CPU\n");
> -		return;
> -	}

If above code is changed to return OPAL_UNSUPPORTED on the direct control, then removing this check will still maintain the behaviour of gracefully failing if we don't have all the code in place for doing a fast reboot.


More information about the Skiboot mailing list