From edwin@cgmd76206.chello.nl  Tue Apr  4 13:16:59 2000
Return-Path: <edwin@cgmd76206.chello.nl>
Received: from cgmd76206.chello.nl (cgmd76206.chello.nl [212.83.76.206])
	by hub.freebsd.org (Postfix) with ESMTP id D1A6E37B908
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  4 Apr 2000 13:16:53 -0700 (PDT)
	(envelope-from edwin@cgmd76206.chello.nl)
Received: (from edwin@localhost)
	by cgmd76206.chello.nl (8.9.3/8.9.3) id WAA01996;
	Tue, 4 Apr 2000 22:16:51 +0200 (CEST)
	(envelope-from mavetju@chello.nl)
Message-Id: <200004042016.WAA01996@cgmd76206.chello.nl>
Date: Tue, 4 Apr 2000 22:16:51 +0200 (CEST)
From: mavetju@chello.nl
Sender: edwin@cgmd76206.chello.nl
Reply-To: mavetju@chello.nl
To: FreeBSD-gnats-submit@freebsd.org
Subject: pcm driver failes to load for Neomagic on IBM Thinkpad 390
X-Send-Pr-Version: 3.2

>Number:         17796
>Category:       kern
>Synopsis:       pcm drivers failes to load for Neomagic on IBM Thinkpad 390
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    cg
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr  4 13:20:00 PDT 2000
>Closed-Date:    Fri Apr 6 18:45:38 PDT 2001
>Last-Modified:  Fri Apr 06 18:45:55 PDT 2001
>Originator:     Edwin Groothuis, Joost Bekkers
>Release:        FreeBSD 4.0-RELEASE i386
>Organization:
-
>Environment:

	FreeBSD 4.0 on an IBM thinkpad with a NeoMagic 256AX Audio Controller.
	Version of filles:
		ac97.c: 1.7
		mixer.c: 1.5
		sound.c: 1.18
		neomagic.c: 1.8
	It worked fine under 3.4

>Description:

	I've talked to Guido van Rooij about this, he advised me
	to use the new sources. It didn't work, it hangs just before
	the detection of the exact chipset.

	What is happening is that the call to ac97_create() works
	and returns a valid value, then ac97_initmixer() is called,
	the call to "i=rdcd(codec,AC97_REG_RESET)" is done and that
	one never returns. When looking deeper into it, it hangs
	in the call to nm_rd called from nm_rdcd() in neomagic.c:
	x=nm_rd(sc,sc->ac97_base+regno,2)

	In the kernel config it's defined as:
		device pcm

>How-To-Repeat:

	

>Fix:
	
	None known by us, we don't have enough information regarding the hardware.
	We would like to be used as guinnae-pigs for this if needed.
	If more information is needed please let us know.


>Release-Note:
>Audit-Trail:

From: "Eric Masson" <e-masson@kisoft-services.com>
To: freebsd-gnats-submit@FreeBSD.org, mavetju@chello.nl
Cc:  
Subject: Re: kern/17796: pcm drivers failes to load for Neomagic on IBM Thinkpad 390
Date: Mon,  7 Aug 2000 14:24:49 +0200

 Hello,
 
 Here's a quick'n'dirty fix. Add a kernel option to disable probing of
 Neomagic 256AV chip by pcm.
 
 Kernel configuration file
 
 options		NEOMAGIC_TP390
 device		pcm0	at isa? port 0x530 irq 5 drq 0 flags 0x11
 
 Here are the diffs to implement the kernel option :
 
 --- options.i386.orig	Mon Aug  7 13:16:44 2000
 +++ options.i386	Mon Aug  7 13:19:43 2000
 @@ -139,6 +139,9 @@
  GUS_DMA			opt_sound.h
  GUS_IRQ			opt_sound.h
  
 +# newpcm options
 +NEOMAGIC_TP390			opt_sound.h
 +
  # Video spigot
  SPIGOT_UNSECURE		opt_spigot.h
  
 --- neomagic.c.orig	Mon Aug  7 12:42:31 2000
 +++ neomagic.c	Mon Aug  7 13:39:05 2000
 @@ -28,6 +28,7 @@
   * $FreeBSD: src/sys/dev/sound/pci/neomagic.c,v 1.7.2.3 2000/07/19 21:18:45 cg Exp $
   */
  
 +#include <opt_sound.h>
  #include <dev/sound/pcm/sound.h>
  #include <dev/sound/pcm/ac97.h>
  #include <dev/sound/pci/neomagic.h>
 @@ -560,10 +561,14 @@
  nm_pci_probe(device_t dev)
  {
  	char *s = NULL;
 -	u_int32_t subdev, i;
 +	u_int32_t subdev;
 +#ifndef NEOMAGIC_TP390
 +	u_int32_t i;
 +#endif
  
  	subdev = (pci_get_subdevice(dev) << 16) | pci_get_subvendor(dev);
  	switch (pci_get_devid(dev)) {
 +#ifndef NEOMAGIC_TP390
  	case NM256AV_PCI_ID:
  		i = 0;
  		while ((i < NUM_BADCARDS) && (badcards[i] != subdev))
 @@ -573,6 +578,7 @@
  		DEB(else)
  			DEB(device_printf(dev, "this is a non-ac97 NM256AV, not attaching\n"));
  		break;
 +#endif
  
  	case NM256ZX_PCI_ID:
  		s = "NeoMagic 256ZX";
 
 Regards
 
 Eric Masson
 -- 
 Progress : (n) What led from smart users in front of dumb terminals to 
 dumb users in front of smart terminals.
 
 
Responsible-Changed-From-To: freebsd-bugs->cg 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Mon Aug 7 05:52:56 PDT 2000 
Responsible-Changed-Why:  
Cameron, this one now contains a quick'n'dirty fix. :-) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=17796 

From: "Cameron Grant" <gandalf@vilnya.demon.co.uk>
To: <freebsd-gnats-submit@FreeBSD.org>, <mavetju@chello.nl>
Cc:  
Subject: Re: kern/17796: pcm drivers failes to load for Neomagic on IBM Thinkpad 390
Date: Mon, 7 Aug 2000 16:38:24 +0100

 this is a non-ac97 NM256AV.  give me the output from 'pciconf -l' and i can
 add it to the no-attach list.
 
     -cg
 
 
 

From: "Eric Masson" <e-masson@kisoft-services.com>
To: freebsd-gnats-submit@FreeBSD.org, mavetju@chello.nl
Cc:  
Subject: Re: kern/17796: pcm drivers failes to load for Neomagic on IBM Thinkpad 390
Date: Mon,  7 Aug 2000 18:23:53 +0200

 Hello Cameron,
 
 Here's the output of pciconf -l on my box :
 
 chip0@pci0:0:0:	class=0x060000 card=0x00000000 chip=0x71928086 rev=0x02 hdr=0x00
 isab0@pci0:2:0:	class=0x068000 card=0x00000000 chip=0x71108086 rev=0x02 hdr=0x00
 atapci0@pci0:2:1:	class=0x010180 card=0x00000000 chip=0x71118086 rev=0x01 hdr=0x00
 none0@pci0:2:2:	class=0x0c0300 card=0x00000000 chip=0x71128086 rev=0x01 hdr=0x00
 chip1@pci0:2:3:	class=0x068000 card=0x00000000 chip=0x71138086 rev=0x02 hdr=0x00
 pcic-pci0@pci0:3:0:	class=0x060700 card=0x00921014 chip=0xac16104c rev=0x02 hdr=0x02
 pcic-pci1@pci0:3:1:	class=0x060700 card=0x00921014 chip=0xac16104c rev=0x02 hdr=0x02
 none1@pci0:5:0:	class=0x030000 card=0x00dd1014 chip=0x000510c8 rev=0x12 hdr=0x00
 chip2@pci0:5:1:	class=0x040100 card=0x00dd1014 chip=0x800510c8 rev=0x12 hdr=0x00
 
 Regards
 
 Eric Masson
 
 

From: Joost Bekkers <joost@bps.frust.eu.org>
To: Cameron Grant <gandalf@vilnya.demon.co.uk>
Cc: freebsd-gnats-submit@FreeBSD.org, mavetju@chello.nl
Subject: Re: kern/17796: pcm drivers failes to load for Neomagic on IBM Thinkpad 390
Date: Tue, 8 Aug 2000 08:36:01 +0200

 On Mon, Aug 07, 2000 at 04:38:24PM +0100, Cameron Grant wrote:
 > this is a non-ac97 NM256AV.  give me the output from 'pciconf -l' and i can
 > add it to the no-attach list.
 > 
 >     -cg
 > 
  
 chip0@pci0:0:0:	class=0x060000 card=0x00000000 chip=0x71008086 rev=0x01 hdr=0x00
 isab0@pci0:2:0:	class=0x068000 card=0x00000000 chip=0x71108086 rev=0x02 hdr=0x00
 atapci0@pci0:2:1:	class=0x010180 card=0x00000000 chip=0x71118086 rev=0x01 hdr=0x00
 uhci0@pci0:2:2:	class=0x0c0300 card=0x00000000 chip=0x71128086 rev=0x01 hdr=0x00
 chip1@pci0:2:3:	class=0x068000 card=0x00000000 chip=0x71138086 rev=0x02 hdr=0x00
 pcic-pci0@pci0:3:0:	class=0x060700 card=0x00921014 chip=0xac16104c rev=0x02 hdr=0x02
 pcic-pci1@pci0:3:1:	class=0x060700 card=0x00921014 chip=0xac16104c rev=0x02 hdr=0x02
 none0@pci0:5:0:	class=0x030000 card=0x00dd1014 chip=0x000510c8 rev=0x20 hdr=0x00
 chip2@pci0:5:1:	class=0x040100 card=0x00dd1014 chip=0x800510c8 rev=0x20 hdr=0x00
 
 during boot this message is displayed:
 chip2: <NeoMagic MagicMedia 256AX Audio controller> mem 0xfec00000-0xfecfffff,0x
 fe400000-0xfe7fffff irq 11 at device 5.1 on pci0
 
 greetz Joost
 

From: Joost Bekkers <joost@bps.frust.eu.org>
To: Eric Masson <e-masson@kisoft-services.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/17796: pcm drivers failes to load for Neomagic on IBM Thinkpad 390
Date: Tue, 15 Aug 2000 13:30:15 +0200

 On Mon, Aug 07, 2000 at 02:24:49PM +0200, Eric Masson wrote:
 > Hello,
 > 
 > Here's a quick'n'dirty fix. Add a kernel option to disable probing of
 > Neomagic 256AV chip by pcm.
 > 
 > Kernel configuration file
 > 
 > options		NEOMAGIC_TP390
 > device		pcm0	at isa? port 0x530 irq 5 drq 0 flags 0x11
 > 
 > Here are the diffs to implement the kernel option :
 <--cut-->
 
 it works! I've got sound!
 
 thanx.
 

From: Eric Masson <e-masson@kisoft-services.com>
To: Joost Bekkers <joost@bps.frust.eu.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/17796: pcm drivers failes to load for Neomagic on IBM Thinkpad 390
Date: Tue, 15 Aug 2000 15:58:44 +0200 (CEST)

 >>>>> "Joost" == Joost Bekkers <joost@bps.frust.eu.org> writes:
 
     Joost> it works! I've got sound!
     Joost> thanx.
 
 All right,
 
 I've looked at Cameron's patch in current and there's a better way to make
 the sound work.
 
 On your box issue a pciconf -l as root, you should see something like the
 above :
 
 chip0@pci0:0:0:	class=0x060000 card=0x00000000 chip=0x71928086 rev=0x02 hdr=0x00
 isab0@pci0:2:0:	class=0x068000 card=0x00000000 chip=0x71108086 rev=0x02 hdr=0x00
 atapci0@pci0:2:1:	class=0x010180 card=0x00000000 chip=0x71118086 rev=0x01 hdr=0x00
 uhci0@pci0:2:2:	class=0x0c0300 card=0x00000000 chip=0x71128086 rev=0x01 hdr=0x00
 intpm0@pci0:2:3:	class=0x068000 card=0x00000000 chip=0x71138086 rev=0x02 hdr=0x00
 pcic-pci0@pci0:3:0:	class=0x060700 card=0x00921014 chip=0xac16104c rev=0x02 hdr=0x02
 pcic-pci1@pci0:3:1:	class=0x060700 card=0x00921014 chip=0xac16104c rev=0x02 hdr=0x02
 none0@pci0:5:0:	class=0x030000 card=0x00dd1014 chip=0x000510c8 rev=0x12 hdr=0x00
 chip1@pci0:5:1:	class=0x040100 card=0x00dd1014 chip=0x800510c8 rev=0x12 hdr=0x00
                                     ^^^^^^^^^^
 chip1 is the interesting line, note the value for card.
 
 In /sys/dev/sound/pci/neomagic.c you will find the following sequence :
 
 static u_int32_t badcards[] = {
 	0x0007103c,
 	0x008f1028,
 };
 #define NUM_BADCARDS (sizeof(badcards) / sizeof(u_int32_t))
 
 In array badcards, add an entry for the id of the card found in pciconf -l
 
 static u_int32_t badcards[] = {
 	0x0007103c,
 	0x008f1028,
 	0x00dd1014,   // new id inserted here
 };
 #define NUM_BADCARDS (sizeof(badcards) / sizeof(u_int32_t))
 
 Recompile your kernel and you're done.
 
 Regards
 
 Eric
 -- 
 Progress : (n) What led from smart users in front of dumb terminals to 
 dumb users in front of smart terminals.
 
 

From: Edwin Groothuis <mavetju@chello.nl>
To: freebsd-gnats-submit@FreeBSD.org, e-masson@kisoft-services.com,
	joost@bps.eca-mail.org
Cc:  
Subject: Re: kern/17796: pcm drivers failes to load for Neomagic on IBM Thinkpad 390
Date: Sun, 26 Nov 2000 10:39:22 +0100

 Hello Eric,
 
 As described earlier, the problem was fixed with the patches you
 gave us. Can you please close the PR on this?
 
 ta, Edwin
 
 -- 
 Edwin Groothuis   | Fatal Dimensions:
 mavetju@chello.nl | http://fataldimensions.nl.eu.org/
 ------------------+ telnet://fataldimensions.nl.eu.org:4000
 Trenton@FinalFantasy: y r all fucken coders wierd and negative except me?
 
State-Changed-From-To: open->closed 
State-Changed-By: greid 
State-Changed-When: Fri Apr 6 18:45:38 PDT 2001 
State-Changed-Why:  
Closed at submitter's request 

http://www.freebsd.org/cgi/query-pr.cgi?pr=17796 
>Unformatted:
