Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Gerard Neil <xyzzy@devferret.org>
Cc: alsa-devel@alsa-project.org
Subject: Re: Kernel Oops unloading snd_ymfpci, 2.6.24
Date: Thu, 20 Mar 2008 12:47:48 +0100	[thread overview]
Message-ID: <s5hod99ty57.wl%tiwai@suse.de> (raw)
In-Reply-To: <6b22a6b40803182157p59cb89bai208a96e76b201069@mail.gmail.com>

At Wed, 19 Mar 2008 15:57:56 +1100,
Gerard Neil wrote:
> 
> Hi,
> 
> I'm just upgraded to kernel 2.6.24 and I'm seeing a kernel OOPS every
> time I unload the snd_ymfpci module...
> 
> Below is what I see in my log. My naive interpretation of this is that
> the system is barfing in the interrupt handler at the time it is
> trying to free the interrupt.... so maybe the interrupt hasn't been
> disabled properly before the free_irq() call? As I say, it's a naive
> interpretation.

free_irq should be called before releasing other resources.

Does the patch below work?


Takashi

---

diff -r 3ed43822fab7 sound/pci/ymfpci/ymfpci_main.c
--- a/sound/pci/ymfpci/ymfpci_main.c	Thu Mar 20 12:30:36 2008 +0100
+++ b/sound/pci/ymfpci/ymfpci_main.c	Thu Mar 20 12:53:52 2008 +0100
@@ -2249,6 +2249,8 @@ static int snd_ymfpci_free(struct snd_ym
 #ifdef CONFIG_PM
 	vfree(chip->saved_regs);
 #endif
+	if (chip->irq >= 0)
+		free_irq(chip->irq, chip);
 	release_and_free_resource(chip->mpu_res);
 	release_and_free_resource(chip->fm_res);
 	snd_ymfpci_free_gameport(chip);
@@ -2257,8 +2259,6 @@ static int snd_ymfpci_free(struct snd_ym
 	if (chip->work_ptr.area)
 		snd_dma_free_pages(&chip->work_ptr);
 	
-	if (chip->irq >= 0)
-		free_irq(chip->irq, chip);
 	release_and_free_resource(chip->res_reg_area);
 
 	pci_write_config_word(chip->pci, 0x40, chip->old_legacy_ctrl);

  reply	other threads:[~2008-03-20 11:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-19  4:57 Kernel Oops unloading snd_ymfpci, 2.6.24 Gerard Neil
2008-03-20 11:47 ` Takashi Iwai [this message]
2008-03-21 13:48   ` Gerard Neil
2008-03-22  9:27     ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hod99ty57.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=xyzzy@devferret.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox