lkml.org 
[lkml]   [2006]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Add a "enable" sysfs attribute to the pci devices to allow userspace (Xorg) to enable devices without doing foul direct access
On Fri, May 05, 2006 at 05:15:02PM -0400, Jon Smirl wrote:
> On 5/5/06, Greg KH <greg@kroah.com> wrote:
> >On Fri, May 05, 2006 at 04:35:17PM -0400, Jon Smirl wrote:
> >> On 5/5/06, Greg KH <greg@kroah.com> wrote:
> >> >On Fri, May 05, 2006 at 04:14:00PM -0400, Jon Smirl wrote:
> >> >> I would like to see other design alternatives considered on this
> >> >> issue. The 'enable' attribute has a clear problem in that you can't
> >> >> tell which user space program is trying to control the device.
> >> >> Multiple programs accessing the video hardware with poor coordination
> >> >> is already the source of many problems.
> >> >
> >> >Who cares who "enabled" the device. Remember, the majority of PCI
> >> >devices in the system are not video ones. Lots of other types of
> >> >devices want this ability to enable PCI devices from userspace. I've
> >> >been talking with some people about how to properly write PCI drivers in
> >> >userspace, and this attribute is a needed part of it.
> >>
> >> User space program enables the device.
> >> Next I load a device driver
> >> next I rmmod the device driver and it disables the device
> >> user space program trys to use the device
> >> No coordination and user space program faults
> >
> >Gun. Foot. Shoot.
>
> Why do we want to create problem like this when there is a simple
> solution to preventing them. All it takes is a couple of rules:
>
> 1) To use a device it must have a device driver. It may be as simple
> as a couple of lines of code. This driver will cause a device node to
> be created.
>
> 2) If a user app want to use the device it opens the device node.
>
> This builds a system where everybody knows what is going on. The
> driver knows that user space is using the device. Multiple user space
> users are blocked from conflicting because of the open. There is no
> way to shoot yourself in the foot.

That sounds like a nice way to mediate userspace usages of PCI devices,
yes. Much like a dot lockfile is done for tty devices today, all in
userspace (which hints that this too can be done in userspace with no
kernel involvement...)

But it still has nothing to do with this enable sysfs file :)

thanks,

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

\
 
 \ /
  Last update: 2006-05-06 00:31    [W:0.097 / U:0.808 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site