Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1319334

[PATCH 4.3 065/157] ALSA: hda - Flush the pending probe work at remove

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.3 065/157] ALSA: hda - Flush the pending probe work at remove
Date Wed, 27 Jan 2016 19:50:03 +0100
Message-ID <qVDkf-7RP-45@gated-at.bofh.it> (permalink)
References <qVCRc-7CM-17@gated-at.bofh.it>
X-Mailer git-send-email 2.7.0
User-Agent quilt/0.64
MIME-Version 1.0
Content-Type text/plain; charset=ISO-8859-15
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 45
Organization linux.* mail to news gateway
X-Original-Cc Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Takashi Iwai <tiwai@suse.de>
X-Original-Date Wed, 27 Jan 2016 10:12:12 -0800
X-Original-Message-ID <20160127180935.880042035@linuxfoundation.org>
X-Original-References <20160127180932.533735338@linuxfoundation.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1319334

Show key headers only | View raw


4.3-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Takashi Iwai <tiwai@suse.de>

commit 991f86d7ae4e1f8c15806e62f97af519e3cdd860 upstream.

As HD-audio driver does deferred probe internally via workqueue, the
driver might go into the mixed state doing both probe and remove when
the module gets unloaded during the probe work.  This eventually
triggers an Oops, unsurprisingly.

For avoiding this race, we just need to flush the pending probe work
explicitly before actually starting the resource release.

Bugzilla: https://bugzilla.opensuse.org/show_bug.cgi?id=960710
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/pci/hda/hda_intel.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2100,9 +2100,17 @@ i915_power_fail:
 static void azx_remove(struct pci_dev *pci)
 {
 	struct snd_card *card = pci_get_drvdata(pci);
+	struct azx *chip;
+	struct hda_intel *hda;
+
+	if (card) {
+		/* flush the pending probing work */
+		chip = card->private_data;
+		hda = container_of(chip, struct hda_intel, chip);
+		flush_work(&hda->probe_work);
 
-	if (card)
 		snd_card_free(card);
+	}
 }
 
 static void azx_shutdown(struct pci_dev *pci)

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 4.3 065/157] ALSA: hda - Flush the pending probe work at remove Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-01-27 19:50 +0100

csiph-web