Re: Problems with the sound card.

1999-09-03 Thread Doug Rabson

On Thu, 2 Sep 1999, Luoqi Chen wrote:

  That's exactly what I have. This is just so weird. I am now reading the
  debug register chapter of intel's manual, it is virtually impossible to
  pinpoint the location by single-stepping through the code...
  
 The debug register trick worked, and the discovery was quite unexpected:
 because the isa bus is hanging off the pci bus, bus_release_resource()
 call by a isa device, eventually reaches the pci_release_resource(),
 where the device is blindly assumed to be a pci device and its isa_device
 struct overwritten as if it were a struct pci_devinfo. pci_release_resource()
 should check for pass-thru releases.

How about this patch:

Index: pci.c
===
RCS file: /home/ncvs/src/sys/pci/pci.c,v
retrieving revision 1.116
diff -u -r1.116 pci.c
--- pci.c   1999/08/28 00:51:03 1.116
+++ pci.c   1999/09/03 07:59:44
@@ -1375,40 +1375,42 @@
int rv;
struct pci_devinfo *dinfo = device_get_ivars(child);
pcicfgregs *cfg = dinfo-cfg;
+   int passthrough = (device_get_parent(child) != dev);
int map = 0;
 
-   switch (type) {
-   case SYS_RES_IRQ:
-   if (rid != 0)
-   return EINVAL;
-   break;
+   if (!passthrough)
+   switch (type) {
+   case SYS_RES_IRQ:
+   if (rid != 0)
+   return EINVAL;
+   break;
 
-   case SYS_RES_DRQ:   /* passthru for child isa */
-   break;
+   case SYS_RES_DRQ:   /* passthru for child isa */
+   break;
 
 #ifdef __alpha__
-   case SYS_RES_DENSE:
-   case SYS_RES_BWX:
+   case SYS_RES_DENSE:
+   case SYS_RES_BWX:
 #endif
-   case SYS_RES_MEMORY:
-   case SYS_RES_IOPORT:
-   /*
+   case SYS_RES_MEMORY:
+   case SYS_RES_IOPORT:
+   /*
 * Only check the map registers if this is a direct
 * descendant.
 */
-   if (device_get_parent(child) == dev)
-   map = pci_mapno(cfg, rid);
-   else
-   map = -1;
-   break;
-
-   default:
-   return (ENOENT);
-   }
+   if (device_get_parent(child) == dev)
+   map = pci_mapno(cfg, rid);
+   else
+   map = -1;
+   break;
+
+   default:
+   return (ENOENT);
+   }
 
rv = BUS_RELEASE_RESOURCE(device_get_parent(dev), child, type, rid, r);
 
-   if (rv == 0) {
+   if (!passthrough  rv == 0) {
switch (type) {
case SYS_RES_IRQ:
cfg-irqres = 0;

--
Doug Rabson Mail:  [EMAIL PROTECTED]
Nonlinear Systems Ltd.  Phone: +44 181 442 9037




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Problems with the sound card.

1999-09-03 Thread Doug Rabson

On Thu, 2 Sep 1999, Ollivier Robert wrote:

 According to Doug Rabson:
  changing over to the pcm driver. Since your card is a PnP one, you should
  be able to put just "device pcm0" in your kernel config.
 
 Even for ISA ones ? I though only PCI sound cards let you use the shorter
 form...

The new ISA PnP code uses it too.

--
Doug Rabson Mail:  [EMAIL PROTECTED]
Nonlinear Systems Ltd.  Phone: +44 181 442 9037




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Problems with the sound card.

1999-09-03 Thread Nick Hibma


What about documenting what you do here? It's not quite obvious to me
why the dev is not the parent of the child in some cases.

Cheers,

Nick

   pcicfgregs *cfg = dinfo-cfg;
  +int passthrough = (device_get_parent(child) != dev);
   int map = 0;

-- 
ISIS/STA, T.P.270, Joint Research Centre, 21020 Ispra, Italy




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Problems with the sound card.

1999-09-03 Thread Doug Rabson

On Fri, 3 Sep 1999, Nick Hibma wrote:

 
 What about documenting what you do here? It's not quite obvious to me
 why the dev is not the parent of the child in some cases.

It may be a great-grandchild. For instance in this case, the child is
isab0, the grandchild is isa0 and the great-grandchild is pcm0.

--
Doug Rabson Mail:  [EMAIL PROTECTED]
Nonlinear Systems Ltd.  Phone: +44 181 442 9037




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Problems with the sound card.

1999-09-02 Thread Nick Hibma


Could you send the output of dmesg. It could be that your BIOS has
rearranged the irq settings and has put another card on that IRQ. Is the
sound card PNP? If not, could you check that the card's IRQ is marked as
legacy in the BIOS?

Nick

  My sound card used to work, and with a backup kernel it still did ( I lost
  it ) but after doing a make update world yesturday I came to the
  realization that it no longer works.  Did someone break the sb drivers?  I
  get a drq / irq conflict error, but they are set to the sound card's
  settings.
  
  Arthur H. Johnson II
  http://www.linuxberg.com
  Linuxberg Manager
  [EMAIL PROTECTED]
  
  
  
  To Unsubscribe: send mail to [EMAIL PROTECTED]
  with "unsubscribe freebsd-current" in the body of the message
  
  

-- 
ISIS/STA, T.P.270, Joint Research Centre, 21020 Ispra, Italy



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Problems with the sound card.

1999-09-02 Thread Arthur H. Johnson II

here it is:

Copyright (c) 1992-1999 The FreeBSD Project.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
FreeBSD 4.0-CURRENT #4: Thu Sep  2 10:45:54 EDT 1999
[EMAIL PROTECTED]:/usr/src/sys/compile/ARTHUR
Timecounter "i8254"  frequency 1193182 Hz
CPU: Pentium/P55C (167.05-MHz 586-class CPU)
  Origin = "GenuineIntel"  Id = 0x543  Stepping = 3
  Features=0x8001bfFPU,VME,DE,PSE,TSC,MSR,MCE,CX8,MMX
real memory  = 67108864 (65536K bytes)
avail memory = 62173184 (60716K bytes)
Preloaded elf kernel "kernel" at 0xc02d1000.
Intel Pentium detected, installing workaround for F00F bug
npx0: math processor on motherboard
npx0: INT 16 interface
pcib0: Host to PCI bridge on motherboard
pci0: PCI bus on pcib0
isab0: Intel 82371SB PCI to ISA bridge at device 7.0 on pci0
isa0: ISA bus on isab0
ide_pci0: Intel PIIX3 Bus-master IDE controller at device 7.1 on pci0
vga-pci0: Matrox MGA 1024SG/1064SG/1164SG graphics accelerator irq 10 at device 10.0 
on pci0
xl0: 3Com 3c905B-TX Fast Etherlink XL irq 11 at device 11.0 on pci0
xl0: Ethernet address: 00:10:4b:c5:24:df
miibus0: MII bus on xl0
xlphy0: 3Com internal media interface on miibus0
xlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fdc0: NEC 72065B or clone at port 0x3f0-0x3f7 irq 6 drq 2 on isa0
fdc0: FIFO enabled, 8 bytes threshold
fd0: 1440-KB 3.5" drive on fdc0 drive 0
wdc0 at port 0x1f0-0x1f7 irq 14 on isa0
wdc0: unit 0 (wd0): WDC AC23200L
wd0: 3098MB (6346368 sectors), 6296 cyls, 16 heads, 63 S/T, 512 B/S
wdc1 at port 0x170-0x177 irq 15 on isa0
wdc1: unit 0 (atapi): E285XA/1.00, removable, dma, iordis
wcd0: drive speed 1377KB/sec, 240KB cache
wcd0: supported read types: CD-DA
wcd0: Audio: play, 255 volume levels
wcd0: Mechanism: ejectable tray
wcd0: Medium: no/blank disc inside, unlocked
atkbdc0: keyboard controller (i8042) at port 0x60-0x6f on isa0
atkbd0: AT Keyboard irq 1 on atkbdc0
vga0: Generic ISA VGA at port 0x3b0-0x3df iomem 0xa-0xb on isa0
sc0: System console on isa0
sc0: VGA 16 virtual consoles, flags=0x200
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
ppc0 at port 0x378-0x37f irq 7 flags 0x40 on isa0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/16 bytes threshold
ppi0: generic parallel i/o on ppbus 0
sb0 at port 0x220 irq 5 drq 1 on isa0
snd0: SoundBlaster 16 4.13 
sbxvi0 at port 0x drq 5 on isa0
isa_compat: didn't get ports for sbxvi
snd0: SoundBlaster 16 4.13 
WARNING: "snd" is usurping "snd"'s cdevsw[]
unknown0: Game on isa0
unknown1: Audio at port 0x221-0x230,0x300-0x301,0x388-0x38b irq 9 drq 3,7 on isa0
changing root device to wd0s1a
Sound: DMA (output) timed out - IRQ/DRQ config error?
Sound: DMA (output) timed out - IRQ/DRQ config error?
Sound: DMA (output) timed out - IRQ/DRQ config error?

thanks.


Arthur H. Johnson II
http://www.linuxberg.com
Linuxberg Manager
[EMAIL PROTECTED]

On Thu, 2 Sep 1999, Nick Hibma wrote:

 
 Could you send the output of dmesg. It could be that your BIOS has
 rearranged the irq settings and has put another card on that IRQ. Is the
 sound card PNP? If not, could you check that the card's IRQ is marked as
 legacy in the BIOS?
 
 Nick
 
   My sound card used to work, and with a backup kernel it still did ( I lost
   it ) but after doing a make update world yesturday I came to the
   realization that it no longer works.  Did someone break the sb drivers?  I
   get a drq / irq conflict error, but they are set to the sound card's
   settings.
   
   Arthur H. Johnson II
   http://www.linuxberg.com
   Linuxberg Manager
   [EMAIL PROTECTED]
   
   
   
   To Unsubscribe: send mail to [EMAIL PROTECTED]
   with "unsubscribe freebsd-current" in the body of the message
   
   
 
 -- 
 ISIS/STA, T.P.270, Joint Research Centre, 21020 Ispra, Italy
 
 
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with "unsubscribe freebsd-current" in the body of the message
 



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Problems with the sound card.

1999-09-02 Thread Luoqi Chen

 Could you send the output of dmesg. It could be that your BIOS has
 rearranged the irq settings and has put another card on that IRQ. Is the
 sound card PNP? If not, could you check that the card's IRQ is marked as
 legacy in the BIOS?
 
 Nick
 
   My sound card used to work, and with a backup kernel it still did ( I lost
   it ) but after doing a make update world yesturday I came to the
   realization that it no longer works.  Did someone break the sb drivers?  I
   get a drq / irq conflict error, but they are set to the sound card's
   settings.
   
   Arthur H. Johnson II
   http://www.linuxberg.com
   Linuxberg Manager
   [EMAIL PROTECTED]
   

I too have problems with my on board CS4236 sound chip and it is of a very
strange nature: in the new isa pnp code, function isa_assign_resources()
mysteriously overwrites the isa_device structure and sets logical_id to 0,
and as a result subsequent probe would not recognize it any more. I have
narrowed it down to the bus_release_resource() call at the end of
isa_find_irq(). It was so convoluted beyond that point and I gave up.
I'd like to see someone more familiar with the code to continue.

-lq


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Problems with the sound card.

1999-09-02 Thread Doug Rabson

On Thu, 2 Sep 1999, Luoqi Chen wrote:

  Could you send the output of dmesg. It could be that your BIOS has
  rearranged the irq settings and has put another card on that IRQ. Is the
  sound card PNP? If not, could you check that the card's IRQ is marked as
  legacy in the BIOS?
  
  Nick
  
My sound card used to work, and with a backup kernel it still did ( I lost
it ) but after doing a make update world yesturday I came to the
realization that it no longer works.  Did someone break the sb drivers?  I
get a drq / irq conflict error, but they are set to the sound card's
settings.

Arthur H. Johnson II
http://www.linuxberg.com
Linuxberg Manager
[EMAIL PROTECTED]

 
 I too have problems with my on board CS4236 sound chip and it is of a very
 strange nature: in the new isa pnp code, function isa_assign_resources()
 mysteriously overwrites the isa_device structure and sets logical_id to 0,
 and as a result subsequent probe would not recognize it any more. I have
 narrowed it down to the bus_release_resource() call at the end of
 isa_find_irq(). It was so convoluted beyond that point and I gave up.
 I'd like to see someone more familiar with the code to continue.

This sounds pretty strange. What do you have in your kernel config? For
PnP cards, you just need:

device pcm0

in the config file (i.e. no explicit bus location or resource
assignments).

--
Doug Rabson Mail:  [EMAIL PROTECTED]
Nonlinear Systems Ltd.  Phone: +44 181 442 9037




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Problems with the sound card.

1999-09-02 Thread Luoqi Chen

  I too have problems with my on board CS4236 sound chip and it is of a very
  strange nature: in the new isa pnp code, function isa_assign_resources()
  mysteriously overwrites the isa_device structure and sets logical_id to 0,
  and as a result subsequent probe would not recognize it any more. I have
  narrowed it down to the bus_release_resource() call at the end of
  isa_find_irq(). It was so convoluted beyond that point and I gave up.
  I'd like to see someone more familiar with the code to continue.
 
 This sounds pretty strange. What do you have in your kernel config? For
 PnP cards, you just need:
 
   device pcm0
 
 in the config file (i.e. no explicit bus location or resource
 assignments).
 
That's exactly what I have. This is just so weird. I am now reading the
debug register chapter of intel's manual, it is virtually impossible to
pinpoint the location by single-stepping through the code...

-lq


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Problems with the sound card.

1999-09-02 Thread Luoqi Chen

 That's exactly what I have. This is just so weird. I am now reading the
 debug register chapter of intel's manual, it is virtually impossible to
 pinpoint the location by single-stepping through the code...
 
The debug register trick worked, and the discovery was quite unexpected:
because the isa bus is hanging off the pci bus, bus_release_resource()
call by a isa device, eventually reaches the pci_release_resource(),
where the device is blindly assumed to be a pci device and its isa_device
struct overwritten as if it were a struct pci_devinfo. pci_release_resource()
should check for pass-thru releases.

-lq


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message