Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Mar 2009 18:24:41 +0200
From:      Andriy Gapon <avg@icyb.net.ua>
To:        Nate Lawson <nate@root.org>
Cc:        freebsd-acpi@FreeBSD.org
Subject:   Re: shutdown via  power button: "acpi: resumed at..."
Message-ID:  <49CA5AC9.1040601@icyb.net.ua>
In-Reply-To: <49CA57E2.7090805@root.org>
References:  <49C8E143.2080305@icyb.net.ua> <49CA57E2.7090805@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help
on 25/03/2009 18:12 Nate Lawson said the following:
> Andriy Gapon wrote:
>> I noticed that sometimes I am getting "acpi: resumed at..." message on console and
>> in system log when I initiate system shutdown by pressing power button.
>> I think that the cause is in acpi_UserNotify("Resume") call and this call is only
>> found in acpi_EnterSleepState().
>>
>> I see the following code in that function:
>>     case ACPI_STATE_S5:
>>         /*
>>          * Shut down cleanly and power off.  This will call us back through the
>>          * shutdown handlers.
>>          */
>>         shutdown_nice(RB_POWEROFF);
>>         break;
>>
>> So it seems that it is expected that shutdown_nice() would return immediately.
>> I think it makes S5 a special case comparing to other states where return happens
>> upon resuming from the state.
>> In this case, maybe it is not necessary for S5 request to go through the
>> resume/wakeup half of acpi_EnterSleepState.
>>
> 
> I thought shutdown*() should never return at all. It sounds like
> interrupts are being re-enabled or something.
> 

No, this is a different kind of shutdown, this one just send a signal to init:
void
shutdown_nice(int howto)
{

        shutdown_howto = howto;

        /* Send a signal to init(8) and have it shutdown the world */
        if (initproc != NULL) {
                PROC_LOCK(initproc);
                psignal(initproc, SIGINT);
                PROC_UNLOCK(initproc);
        } else {
                /* No init(8) running, so simply reboot */
                boot(RB_NOSYNC);
        }
        return;
}


-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49CA5AC9.1040601>