Re: [PATCH] char/mem: Make /dev/port less obviously broken (v0)

From: Greg KH
Date: Mon Feb 06 2012 - 19:26:33 EST


On Mon, Feb 06, 2012 at 06:02:02PM -0500, Adam Jackson wrote:
> Did you know /dev/port turns all reads and writes into a stream of inb
> and outb? Turns out hardware really does care about I/O cycle size
> though, and if you're trying to do an outl four outb's is very much not
> the same thing.
>
> However, someone somewhere probably built some code and hardware that
> relies on that behaviour. Plus, userspace needs to be able to tell
> whether the kernel will do the right thing, and fall back to raw port
> access if not. So add an ioctl to request new 'strict' semantics, which
> allows only exactly 1/2/4 byte cycles and translates them into the
> corresponding I/O cycle size. This matches the behaviour of sysfs's
> resourceN files for I/O BARs.

Who would use this new ioctl? And if it's been working ok until now,
why is it needed?

If you want something "new" like this, why not just create /dev/ioport
or something like that to always use the proper alignment and not need
an ioctl at all?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/