lkml.org 
[lkml]   [2000]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] for ymf_sb (YMF PCI legacy driver)
Hello!

I just found two serious bugs in the YMF PCI legacy driver (i.e. the
driver that puts it to the Sound Blaster compatible mode).

pci_unregister_driver() was not called from the cleanup routine, which
caused a recoverable oops while running /sbin/lspci.

Also some module parameters were OR'd with 0x03 _after_ shifting them.
Those parameters were ignored while setting up the card.

For example, "modprobe ymf_sb io=0x240" didn't work - it would set up the
card to 0x220 but the sb driver would be told to check 0x240 for the Sound
Blaster.

For your convenience, the patch is also available at
http://www.red-bean.com/~proski/ymf_sb.patch

Regards,
Pavel Roskin

_____________________________
--- linux.orig/drivers/sound/ymf_sb.c
+++ linux/drivers/sound/ymf_sb.c
@@ -436,7 +436,7 @@
printk(PFX "set DMA address at 0x%x\n",sb_data[cards].dma);
#endif

- v = 0x0000 | ((dma<<6)&0x03) | 0x003f;
+ v = 0x0000 | ((dma & 0x03) << 6) | 0x003f;
pci_write_config_word(pcidev, YMFSB_PCIR_LEGCTRL, v);
#ifdef YMF_DEBUG
printk(PFX "LEGCTRL: 0x%x\n",v);
@@ -446,7 +446,9 @@
case PCI_DEVICE_ID_YMF740:
case PCI_DEVICE_ID_YMF724F:
case PCI_DEVICE_ID_YMF740C:
- v = 0x8800 | ((mpuio<<4)&0x03) | ((sbio<<2)&0x03) | (oplio&0x03);
+ v = 0x8800 | ((mpuio & 0x03) << 4)
+ | ((sbio & 0x03) << 2)
+ | (oplio & 0x03);
pci_write_config_word(pcidev, YMFSB_PCIR_ELEGCTRL, v);
#ifdef YMF_DEBUG
printk(PFX "ELEGCTRL: 0x%x\n",v);
@@ -843,6 +845,7 @@
}

free_iomaps();
+ pci_unregister_driver(&ymf7xxsb_driver);

}

_____________________________
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:51    [W:0.076 / U:3.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site