Hallo,
do we want to probe at "random" IO ports? What about asking the kernel if the
probed area is free, like the patch below does?
There are more places(via_686a) that would need that protection, if accepted
as usefull.
However a cleaner solution would be i.m.h.o. to have a /proc/superio entry,
that exports the relevant information (manufacturer, ioport for the different
devices, mode of the devices) in a genuine way at least for reading. Device
drivers would read information from the appropriate entries and handle things
according to that information.
Comments wanted.
Bye
Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de
Free Software: If you contribute nothing, expect nothing
----- linux/drivers/parport/parport_pc.c~ Thu Mar 15 16:48:01 2001 +++ linux/drivers/parport/parport_pc.c Sun Mar 18 17:54:13 2001 @@ -1286,6 +1286,12 @@ int devid,devrev,oldid,x_devid,x_devrev,x_oldid; /* First probe without key */ + + if (check_region (io, 2)) + { + printk(KERN_ERR "winbond_check: I/O port 0x%04x is not free.\n",io); + return; + } outb(0x20,io); x_devid=inb(io+1); outb(0x21,io); @@ -1315,6 +1321,11 @@ int devid,devrev,oldid,x_devid,x_devrev,x_oldid; /* First probe without the key */ + if (check_region (io, 3)) + { + printk(KERN_ERR "winbond_check2: I/O port 0x%04x is not free.\n",io); + return; + } outb(0x20,io+2); x_devid=inb(io+2); outb(0x21,io+1); @@ -1343,6 +1354,11 @@ int id,rev,oldid,oldrev,x_id,x_rev,x_oldid,x_oldrev; /* First probe without the key */ + if (check_region (io, 2)) + { + printk(KERN_ERR "smc_check: I/O port 0x%04x is not free.\n",io); + return; + } outb(0x0d,io); x_oldid=inb(io+1); outb(0x0e,io);
-- To unsubscribe, send mail to: linux-parport-request@torque.net -- -- with the single word "unsubscribe" in the body of the message. --
This archive was generated by hypermail 2b29 : Sun Mar 18 2001 - 12:40:17 EST