Skip to content

Commit

Permalink
ALSA: hda - Cancel probe work instead of flush at remove
Browse files Browse the repository at this point in the history
The commit [991f86d: ALSA: hda - Flush the pending probe work at
remove] introduced the sync of async probe work at remove for fixing
the race.  However, this may lead to another hangup when the module
removal is performed quickly before starting the probe work, because
it issues flush_work() and it's blocked forever.

The workaround is to use cancel_work_sync() instead of flush_work()
there.

Fixes: 991f86d ('ALSA: hda - Flush the pending probe work at remove')
Cc: <[email protected]> # v3.17+
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Feb 15, 2016
1 parent d99a36f commit 0b8c821
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -2168,10 +2168,10 @@ static void azx_remove(struct pci_dev *pci)
struct hda_intel *hda;

if (card) {
/* flush the pending probing work */
/* cancel the pending probing work */
chip = card->private_data;
hda = container_of(chip, struct hda_intel, chip);
flush_work(&hda->probe_work);
cancel_work_sync(&hda->probe_work);

snd_card_free(card);
}
Expand Down

0 comments on commit 0b8c821

Please sign in to comment.