public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Patch to make ymfpci legacy address 16 bits
@ 2001-05-09  0:37 Pete Zaitcev
  0 siblings, 0 replies; 9+ messages in thread
From: Pete Zaitcev @ 2001-05-09  0:37 UTC (permalink / raw)
  To: linux-kernel

Hi:

I found that every time I run a 2.4 on my laptop, APM locks up
the machine. Apparently, legacy YMF code enabled decoding of
10 bits of I/O address. A call to APM BIOS touched that and
somehow the system locked up.

If Pavel Roskin, Daisuke Nagano or someone else do not mind,
I want this in stock kernel.

-- Pete

--- linux-2.4.4/drivers/sound/ymfpci.c	Thu Apr 26 22:17:27 2001
+++ linux-2.4.4-niph/drivers/sound/ymfpci.c	Tue May  8 16:46:58 2001
@@ -2059,9 +2059,10 @@
 	}
 
 	if (mpuio >= 0 || oplio >= 0) {
-		v = 0x003e;
+		/* 0x0020: 1 - 10 bits of I/O address decoded, 0 - 16 bits. */
+		v = 0x001e;
 		pci_write_config_word(pcidev, PCIR_LEGCTRL, v);
-	
+
 		switch (pcidev->device) {
 		case PCI_DEVICE_ID_YAMAHA_724:
 		case PCI_DEVICE_ID_YAMAHA_740:

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: Patch to make ymfpci legacy address 16 bits
@ 2001-05-09 20:17 Pavel Roskin
  2001-05-09 20:23 ` Jeff Garzik
  0 siblings, 1 reply; 9+ messages in thread
From: Pavel Roskin @ 2001-05-09 20:17 UTC (permalink / raw)
  To: Pete Zaitcev; +Cc: linux-kernel

Hi, Pete!

Next time you are asking my opinion please cc: me, so that I can quote
you.

Yes, I think you have fixed a terrible bug in ymfpci. Decoding only 10-bit
addresses is extremely dangerous, considering that only 388-38b is
reserved, while 788-78b etc are not.

In order to get your patch accepted sooner please use symbolic constants
and better indentation. I don't want to steal your credits by doing it for
you :-)

If you want to play further with APM and ymfpci, I made a stub for proper
apm support in the ymfpci driver. It's available here:

http://www.red-bean.com/~proski/linux/ymfpci_pm.diff

You may need to save some data in memory when the system goes to suspend
and restore them afterwards. I believe that the PCI config space should be
saved by BIOS. Everything else is the responsibility of the driver.

If I find a similar problem in ALSA it will be reported with cc: to you.

-- 
Regards,
Pavel Roskin


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-05-10 11:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-09  0:37 Patch to make ymfpci legacy address 16 bits Pete Zaitcev
  -- strict thread matches above, loose matches on Subject: below --
2001-05-09 20:17 Pavel Roskin
2001-05-09 20:23 ` Jeff Garzik
2001-05-09 20:52   ` Pavel Roskin
2001-05-09 21:08     ` Jeff Garzik
2001-05-09 23:43       ` Pavel Roskin
2001-05-09 23:53       ` Zach Brown
2001-05-10  2:53   ` Albert D. Cahalan
2001-05-10 11:54     ` mirabilos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox