Skip to content

Commit

Permalink
Merge branch 'pm-cpuidle'
Browse files Browse the repository at this point in the history
* pm-cpuidle:
  cpuidle: haltpoll: allow force loading on hosts without the REALTIME hint
  intel_idle: Update copyright notice, known limitations and version
  intel_idle: Define CPUIDLE_FLAG_TLB_FLUSHED as BIT(16)
  intel_idle: Clean up kerneldoc comments for multiple functions
  intel_idle: Reorder declarations of static variables
  intel_idle: Annotate init time data structures
  intel_idle: Add __initdata annotations to init time variables
  intel_idle: Relocate definitions of cpuidle callbacks
  intel_idle: Clean up definitions of cpuidle callbacks
  intel_idle: Simplify LAPIC timer reliability checks
  • Loading branch information
Rafael J. Wysocki committed Mar 30, 2020
2 parents 8f1073e + dd52551 commit be4f654
Show file tree
Hide file tree
Showing 2 changed files with 167 additions and 147 deletions.
12 changes: 10 additions & 2 deletions drivers/cpuidle/cpuidle-haltpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
#include <linux/kvm_para.h>
#include <linux/cpuidle_haltpoll.h>

static bool force __read_mostly;
module_param(force, bool, 0444);
MODULE_PARM_DESC(force, "Load unconditionally");

static struct cpuidle_device __percpu *haltpoll_cpuidle_devices;
static enum cpuhp_state haltpoll_hp_state;

Expand Down Expand Up @@ -90,6 +94,11 @@ static void haltpoll_uninit(void)
haltpoll_cpuidle_devices = NULL;
}

static bool haltpool_want(void)
{
return kvm_para_has_hint(KVM_HINTS_REALTIME) || force;
}

static int __init haltpoll_init(void)
{
int ret;
Expand All @@ -101,8 +110,7 @@ static int __init haltpoll_init(void)

cpuidle_poll_state_init(drv);

if (!kvm_para_available() ||
!kvm_para_has_hint(KVM_HINTS_REALTIME))
if (!kvm_para_available() || !haltpool_want())
return -ENODEV;

ret = cpuidle_register_driver(drv);
Expand Down
Loading

0 comments on commit be4f654

Please sign in to comment.