• Ville Syrjälä's avatar
    drm/i915: Fix runtime PM for LPE audio · 668e3b01
    Ville Syrjälä authored
    Not calling pm_runtime_enable() means that runtime PM can't be
    enabled at all via sysfs. So we definitely need to call it
    from somewhere.
    
    Calling it from the driver seems like a bad idea because it
    would have to be paired with a pm_runtime_disable() at driver
    unload time, otherwise the core gets upset. Also if there's
    no LPE audio driver loaded then we couldn't runtime suspend
    i915 either.
    
    So it looks like a better plan is to call it from i915 when
    we register the platform device. That seems to match how
    pci generally does things. I cargo culted the
    pm_runtime_forbid() and pm_runtime_set_active() calls from
    pci as well.
    
    The exposed runtime PM API is massive an thorougly misleading, so
    I don't actually know if this is how you're supposed to use the API
    or not. But it seems to work. I can now runtime suspend i915 again
    with or without the LPE audio driver loaded, and reloading the
    LPE audio driver also seems to work.
    
    Note that powertop won't auto-tune runtime PM for platform devices,
    which is a little annoying. So I'm not sure that leaving runtime
    PM in "on" mode by default is the best choice here. But I've left
    it like that for now at least.
    
    Also remove the comment about there not being much benefit from
    LPE audio runtime PM. Not allowing runtime PM blocks i915 runtime
    PM, which will also block s0ix, and that could have a measurable
    impact on power consumption.
    
    Cc: stable@vger.kernel.org
    Cc: Takashi Iwai <tiwai@suse.de>
    Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Fixes: 0b6b524f ("ALSA: x86: Don't enable runtime PM as default")
    Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Link: http://patchwork.freedesktop.org/patch/msgid/20170427160231.13337-2-ville.syrjala@linux.intel.comReviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
    (cherry picked from commit 183c0035)
    Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
    668e3b01
intel_hdmi_audio.c 50.5 KB