From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: Re: rmmod snd-es1968 crashes my laptop... Date: Tue, 15 Jun 2004 13:04:39 +0200 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: <200406132023.48894.annabellesgarden@yahoo.de> <200406150051.00056.annabellesgarden@yahoo.de> Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: multipart/mixed; boundary="Multipart_Tue_Jun_15_13:04:39_2004-1" Return-path: In-Reply-To: <200406150051.00056.annabellesgarden@yahoo.de> Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Karsten Wiese Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org --Multipart_Tue_Jun_15_13:04:39_2004-1 Content-Type: text/plain; charset=US-ASCII At Tue, 15 Jun 2004 00:50:59 +0200, Karsten Wiese wrote: > > Am Montag 14 Juni 2004 15:39 schrieb Takashi Iwai: > > At Sun, 13 Jun 2004 20:23:48 +0200, > This patch keeps the "snd_es1968_set_acpi(chip, ACPI_D3);": (snip) > I think its OK to commit with comment: > > - Prevent shared Interrupts from other devices > causing crash on device free. > > (Analysis: > the crash was induced when the usb interrupt was still reached to > snd_es1968_interrupt: > the value "event = inb(chip->io_port + 0x1A)" will possibly be != 0 cause the > device went into high Z state, so snd_es1968_interrupt falsely tries to > handle the alien interrupt.... > by telling kernel that the module doesn't handle interrupts any more before > switching the device into powersave mode we keep the system sane. > or so....) Then we should move free_irq() itself before releasing other resources. calling snd_es1968_set_acpi() after release io's is invalid. How about the attached patch? Takashi --Multipart_Tue_Jun_15_13:04:39_2004-1 Content-Type: text/plain; charset=US-ASCII Index: alsa-kernel/pci/es1968.c =================================================================== RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/pci/es1968.c,v retrieving revision 1.66 diff -u -r1.66 es1968.c --- alsa-kernel/pci/es1968.c 26 Apr 2004 10:58:07 -0000 1.66 +++ alsa-kernel/pci/es1968.c 15 Jun 2004 11:00:02 -0000 @@ -2470,6 +2470,8 @@ outw(0, chip->io_port + ESM_PORT_HOST_IRQ); /* disable IRQ */ } + if (chip->irq >= 0) + free_irq(chip->irq, (void *)chip); #ifdef SUPPORT_JOYSTICK if (chip->res_joystick) { gameport_unregister_port(&chip->gameport); @@ -2484,8 +2486,6 @@ release_resource(chip->res_io_port); kfree_nocheck(chip->res_io_port); } - if (chip->irq >= 0) - free_irq(chip->irq, (void *)chip); snd_magic_kfree(chip); return 0; } --Multipart_Tue_Jun_15_13:04:39_2004-1-- ------------------------------------------------------- This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND