Skip to content

Commit

Permalink
ALSA: hda - Fix complete_all() timing in deferred probes
Browse files Browse the repository at this point in the history
When the probe of snd-hda-intel driver is deferred due to f/w loading
or the nested module loading, complete_all() should be also delayed
until the initialization really finished.  Otherwise, vga-switcheroo
client would start switching before the actual init is done.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Dec 2, 2013
1 parent 1cd9b2f commit 88d071f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -3876,7 +3876,8 @@ static int azx_probe(struct pci_dev *pci,
}

dev++;
complete_all(&chip->probe_wait);
if (chip->disabled)
complete_all(&chip->probe_wait);
return 0;

out_free:
Expand Down Expand Up @@ -3953,10 +3954,10 @@ static int azx_probe_continue(struct azx *chip)
if ((chip->driver_caps & AZX_DCAPS_PM_RUNTIME) || chip->use_vga_switcheroo)
pm_runtime_put_noidle(&pci->dev);

return 0;

out_free:
chip->init_failed = 1;
if (err < 0)
chip->init_failed = 1;
complete_all(&chip->probe_wait);
return err;
}

Expand Down

0 comments on commit 88d071f

Please sign in to comment.