Re: oops in Audiowerk2 ALSA driver

Previous thread: [PATCH 1/1] arch/x86/kernel/io_apic_32.c : use kzalloc instead of kmalloc/memset by JAILLET Christophe on Sunday, June 22, 2008 - 12:03 pm. (2 messages)

Next thread: [REGRESSION] 2.6.24/25: random lockups when accessing external USB harddrive by Stefan Becker on Sunday, June 22, 2008 - 12:55 pm. (45 messages)
To: Cedric Bregardis <cedric.bregardis@...>, Jean-Christian Hassler <jhassler@...>
Cc: LKML <linux-kernel@...>, Takashi Iwai <tiwai@...>
Date: Sunday, June 22, 2008 - 12:47 pm

Hi
There's a race between registration routine and interrupt handler in aw2 driver
which manifested as oops on some box [1].

When snd_aw2_create calls request_irq chip data are not yet fully initialized.
If interrupt raises before snd_aw2_create call snd_aw2_saa7146_setup, driver may
oops or read/write other port than its own. (chip->base_addr is initialized in
snd_aw2_saa7146_setup, but is used in snd_aw2_saa7146_interrupt via READREG/WRITEREG)

The simple fix would be to move call to snd_aw2_saa7146_setup before request_irq,
but snd_aw2_saa7146_setup enables interrupts...

PS: I don't have this hardware.

Marcin

[1] http://kerneloops.org/guilty.php?guilty=snd_aw2_saa7146_interrupt&versio...
--

To: Marcin Slusarz <marcin.slusarz@...>
Cc: Cedric Bregardis <cedric.bregardis@...>, Jean-Christian Hassler <jhassler@...>, LKML <linux-kernel@...>
Date: Monday, June 23, 2008 - 8:18 am

At Sun, 22 Jun 2008 18:47:17 +0200,

Thanks for spotting the bug.
I fixed this on my git tree now and will post a pull request soon
later.

Takashi
--

Previous thread: [PATCH 1/1] arch/x86/kernel/io_apic_32.c : use kzalloc instead of kmalloc/memset by JAILLET Christophe on Sunday, June 22, 2008 - 12:03 pm. (2 messages)

Next thread: [REGRESSION] 2.6.24/25: random lockups when accessing external USB harddrive by Stefan Becker on Sunday, June 22, 2008 - 12:55 pm. (45 messages)