Messages in this thread | | | From | Drew Bertola <> | Date | Tue, 23 Nov 1999 18:31:38 -0800 (PST) | Subject | Simple driver question. |
| |
My ISA I/O board (tsio) driver seems to work well, but there is one possible problem I foresee. For a quick functional description, the board is based on 4 8255 chips 4 * (3 usable i/o ports + 1 control byte). Each is assigned it's own node, so I have /dev/tsio0-15 with minor number representing the offset of each port from io_base. Here is tsio_write():
ssize_t tsio_write (struct file *filp, const char *buf, size_t count, loff_t *loff) { unsigned char c = buf [0]; int offset = MINOR(filp->f_dentry->d_inode->i_rdev);
get_user (c, buf); outb (c, io_base + offset);
#ifdef DEBUG printk ("getting user byte %-#12x\n", c); printk ("tsio write %-#12x\n", c); printk ("offset = %d\n", offset); #endif
return 1; }
The problem is that if two processes try to write to different devices simultaneously, offset could be set by process 1, then reset by process 2 before process 1 completes the outb. Does the kernel handle this case or should the driver? What mechanism would the driver use to handle it.
D->|
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |