parport_pc.c PnP BIOS sanity check
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;
}drivers/parport/parport_pc.c renamed from drivers/parport/parport_pc.c_ORIG +0 -2
@@ -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 ))
drivers/parport/parport_pc.c renamed from drivers/parport/parport_pc.c_ORIG +1 -1
@@ -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);
Quoted 5 lines · Thomas Hood
I'm still wondering why this function in
parport_pc.crejects 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
DMA0 is reserved for memory refresh. It _can't_ be used for anything else, therefore a value of 0 is representative of no value whatsoever.
Signature · 1 line
Ignacio Vazquez-Abrams <[email protected]>
Quoted 1 line
therefore a value of 0 is representative of no value whatsoever.
This has been unsafe since about 1995, when DMA 0 became available as PC's stopped using the ISA DMA engine for memory refresh (a very neat original PC hack)
Alan
Quoted 6 lines · Thomas Hood
I'm still wondering why this function in
parport_pc.crejects 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
1)
I think I saw some BIOS report DMA0 for "none" (could even have been ACPI which is returning PNP formatted legacy resource data).
2)
I have never seen DMA0 for parport configured by a BIOS.
3)
Try "lssuperio" if you want the real hardware thing.
This qualifies the code as it is as a sanity check.
Thanks for the replies.
I'd like to underline Alan Cox's reply that DMA0 _is_ usable. In fact, my sound chip is configured to use DMA0.
If (and only if) parport _cannot_ use DMA0 for some reason then the sanity check is justified. In that case I'd just ask that a short comment be added to the code that gives the reason.
Cheers
Thomas
Quoted 2 lines · Ignacio Vazquez-Abrams
DMA0 is reserved for memory refresh. It _can't_ be used for anything else, therefore a value of 0 is representative of no value whatsoever.
Quoted 3 lines · Alan Cox
This has been unsafe since about 1995, when DMA 0 became available as PC's stopped using the ISA DMA engine for memory refresh (a very neat original PC hack)
Quoted 9 lines · Gunther Mayer
1)
I think I saw some BIOS report DMA0 for "none" (could even have been ACPI which is returning PNP formatted legacy resource data).
2)
I have never seen DMA0 for parport configured by a BIOS.
3)
Try "lssuperio" if you want the real hardware thing.This qualifies the code as it is as a sanity check.
Quoted 2 lines
DMA0 is reserved for memory refresh. It _can't_ be used for anything else, therefore a value of 0 is representative of no value whatsoever.
On a PC/XT, perhaps. On any other computer, nothing of the sort is guaranteed.
p.