Re: Add a "enable" sysfs attribute to the pci devices to allow userspace (Xorg) to enable devices without doing foul direct access

From: Jon Smirl
Date: Tue May 02 2006 - 12:58:50 EST


On 5/2/06, Arjan van de Ven <arjan@xxxxxxxxxxxxxxx> wrote:
> An alternate way to fix this problem is to write a device driver that
> attaches to hardware with PCI class VGA.

and then that sucks too because in linux only 1 driver can bind to a device,
AND you're limited to only vga devices.


There are many other ways to solve this problem. There are two rules
that need to be followed.
1) One driver per device
2) Stop mucking with hardware without having a driver loaded.

There are many other solutions to this problem that follow the Linux
driver model. For example build skeleton fbdev drivers for all of the
VGA device PCI IDs (they are enumerated in the X code). These drivers
can just be empty fbdev drivers, the fbdev core will supply the
open/enable logic. DRM already knows how to coordinate with fbdev so
that there aren't multiple drivers binding to the hardware.

You could do the generic VGA class binding after all of the other
drivers are loaded. And only bind to the free devices.

We could modify the driver system to allow a PCI class binding and a
device specific binding. The device specific binding would override
the class binding.

All of these have been proposed before. In my opinion an 'enable'
attribute is the worst solution in the bunch.

--
Jon Smirl
jonsmirl@xxxxxxxxx
-
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/