Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: Weird problem



Hello Aurelian,

dvb-kernel is where everyone should be moving to. I plan to release
linuxtv-dvb-1.0.0 final rsn, and development of the "DVB" CVS tree
will stop (CVS will possibly stay open for small bug fixes).

*BUT*, due to changes in devfs handling in Linux 2.[56], dvb-kernel
currently limits you to four DVB cards per computer. I guess this
needs to be resolved then...
To bring some light into this issue: if you don't use devfs, you are limited to 4 devices anyway.

The linux kernel uses a 16bit dev_t internally, giving 8bit to the major numbers and 8bit to the minor numbers.

Because we only allocate one major number and have 256 minor numbers, there can be 4 adapters with each 4*8 devices (audio0, ..., audio3, demux0, ..., demux3, ... => same for frontend, osd, ca, dvr, net, video)

4*4*8 = 256.

Fact is that devfs in 2.4 is crap. There are race conditions and bugs, mostly because there is no direct relationship between dev_t's and the device nodes devfs creates, ie. a devfs device node does not necesseraily have a corresponding dev_t entry. I have been told that this is a Posix requirement, so devfs in 2.4 was the wrong approach.

For 2.6 this has been unified, so each devfs device node has a corresponding dev_t entry. Because of this, 2.6 has the same restrictions for both devfs and non-devfs users.

There are two solutions:

1) Dynamically allocate multiple major numbers, ie. 251, 252, 253, ...
for further devices. Some drivers have done this for ages.

2) Wait for dev_t do be increased to 32bit or 64bit. This has been proposed several times. I googled around a bit and found out that patches are sent regularly to lkml and that Andrew Morton (-mm kernels) has these patches in his tree already. Although glibc uses a user-side 64bit dev_t already, there are still subtile issues, for example for backward compatiblitly. NFSv2 cannot only deal with 16bit dev_t for example...

Some people strongly advocate for 2.6 to use a 32bit dev_t with a 12:20 major:minor mapping. But Linus Torvalds has not decided what to do yet.

Hmm... so then I'll better stick to the DVB version untill this is done. :)
Yes. But somebody should probably have a look at 1) and how other drivers do this and add this to the current driver.

CU
Michael.



--
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index