Skip to content

Commit

Permalink
ALSA: hda - Fix path power activation
Browse files Browse the repository at this point in the history
The widget power-saving code tries to turn up/down the power of each
widget in the I/O paths that are modified at each jack plug/unplug.
The recent report revealed that the power activation leaves some
widgets unpowered after plugging.  This is because
snd_hda_activate_path() turns on path->active flag at the end of the
function while the path power management is done before that.  Then
it's regarded as if nothing is active, and the driver turns off the
power.

The fix is simply to set the flag at the beginning of the function,
before trying to power up.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=102521
Cc: <stable@vger.kernel.org> [v4.1+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Aug 25, 2015
1 parent 9d2b48f commit c7cd0ef
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions sound/pci/hda/hda_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,8 +884,7 @@ void snd_hda_activate_path(struct hda_codec *codec, struct nid_path *path,
struct hda_gen_spec *spec = codec->spec;
int i;

if (!enable)
path->active = false;
path->active = enable;

/* make sure the widget is powered up */
if (enable && (spec->power_down_unused || codec->power_save_node))
Expand All @@ -903,9 +902,6 @@ void snd_hda_activate_path(struct hda_codec *codec, struct nid_path *path,
if (has_amp_out(codec, path, i))
activate_amp_out(codec, path, i, enable);
}

if (enable)
path->active = true;
}
EXPORT_SYMBOL_GPL(snd_hda_activate_path);

Expand Down

0 comments on commit c7cd0ef

Please sign in to comment.