Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88d071fc authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: hda - Fix complete_all() timing in deferred probes



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: default avatarTakashi Iwai <tiwai@suse.de>
parent 1cd9b2f7
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -3876,6 +3876,7 @@ static int azx_probe(struct pci_dev *pci,
	}

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

@@ -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:
	if (err < 0)
		chip->init_failed = 1;
	complete_all(&chip->probe_wait);
	return err;
}