~ubuntu-branches/ubuntu/quantal/linux-lowlatency/quantal-proposed

« back to all changes in this revision

Viewing changes to drivers/acpi/processor_idle.c

  • Committer: Package Import Robot
  • Author(s): Andy Whitcroft, Andy Whitcroft, Ubuntu: 3.5.0-3.3
  • Date: 2012-07-03 09:23:14 UTC
  • Revision ID: package-import@ubuntu.com-20120703092314-wjaqz3coxptokmtl
Tags: 3.5.0-3.3
[ Andy Whitcroft ]

* [Config] drop -pae from d-i configuration.
* rebase to Ubuntu-3.5.0-3.3

[ Ubuntu: 3.5.0-3.3 ]

* [Config] enable CONFIG_MEMTEST=y
  - LP: #1004535
* [Config] config-check: add support for a cut operation
* [Config] enforcer -- switch to cut where appropriate
* Rebase to v3.5-rc5
* [Config] Updateconfigs after rebase to v3.5-rc5
* SAUCE: ocfs2: Fix NULL pointer dereferrence in
  __ocfs2_change_file_space
  - LP: #1006012
* SAUCE: (drop after 3.5) drm/i915: ignore pipe select bit when checking
  for LVDS register initialization
  - LP: #1012800
* rebase to v3.5-rc5
  - LP: #1013183
  - LP: #1017017
  - LP: #884652

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
/*
225
225
 * Suspend / resume control
226
226
 */
 
227
static int acpi_idle_suspend;
227
228
static u32 saved_bm_rld;
228
229
 
229
230
static void acpi_idle_bm_rld_save(void)
242
243
 
243
244
int acpi_processor_suspend(struct acpi_device * device, pm_message_t state)
244
245
{
 
246
        if (acpi_idle_suspend == 1)
 
247
                return 0;
 
248
 
245
249
        acpi_idle_bm_rld_save();
 
250
        acpi_idle_suspend = 1;
246
251
        return 0;
247
252
}
248
253
 
249
254
int acpi_processor_resume(struct acpi_device * device)
250
255
{
 
256
        if (acpi_idle_suspend == 0)
 
257
                return 0;
 
258
 
251
259
        acpi_idle_bm_rld_restore();
 
260
        acpi_idle_suspend = 0;
252
261
        return 0;
253
262
}
254
263
 
754
763
 
755
764
        local_irq_disable();
756
765
 
 
766
        if (acpi_idle_suspend) {
 
767
                local_irq_enable();
 
768
                cpu_relax();
 
769
                return -EBUSY;
 
770
        }
 
771
 
757
772
        lapic_timer_state_broadcast(pr, cx, 1);
758
773
        kt1 = ktime_get_real();
759
774
        acpi_idle_do_entry(cx);
823
838
 
824
839
        local_irq_disable();
825
840
 
 
841
        if (acpi_idle_suspend) {
 
842
                local_irq_enable();
 
843
                cpu_relax();
 
844
                return -EBUSY;
 
845
        }
 
846
 
826
847
        if (cx->entry_method != ACPI_CSTATE_FFH) {
827
848
                current_thread_info()->status &= ~TS_POLLING;
828
849
                /*
907
928
                                                drv, drv->safe_state_index);
908
929
                } else {
909
930
                        local_irq_disable();
910
 
                        acpi_safe_halt();
 
931
                        if (!acpi_idle_suspend)
 
932
                                acpi_safe_halt();
911
933
                        local_irq_enable();
912
 
                        return -EINVAL;
 
934
                        return -EBUSY;
913
935
                }
914
936
        }
915
937
 
916
938
        local_irq_disable();
917
939
 
 
940
        if (acpi_idle_suspend) {
 
941
                local_irq_enable();
 
942
                cpu_relax();
 
943
                return -EBUSY;
 
944
        }
 
945
 
918
946
        if (cx->entry_method != ACPI_CSTATE_FFH) {
919
947
                current_thread_info()->status &= ~TS_POLLING;
920
948
                /*