• Stanislaw Gruszka's avatar
    thermal: intel: hfi: Enable HFI only when required · b33f3d26
    Stanislaw Gruszka authored
    Enable and disable hardware feedback interface (HFI) when user space
    handler is present. For example, enable HFI, when intel-speed-select or
    Intel Low Power daemon is running and subscribing to thermal netlink
    events. When user space handlers exit or remove subscription for
    thermal netlink events, disable HFI.
    
    Summary of changes:
    
     - Register a thermal genetlink notifier
    
     - In the notifier, process THERMAL_NOTIFY_BIND and THERMAL_NOTIFY_UNBIND
       reason codes to count number of thermal event group netlink multicast
       clients. If thermal netlink group has any listener enable HFI on all
       packages. If there are no listener disable HFI on all packages.
    
    - When CPU is online, instead of blindly enabling HFI, check if
      the thermal netlink group has any listener. This will make sure that
      HFI is not enabled by default during boot time.
    
    - Actual processing to enable/disable matches what is done in
      suspend/resume callbacks. Create two functions hfi_enable_instance()
      and hfi_disable_instance(), which can be called from the netlink
      notifier callback and suspend/resume callbacks.
    Signed-off-by: default avatarStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    b33f3d26
intel_hfi.c 18.6 KB