public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix broken superio DMA support in parport_pc.c
@ 2003-10-11 21:58 Duncan Haldane
  2003-10-14 17:59 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Duncan Haldane @ 2003-10-11 21:58 UTC (permalink / raw)
  To: linux-parport, linux-kernel, jgarzik, Tim Waugh

[-- Attachment #1: Type: text/plain, Size: 2426 bytes --]

Hi

There is a bogus test for ECP mode in the Via 686 superio support
in drivers/parport/parport_pc.c:sio_via_686a_probe(..) 


The incorrect test used is that superio register F0_5 == 0x1
(this means "ECP+EPP" parport control mode is enabled; by default, it's not)

The correct test should be register E2_0-1 == 0x01
(This means Parport mode is ECP (BIOS setting))

see the VT82C686A data sheet, page 45 and 46
( available at http://www.via.com.tw/pdf/productinfo/686a.pdf )


Patches against 2.4.23-pre7 and 2.6.0-test7 are attached.
Who can help me push these into the kernels?

These patches are fully tested.  Without it DMA was never enabled by
the superio probe.  With it, it finally is.

Duncan Haldane
duncan _haldane at users dot sourceforge dot net
----------------------------------------------

diff -uNr linux-2.6.0-test7/drivers/parport/parport_pc.c
linux-2.6.0-test7-superio_fix/drivers/parport/parport_pc.c
--- linux-2.6.0-test7/drivers/parport/parport_pc.c      Fri Sep 12 03:05:52 2003
+++ linux-2.6.0-test7-superio_fix/drivers/parport/parport_pc.c  Sat Oct 11
16:35:46 2003
@@ -2564,7 +2564,7 @@
 {
        u8 tmp;
        int dma, irq;
-       unsigned port1, port2, have_eppecp;
+       unsigned port1, port2, mode;
 
        /*
         * unlock super i/o configuration, set 0x85_1
@@ -2579,9 +2579,9 @@
        
        /* 0xE2_1-0: Parallel Port Mode / Enable */
        outb (0xE2, 0x3F0);
-       tmp = inb (0x3F1);
+       mode = inb (0x3F1) & 0x03;
        
-       if ((tmp & 0x03) == 0x03) {
+       if (mode == 0x03) {
                printk (KERN_INFO "parport_pc: Via 686A parallel port disabled
in BIOS\n");
                return 0;
        }
@@ -2600,10 +2600,6 @@
                return 0;
        }
 
-       /* 0xF0_5: EPP+ECP enable */
-       outb (0xF0, 0x3F0);
-       have_eppecp = (inb (0x3F1) & (1 << 5));
-       
        /*
         * lock super i/o configuration, clear 0x85_1
         */
@@ -2637,7 +2633,7 @@
        }
 
        /* if ECP not enabled, DMA is not enabled, assumed bogus 'dma' value */
-       if (!have_eppecp)
+       if (mode != 0x01)
                dma = PARPORT_DMA_NONE;
 
        /* Let the user (or defaults) steer us away from interrupts and DMA */



----------------------------------
E-Mail: Duncan Haldane <f.duncan.m.haldane@worldnet.att.net>
Date: 11-Oct-2003
Time: 17:27:23

This message was sent by XFMail
----------------------------------

[-- Attachment #2: README --]
[-- Type: application/octet-stream, Size: 164 bytes --]

Patch fixes broken Via 686C DMA activation in parport_pc.c::sio_via_686a_probe
(Duncan Haldane <duncan_haldane@users.sourceforge.net>);
2.4.23-pre7 and 2.6.0-test7

[-- Attachment #3: parport_pc_superio_patch.tar.bz2 --]
[-- Type: application/octet-stream, Size: 1475 bytes --]

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

* Re: [PATCH] Fix broken superio DMA support in parport_pc.c
  2003-10-11 21:58 [PATCH] Fix broken superio DMA support in parport_pc.c Duncan Haldane
@ 2003-10-14 17:59 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2003-10-14 17:59 UTC (permalink / raw)
  To: Duncan Haldane; +Cc: linux-parport, linux-kernel, Tim Waugh

Patch looks good to me, but your patch did not apply.

Can you please download the latest 2.4 and 2.6 snapshots, and create 
patches versus those kernels?

ftp://ftp.kernel.org/pub/linux/kernel/v2.[46]/snapshots/

Also, please send patches, uncompressed, in separate emails.  i.e. one 
for 2.4, and one for 2.6.


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

end of thread, other threads:[~2003-10-14 17:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-11 21:58 [PATCH] Fix broken superio DMA support in parport_pc.c Duncan Haldane
2003-10-14 17:59 ` Jeff Garzik

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