Loading drivers/acpi/sbs.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -684,7 +684,7 @@ static int acpi_sbs_add(struct acpi_device *device) if (!sbs_manager_broken) { if (!sbs_manager_broken) { result = acpi_manager_get_info(sbs); result = acpi_manager_get_info(sbs); if (!result) { if (!result) { sbs->manager_present = 0; sbs->manager_present = 1; for (id = 0; id < MAX_SBS_BAT; ++id) for (id = 0; id < MAX_SBS_BAT; ++id) if ((sbs->batteries_supported & (1 << id))) if ((sbs->batteries_supported & (1 << id))) acpi_battery_add(sbs, id); acpi_battery_add(sbs, id); Loading drivers/cpuidle/cpuidle.c +16 −0 Original line number Original line Diff line number Diff line Loading @@ -158,9 +158,18 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv, int entered_state; int entered_state; struct cpuidle_state *target_state = &drv->states[index]; struct cpuidle_state *target_state = &drv->states[index]; bool broadcast = !!(target_state->flags & CPUIDLE_FLAG_TIMER_STOP); ktime_t time_start, time_end; ktime_t time_start, time_end; s64 diff; s64 diff; /* * Tell the time framework to switch to a broadcast timer because our * local timer will be shut down. If a local timer is used from another * CPU as a broadcast timer, this call may fail if it is not available. */ if (broadcast && tick_broadcast_enter()) return -EBUSY; trace_cpu_idle_rcuidle(index, dev->cpu); trace_cpu_idle_rcuidle(index, dev->cpu); time_start = ktime_get(); time_start = ktime_get(); Loading @@ -169,6 +178,13 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv, time_end = ktime_get(); time_end = ktime_get(); trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu); trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu); if (broadcast) { if (WARN_ON_ONCE(!irqs_disabled())) local_irq_disable(); tick_broadcast_exit(); } if (!cpuidle_state_is_coupled(dev, drv, entered_state)) if (!cpuidle_state_is_coupled(dev, drv, entered_state)) local_irq_enable(); local_irq_enable(); Loading kernel/sched/idle.c +2 −14 Original line number Original line Diff line number Diff line Loading @@ -81,7 +81,6 @@ static void cpuidle_idle_call(void) struct cpuidle_device *dev = __this_cpu_read(cpuidle_devices); struct cpuidle_device *dev = __this_cpu_read(cpuidle_devices); struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev); struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev); int next_state, entered_state; int next_state, entered_state; unsigned int broadcast; bool reflect; bool reflect; /* /* Loading Loading @@ -150,17 +149,6 @@ static void cpuidle_idle_call(void) goto exit_idle; goto exit_idle; } } broadcast = drv->states[next_state].flags & CPUIDLE_FLAG_TIMER_STOP; /* * Tell the time framework to switch to a broadcast timer * because our local timer will be shutdown. If a local timer * is used from another cpu as a broadcast timer, this call may * fail if it is not available */ if (broadcast && tick_broadcast_enter()) goto use_default; /* Take note of the planned idle state. */ /* Take note of the planned idle state. */ idle_set_state(this_rq(), &drv->states[next_state]); idle_set_state(this_rq(), &drv->states[next_state]); Loading @@ -174,8 +162,8 @@ static void cpuidle_idle_call(void) /* The cpu is no longer idle or about to enter idle. */ /* The cpu is no longer idle or about to enter idle. */ idle_set_state(this_rq(), NULL); idle_set_state(this_rq(), NULL); if (broadcast) if (entered_state == -EBUSY) tick_broadcast_exit(); goto use_default; /* /* * Give the governor an opportunity to reflect on the outcome * Give the governor an opportunity to reflect on the outcome Loading Loading
drivers/acpi/sbs.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -684,7 +684,7 @@ static int acpi_sbs_add(struct acpi_device *device) if (!sbs_manager_broken) { if (!sbs_manager_broken) { result = acpi_manager_get_info(sbs); result = acpi_manager_get_info(sbs); if (!result) { if (!result) { sbs->manager_present = 0; sbs->manager_present = 1; for (id = 0; id < MAX_SBS_BAT; ++id) for (id = 0; id < MAX_SBS_BAT; ++id) if ((sbs->batteries_supported & (1 << id))) if ((sbs->batteries_supported & (1 << id))) acpi_battery_add(sbs, id); acpi_battery_add(sbs, id); Loading
drivers/cpuidle/cpuidle.c +16 −0 Original line number Original line Diff line number Diff line Loading @@ -158,9 +158,18 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv, int entered_state; int entered_state; struct cpuidle_state *target_state = &drv->states[index]; struct cpuidle_state *target_state = &drv->states[index]; bool broadcast = !!(target_state->flags & CPUIDLE_FLAG_TIMER_STOP); ktime_t time_start, time_end; ktime_t time_start, time_end; s64 diff; s64 diff; /* * Tell the time framework to switch to a broadcast timer because our * local timer will be shut down. If a local timer is used from another * CPU as a broadcast timer, this call may fail if it is not available. */ if (broadcast && tick_broadcast_enter()) return -EBUSY; trace_cpu_idle_rcuidle(index, dev->cpu); trace_cpu_idle_rcuidle(index, dev->cpu); time_start = ktime_get(); time_start = ktime_get(); Loading @@ -169,6 +178,13 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv, time_end = ktime_get(); time_end = ktime_get(); trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu); trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu); if (broadcast) { if (WARN_ON_ONCE(!irqs_disabled())) local_irq_disable(); tick_broadcast_exit(); } if (!cpuidle_state_is_coupled(dev, drv, entered_state)) if (!cpuidle_state_is_coupled(dev, drv, entered_state)) local_irq_enable(); local_irq_enable(); Loading
kernel/sched/idle.c +2 −14 Original line number Original line Diff line number Diff line Loading @@ -81,7 +81,6 @@ static void cpuidle_idle_call(void) struct cpuidle_device *dev = __this_cpu_read(cpuidle_devices); struct cpuidle_device *dev = __this_cpu_read(cpuidle_devices); struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev); struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev); int next_state, entered_state; int next_state, entered_state; unsigned int broadcast; bool reflect; bool reflect; /* /* Loading Loading @@ -150,17 +149,6 @@ static void cpuidle_idle_call(void) goto exit_idle; goto exit_idle; } } broadcast = drv->states[next_state].flags & CPUIDLE_FLAG_TIMER_STOP; /* * Tell the time framework to switch to a broadcast timer * because our local timer will be shutdown. If a local timer * is used from another cpu as a broadcast timer, this call may * fail if it is not available */ if (broadcast && tick_broadcast_enter()) goto use_default; /* Take note of the planned idle state. */ /* Take note of the planned idle state. */ idle_set_state(this_rq(), &drv->states[next_state]); idle_set_state(this_rq(), &drv->states[next_state]); Loading @@ -174,8 +162,8 @@ static void cpuidle_idle_call(void) /* The cpu is no longer idle or about to enter idle. */ /* The cpu is no longer idle or about to enter idle. */ idle_set_state(this_rq(), NULL); idle_set_state(this_rq(), NULL); if (broadcast) if (entered_state == -EBUSY) tick_broadcast_exit(); goto use_default; /* /* * Give the governor an opportunity to reflect on the outcome * Give the governor an opportunity to reflect on the outcome Loading