1. 13 Apr, 2020 5 commits
    • Takashi Iwai's avatar
      ALSA: hda: Skip controller resume if not needed · c4c8dd6e
      Takashi Iwai authored
      The HD-audio controller does system-suspend and resume operations by
      directly calling its helpers __azx_runtime_suspend() and
      __azx_runtime_resume().  However, in general, we don't have to resume
      always the device fully at the system resume; typically, if a device
      has been runtime-suspended, we can leave it to runtime resume.
      
      Usually for achieving this, the driver would call
      pm_runtime_force_suspend() and pm_runtime_force_resume() pairs in the
      system suspend and resume ops.  Unfortunately, this doesn't work for
      the resume path in our case.  For handling the jack detection at the
      system resume, a child codec device may need the (literally) forcibly
      resume even if it's been runtime-suspended, and for that, the
      controller device must be also resumed even if it's been suspended.
      
      This patch is an attempt to improve the situation.  It replaces the
      direct __azx_runtime_suspend()/_resume() calls with with
      pm_runtime_force_suspend() and pm_runtime_force_resume() with a slight
      trick as we've done for the codec side.  More exactly:
      
      - azx_has_pm_runtime() check is dropped from azx_runtime_suspend() and
        azx_runtime_resume(), so that it can be properly executed from the
        system-suspend/resume path
      
      - The WAKEEN handling depends on the card's power state now; it's set
        and cleared only for the runtime-suspend
      
      - azx_resume() checks whether any codec may need the forcible resume
        beforehand.  If the forcible resume is required, it does temporary
        PM refcount up/down for actually triggering the runtime resume.
      
      - A new helper function, hda_codec_need_resume(), is introduced for
        checking whether the codec needs a forcible runtime-resume, and the
        existing code is rewritten with that.
      
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207043
      Link: https://lore.kernel.org/r/20200413082034.25166-6-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      c4c8dd6e
    • Takashi Iwai's avatar
      ALSA: hda: Keep the controller initialization even if no codecs found · 9479e75f
      Takashi Iwai authored
      Currently, when the HD-audio controller driver doesn't detect any
      codecs, it tries to abort the probe.  But this abort happens at the
      delayed probe, i.e. the primary probe call already returned success,
      hence the driver is never unbound until user does so explicitly.
      As a result, it may leave the HD-audio device in the running state
      without the runtime PM.  More badly, if the device is a HD-audio bus
      that is tied with a GPU, GPU cannot reach to the full power down and
      consumes unnecessarily much power.
      
      This patch changes the logic after no-codec situation; it continues
      probing without the further codec initialization but keep the
      controller driver running normally.
      
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207043Tested-by: default avatarRoy Spliet <nouveau@spliet.org>
      Link: https://lore.kernel.org/r/20200413082034.25166-5-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      9479e75f
    • Takashi Iwai's avatar
      ALSA: hda: Release resources at error in delayed probe · 2393e755
      Takashi Iwai authored
      snd-hda-intel driver handles the most of its probe task in the delayed
      work (either via workqueue or via firmware loader).  When an error
      happens in the later delayed probe, we can't deregister the device
      itself because the probe callback already returned success and the
      device was bound.  So, for now, we set hda->init_failed flag and make
      the rest untouched until the device gets really unbound.
      However, this leaves the device up running, keeping the resources
      without any use that prevents other operations.
      
      In this patch, we release the resources at first when a probe error
      happens in the delayed probe stage, but keeps the top-level object, so
      that the PM and other ops can still refer to the object itself.
      
      Also for simplicity, snd_hda_intel object is allocated via devm, so
      that we can get rid of the explicit kfree calls.
      
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207043
      Link: https://lore.kernel.org/r/20200413082034.25166-4-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      2393e755
    • Takashi Iwai's avatar
      ALSA: hda: Honor PM disablement in PM freeze and thaw_noirq ops · 10db5bcc
      Takashi Iwai authored
      freeze_noirq and thaw_noirq need to check the PM availability like
      other PM ops.  There are cases where the device got disabled due to
      the error, and the PM operation should be ignored for that.
      
      Fixes: 3e6db33a ("ALSA: hda - Set SKL+ hda controller power at freeze() and thaw()")
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207043
      Link: https://lore.kernel.org/r/20200413082034.25166-3-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      10db5bcc
    • Takashi Iwai's avatar
      ALSA: hda: Don't release card at firmware loading error · 25faa4bd
      Takashi Iwai authored
      At the error path of the firmware loading error, the driver tries to
      release the card object and set NULL to drvdata.  This may be referred
      badly at the possible PM action, as the driver itself is still bound
      and the PM callbacks read the card object.
      
      Instead, we continue the probing as if it were no option set.  This is
      often a better choice than the forced abort, too.
      
      Fixes: 5cb543db ("ALSA: hda - Deferred probing with request_firmware_nowait()")
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207043
      Link: https://lore.kernel.org/r/20200413082034.25166-2-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      25faa4bd
  2. 12 Apr, 2020 4 commits
  3. 11 Apr, 2020 1 commit
  4. 09 Apr, 2020 1 commit
  5. 08 Apr, 2020 4 commits
  6. 07 Apr, 2020 5 commits
  7. 06 Apr, 2020 3 commits
  8. 04 Apr, 2020 1 commit
  9. 03 Apr, 2020 8 commits
  10. 02 Apr, 2020 2 commits
  11. 01 Apr, 2020 3 commits
  12. 31 Mar, 2020 3 commits