[haiku-bugs] Re: [Haiku] #12306: Haiku won't shutdown

  • From: "tqh" <trac@xxxxxxxxxxxx>
  • Date: Tue, 19 Jul 2016 16:19:29 -0000

#12306: Haiku won't shutdown
----------------------+----------------------------
   Reporter:  vidrep  |      Owner:  nobody
       Type:  bug     |     Status:  reopened
   Priority:  high    |  Milestone:  R1/beta1
  Component:  System  |    Version:  R1/Development
 Resolution:          |   Keywords:
 Blocked By:          |   Blocking:
Has a Patch:  0       |   Platform:  All
----------------------+----------------------------

Comment (by tqh):

 Maybe it is because we disable all but cpu 0 before shutdown:
 {{{
                 // Make sure we run on the boot CPU (apparently needed for
 some ACPI
                 // implementations)
                 _user_set_cpu_enabled(0, true);
                 for (int32 cpu = 1; cpu < smp_get_num_cpus(); cpu++) {
                         _user_set_cpu_enabled(cpu, false);
                 }
                 // TODO: must not be called from the idle thread!
                 thread_yield();

                 status = acpi->prepare_sleep_state(ACPI_POWER_STATE_OFF,
 NULL, 0);
                 if (status == B_OK) {
                         //cpu_status state = disable_interrupts();
                         status =
 acpi->enter_sleep_state(ACPI_POWER_STATE_OFF);
                         //restore_interrupts(state);
                 }
 }}}
 Inside {{{prepare_sleep_state}}} we hang.
 From
 
https://github.com/haiku/haiku/blob/master/src/system/kernel/arch/x86/arch_cpu.cpp#L112

--
Ticket URL: <https://dev.haiku-os.org/ticket/12306#comment:50>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: