linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] parport_pc.c PnP BIOS sanity check
@ 2001-09-21  6:00 Thomas Hood
  2001-09-21  6:11 ` Ignacio Vazquez-Abrams
  2001-09-21 18:09 ` Gunther Mayer
  0 siblings, 2 replies; 13+ messages in thread
From: Thomas Hood @ 2001-09-21  6:00 UTC (permalink / raw)
  To: linux-kernel

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

I'm still wondering why this function in parport_pc.c rejects dma
values of zero.  Is DMA0 not usable by the parallel port for some
reason?  I should think that if the PnP BIOS returns a dma of zero
then it means that the parallel port is using DMA0.  Sorry if I'm
being obtuse.                      // Thomas Hood 

parport_pc.c line 2799:
int init_pnp040x(struct pci_dev *dev)
{       int io,iohi,irq,dma;

        io=dev->resource[0].start;
        iohi=dev->resource[1].start;
        irq=dev->irq_resource[0].start;
        dma=dev->dma_resource[0].start;

        if(dma==0) dma=-1;             <--- Why?

        printk(KERN_INFO "PnPBIOS: Parport found %s %s at io=%04x,%04x irq=%d dma=%d\n",
                dev->name,dev->slot_name,io,iohi,irq,dma);
        if (parport_pc_probe_port(io,iohi,irq,dma,NULL))
                return 1;
        return 0;
}

[-- Attachment #2: patch-norejdma --]
[-- Type: text/plain, Size: 452 bytes --]

--- linux-2.4.7-ac10/drivers/parport/parport_pc.c_ORIG	Fri Aug 10 18:19:07 2001
+++ linux-2.4.7-ac10/drivers/parport/parport_pc.c	Mon Aug 13 17:40:38 2001
@@ -2797,8 +2797,6 @@
 	irq=dev->irq_resource[0].start;
 	dma=dev->dma_resource[0].start;
 
-	if (dma==0) dma=-1;
-
 	printk(KERN_INFO "PnPBIOS: Parport found %s %s at io=%04x,%04x irq=%d dma=%d\n",
 		dev->name,dev->slot_name,io,iohi,irq,dma);
 	if (parport_pc_probe_port(io,iohi,irq,dma,NULL))


[-- Attachment #3: patch-dmanone --]
[-- Type: text/plain, Size: 437 bytes --]

--- linux-2.4.7-ac10/drivers/parport/parport_pc.c_ORIG	Fri Aug 10 18:19:07 2001
+++ linux-2.4.7-ac10/drivers/parport/parport_pc.c	Fri Aug 10 18:19:55 2001
@@ -2797,7 +2797,7 @@
 	irq=dev->irq_resource[0].start;
 	dma=dev->dma_resource[0].start;
 
-	if (dma==0) dma=-1;
+	if (dma==0) dma=PARPORT_DMA_NONE;
 
 	printk(KERN_INFO "PnPBIOS: Parport found %s %s at io=%04x,%04x irq=%d dma=%d\n",
 		dev->name,dev->slot_name,io,iohi,irq,dma);


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [PATCH] parport_pc.c PnP BIOS sanity check
@ 2001-08-13 21:46 Thomas Hood
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas Hood @ 2001-08-13 21:46 UTC (permalink / raw)
  To: linux-kernel

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

Alan Cox wrote:
> IRQ 0 is a legal valid IRQ. I suspect the problem is that pnpbios shouldnt
> be reporting an IRQ or we should be using some kind of NO_IRQ cookie

Okay, I accept that.  Then must we also say that DMA 0 is a
valid DMA?  If so, then unless I'm confused about something
the rejection of dma==0 should be eliminated:
--------------------------------------------------------------------------------
--- linux-2.4.7-ac10/drivers/parport/parport_pc.c_ORIG  Fri Aug 10 18:19:07 2001
+++ linux-2.4.7-ac10/drivers/parport/parport_pc.c       Mon Aug 13 17:40:38 2001
@@ -2797,8 +2797,6 @@
        irq=dev->irq_resource[0].start;
        dma=dev->dma_resource[0].start;

-       if (dma==0) dma=-1;
-
        printk(KERN_INFO "PnPBIOS: Parport found %s %s at io=%04x,%04x irq=%d dma=%d\n",
                dev->name,dev->slot_name,io,iohi,irq,dma);
        if (parport_pc_probe_port(io,iohi,irq,dma,NULL))
--------------------------------------------------------------------------------

Otherwise I think the following change should be made for the sake of
code clarity.  (PARPORT_DMA_NONE is defined as -1.)
--------------------------------------------------------------------------------
--- linux-2.4.7-ac10/drivers/parport/parport_pc.c_ORIG  Fri Aug 10 18:19:07 2001
+++ linux-2.4.7-ac10/drivers/parport/parport_pc.c       Fri Aug 10 18:19:55 2001
@@ -2797,7 +2797,7 @@
        irq=dev->irq_resource[0].start;
        dma=dev->dma_resource[0].start;

-       if (dma==0) dma=-1;
+       if (dma==0) dma=PARPORT_DMA_NONE;

        printk(KERN_INFO "PnPBIOS: Parport found %s %s at io=%04x,%04x irq=%d dma=%d\n",
                dev->name,dev->slot_name,io,iohi,irq,dma);
--------------------------------------------------------------------------------

--
Thomas Hood
jdthood_AT_yahoo.co.uk

[-- Attachment #2: patch-norejdma --]
[-- Type: text/plain, Size: 451 bytes --]

--- linux-2.4.7-ac10/drivers/parport/parport_pc.c_ORIG	Fri Aug 10 18:19:07 2001
+++ linux-2.4.7-ac10/drivers/parport/parport_pc.c	Mon Aug 13 17:40:38 2001
@@ -2797,8 +2797,6 @@
 	irq=dev->irq_resource[0].start;
 	dma=dev->dma_resource[0].start;
 
-	if (dma==0) dma=-1;
-
 	printk(KERN_INFO "PnPBIOS: Parport found %s %s at io=%04x,%04x irq=%d dma=%d\n",
 		dev->name,dev->slot_name,io,iohi,irq,dma);
 	if (parport_pc_probe_port(io,iohi,irq,dma,NULL))

[-- Attachment #3: patch-dmanone --]
[-- Type: text/plain, Size: 436 bytes --]

--- linux-2.4.7-ac10/drivers/parport/parport_pc.c_ORIG	Fri Aug 10 18:19:07 2001
+++ linux-2.4.7-ac10/drivers/parport/parport_pc.c	Fri Aug 10 18:19:55 2001
@@ -2797,7 +2797,7 @@
 	irq=dev->irq_resource[0].start;
 	dma=dev->dma_resource[0].start;
 
-	if (dma==0) dma=-1;
+	if (dma==0) dma=PARPORT_DMA_NONE;
 
 	printk(KERN_INFO "PnPBIOS: Parport found %s %s at io=%04x,%04x irq=%d dma=%d\n",
 		dev->name,dev->slot_name,io,iohi,irq,dma);

^ permalink raw reply	[flat|nested] 13+ messages in thread
[parent not found: <no.id>]
* [PATCH] parport_pc.c PnP BIOS sanity check
@ 2001-08-08 15:15 Thomas Hood
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas Hood @ 2001-08-08 15:15 UTC (permalink / raw)
  To: linux-kernel

The following would seem to be required to protect against
the case in which PnP BIOS reports an IRQ of 0 for a 
parport with disabled IRQ.      // Thomas  jdthood_AT_yahoo.co.uk

--- linux-2.4.7-ac2/drivers/parport/parport_pc.c        Mon Jul 30 01:18:34 2001
+++ linux-2.4.7-ac2-jdth1/drivers/parport/parport_pc.c  Mon Jul 30 12:32:16 2001
@@ -2797,7 +2797,8 @@
        irq=dev->irq_resource[0].start;
        dma=dev->dma_resource[0].start;

-       if(dma==0) dma=-1;
+       if (dma==0) dma=PARPORT_DMA_NONE;
+       if (irq==0) irq=PARPORT_IRQ_NONE;

        printk(KERN_INFO "PnPBIOS: Parport found %s %s at io=%04x,%04x irq=%d dma=%d\n",
                dev->name,dev->slot_name,io,iohi,irq,dma);

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

end of thread, other threads:[~2001-09-22  0:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-21  6:00 [PATCH] parport_pc.c PnP BIOS sanity check Thomas Hood
2001-09-21  6:11 ` Ignacio Vazquez-Abrams
2001-09-21 12:07   ` Alan Cox
2001-09-21 18:45   ` Thomas Hood
2001-09-22  0:08   ` Philip Blundell
2001-09-21 18:09 ` Gunther Mayer
  -- strict thread matches above, loose matches on Subject: below --
2001-08-13 21:46 Thomas Hood
     [not found] <no.id>
2001-08-08 15:20 ` Alan Cox
2001-08-08 16:13   ` Richard B. Johnson
2001-08-08 21:58   ` H. Peter Anvin
2001-08-08 22:12     ` Russell King
2001-08-10  9:18     ` Eric W. Biederman
2001-08-08 15:15 Thomas Hood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).