Re: Oops in set_spdif_output in i810_audio

2005-04-04 Thread Herbert Xu
SuD Alex <[EMAIL PROTECTED]> wrote:
> 
> * It seems to me that it detects only 1 card with 1 only codec which is 
> the sound card (sound works if i avoid the null pointer oops). So one of 
> the problems is the wrong detection.
> Googling i found that  jgarzik already got a patch for this 
> (ac97_codec.c:158):
> +{0x43585430, "CXT48",&default_ops,
> AC97_DELUDED_MODEM },

Can you please check if this patch works? It's what ALSA does.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
= sound/oss/ac97_codec.c 1.24 vs edited =
--- 1.24/sound/oss/ac97_codec.c 2005-03-08 15:41:36 +11:00
+++ edited/sound/oss/ac97_codec.c   2005-04-04 16:07:11 +10:00
@@ -721,14 +721,15 @@
  
 static int ac97_check_modem(struct ac97_codec *codec)
 {
+   unsigned int eid;
+
/* Check for an AC97 1.0 soft modem (ID1) */
if(codec->codec_read(codec, AC97_RESET) & 2)
return 1;
/* Check for an AC97 2.x soft modem */
codec->codec_write(codec, AC97_EXTENDED_MODEM_ID, 0L);
-   if(codec->codec_read(codec, AC97_EXTENDED_MODEM_ID) & 1)
-   return 1;
-   return 0;
+   eid = codec->codec_read(codec, AC97_EXTENDED_MODEM_ID);
+   return eid != 0x && (eid & 1);
 }
 
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Oops in set_spdif_output in i810_audio

2005-04-03 Thread SuD (Alex)
Triffid Hunter wrote:
try turning off your internal modem in bios until someone works out 
whats going on here
* It's one of those modern bios, no way of configuring that.
* It seems to me that it detects only 1 card with 1 only codec which is 
the sound card (sound works if i avoid the null pointer oops). So one of 
the problems is the wrong detection.
Googling i found that  jgarzik already got a patch for this 
(ac97_codec.c:158):
+{0x43585430, "CXT48",&default_ops,
AC97_DELUDED_MODEM },

* About fixing i810_probe/i810_ac97_init, the safest and simplest 
solution may be changing "continue" for "break" (i810_audio.c:3089), 
i.e. give up scanning for sound codecs when the first modem is found. I 
don't if that would prevent any real-world device from working, but the 
alternative is add a lot of checks everywhere.

See you.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Fw: Oops in set_spdif_output in i810_audio

2005-04-03 Thread Herbert Xu
On Sun, Apr 03, 2005 at 10:14:27PM +1000, herbert wrote:
> 
> I personally don't see a reason why we should allow it to
> continue when the codec doesn't exist.  What do you guys think?

Actually, anybody trying to use this driver without a codec
would've hit the same crash.  Since nobody has complained
before, we should just fail the registration if there is
no codec.

Then we can get rid of all the existing codec != NULL checks.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Fw: Oops in set_spdif_output in i810_audio

2005-04-03 Thread Herbert Xu
On Sat, Apr 02, 2005 at 04:28:40PM -0800, Andrew Morton wrote:
> 
> *** These are init messages & oops:
> i810_audio: Unknown symbol ac97_set_dac_rate
> i810_audio: Unknown symbol ac97_release_codec
> i810_audio: Unknown symbol ac97_set_adc_rate
> i810_audio: Unknown symbol ac97_alloc_codec
> i810_audio: Unknown symbol ac97_probe_codec

The codec initialisation failed so the codec is NULL.

> EIP is at i810_set_spdif_output+0x22/0x160 [i810_audio]

Boom as we dereferenced the codec.

Is there any reason why we should allow i810_probe to succeed
when there is no codec?

If not we can make i810_ac97_init fail in this case.

If so then we'll have to make sure that every dereference of
codec in this driver checks whether it's NULL.

I personally don't see a reason why we should allow it to
continue when the codec doesn't exist.  What do you guys think?

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Oops in set_spdif_output in i810_audio

2005-04-03 Thread Triffid Hunter
try turning off your internal modem in bios until someone works out whats going 
on here
SuD (Alex) wrote:
Hi, i got a new ahtec laptop and i get null pointer oops everytime i 
load i810_audio on 2.4 and 2.6 (including 2.6.11.6) kernels.

*** These are init messages & oops:
i810_audio: Unknown symbol ac97_set_dac_rate
i810_audio: Unknown symbol ac97_release_codec
i810_audio: Unknown symbol ac97_set_adc_rate
i810_audio: Unknown symbol ac97_alloc_codec
i810_audio: Unknown symbol ac97_probe_codec
Intel 810 + AC97 Audio, version 1.01, 04:15:45 Jan 24 2005
ACPI: PCI interrupt :00:1f.5[B] -> GSI 10 (level, low) -> IRQ 10
i810: Intel ICH4 found at IO 0x18c0 and 0x1c00, MEM 0xe0100c00 and 
0xe0100800, IRQ 10
i810: Intel ICH4 mmio at 0xde9f3c00 and 0xdea84800
i810_audio: Primary codec has ID 0
i810_audio: Audio Controller supports 6 channels.
i810_audio: Defaulting to base 2 channel mode.
i810_audio: Resetting connection 0
i810_audio: Connection 0 with codec id 0
ac97_codec: AC97 Modem codec, id: CXT48 (Unknown)
i810_audio: codec 0 is a softmodem - skipping.
...
EIP:0060:[]Not tainted
EFLAGS: 00010246   (2.6.8-2-686)
EIP is at i810_set_spdif_output+0x22/0x160 [i810_audio]
eax:    ebx:    ecx: d9c28400   edx: d9c28400
esi:    edi:    ebp: d6edfb80   esp: d7383e30
ds: 007b   es: 007b   ss: 0068
Process insmod (pid: 3358, threadinfo=d7382000 task=dca643b0)
Stack: 4461 ffce c011c7f4  d6edfb80  d6edfc18 

  dec4ff9f d6edfb80   dec51740 d7383e7c dda3c240 
0a04
  d9c28400 dec4fdb0 d6edfbb0 d9c28400  0001  
0001
Call Trace:
[] release_console_sem+0xc4/0xd0
[] i810_configure_clocking+0xbf/0x4c0 [i810_audio]
[] i810_ac97_init+0x4a0/0x5d0 [i810_audio]
[] i810_probe+0x4af/0x690 [i810_audio]

*** This is my device:
:00:1f.5 Multimedia audio controller: Intel Corp. 82801DB/DBL/DBM 
(ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 03)
   Subsystem: QUANTA Computer Inc: Unknown device 0707
   Flags: bus master, medium devsel, latency 0, IRQ 10
   I/O ports at 1c00 [size=256]
   I/O ports at 18c0 [size=64]
   Memory at e0100c00 (32-bit, non-prefetchable) [size=512]
   Memory at e0100800 (32-bit, non-prefetchable) [size=256]
   Capabilities: [50] Power Management version 2

*** What happened in set_spdif_output:
 struct ac97_codec *codec = state->card->ac97_codec[0];
// ... for some reason codec is NULL, and then
 if(!codec->codec_ops->digital)
// ... oops
*** Why is that null?
  Perhaps it is because the driver thinks that the card is a modem and 
releases it. So no codecs are available, but some functions expect at 
least one codec to exist.

  if(codec->modem)
   {
   printk(KERN_WARNING "i810_audio: codec %d is a 
softmodem - skipping.\n", ac97_id);
   ac97_release_codec(codec);

 And is detected as modem because of this condition (in ac97_codec.c):
 /* Check for an AC97 1.0 soft modem (ID1) */
 if(codec->codec_read(codec, AC97_RESET) & 2)   
I don't know much about ac97, i also have an ac97 modem. Anybody knows 
what is wrong?

Btw, Alsa snd-intel8x0 driver works, but as many distros still default 
to Oss i think this bug should be hunt.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Oops in set_spdif_output in i810_audio

2005-04-02 Thread SuD (Alex)
Hi, i got a new ahtec laptop and i get null pointer oops everytime i 
load i810_audio on 2.4 and 2.6 (including 2.6.11.6) kernels.

*** These are init messages & oops:
i810_audio: Unknown symbol ac97_set_dac_rate
i810_audio: Unknown symbol ac97_release_codec
i810_audio: Unknown symbol ac97_set_adc_rate
i810_audio: Unknown symbol ac97_alloc_codec
i810_audio: Unknown symbol ac97_probe_codec
Intel 810 + AC97 Audio, version 1.01, 04:15:45 Jan 24 2005
ACPI: PCI interrupt :00:1f.5[B] -> GSI 10 (level, low) -> IRQ 10
i810: Intel ICH4 found at IO 0x18c0 and 0x1c00, MEM 0xe0100c00 and 
0xe0100800, IRQ 10
i810: Intel ICH4 mmio at 0xde9f3c00 and 0xdea84800
i810_audio: Primary codec has ID 0
i810_audio: Audio Controller supports 6 channels.
i810_audio: Defaulting to base 2 channel mode.
i810_audio: Resetting connection 0
i810_audio: Connection 0 with codec id 0
ac97_codec: AC97 Modem codec, id: CXT48 (Unknown)
i810_audio: codec 0 is a softmodem - skipping.
...
EIP:0060:[]Not tainted
EFLAGS: 00010246   (2.6.8-2-686)
EIP is at i810_set_spdif_output+0x22/0x160 [i810_audio]
eax:    ebx:    ecx: d9c28400   edx: d9c28400
esi:    edi:    ebp: d6edfb80   esp: d7383e30
ds: 007b   es: 007b   ss: 0068
Process insmod (pid: 3358, threadinfo=d7382000 task=dca643b0)
Stack: 4461 ffce c011c7f4  d6edfb80  d6edfc18 

  dec4ff9f d6edfb80   dec51740 d7383e7c dda3c240 
0a04
  d9c28400 dec4fdb0 d6edfbb0 d9c28400  0001  
0001
Call Trace:
[] release_console_sem+0xc4/0xd0
[] i810_configure_clocking+0xbf/0x4c0 [i810_audio]
[] i810_ac97_init+0x4a0/0x5d0 [i810_audio]
[] i810_probe+0x4af/0x690 [i810_audio]

*** This is my device:
:00:1f.5 Multimedia audio controller: Intel Corp. 82801DB/DBL/DBM 
(ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 03)
   Subsystem: QUANTA Computer Inc: Unknown device 0707
   Flags: bus master, medium devsel, latency 0, IRQ 10
   I/O ports at 1c00 [size=256]
   I/O ports at 18c0 [size=64]
   Memory at e0100c00 (32-bit, non-prefetchable) [size=512]
   Memory at e0100800 (32-bit, non-prefetchable) [size=256]
   Capabilities: [50] Power Management version 2

*** What happened in set_spdif_output:
 struct ac97_codec *codec = state->card->ac97_codec[0];
// ... for some reason codec is NULL, and then
 if(!codec->codec_ops->digital)
// ... oops
*** Why is that null?
  Perhaps it is because the driver thinks that the card is a modem and 
releases it. So no codecs are available, but some functions expect at 
least one codec to exist.

  if(codec->modem)
   {
   printk(KERN_WARNING "i810_audio: codec %d is a 
softmodem - skipping.\n", ac97_id);
   ac97_release_codec(codec);

 And is detected as modem because of this condition (in ac97_codec.c):
 /* Check for an AC97 1.0 soft modem (ID1) */
 if(codec->codec_read(codec, AC97_RESET) & 2)

I don't know much about ac97, i also have an ac97 modem. Anybody knows 
what is wrong?

Btw, Alsa snd-intel8x0 driver works, but as many distros still default 
to Oss i think this bug should be hunt.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/