From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Sat, 05 Jun 2004 15:40:52 +0000 Subject: Re: Coding problem with sysfs Message-Id: <20040605154052.GB12335@kroah.com> List-Id: References: <002c01c44883$2717bfc0$0600a8c0@blackbox> In-Reply-To: <002c01c44883$2717bfc0$0600a8c0@blackbox> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Sat, Jun 05, 2004 at 02:30:33AM +0200, Christian Gmeiner wrote: > Hi Greg, > > > On Wed, Jun 02, 2004 at 11:21:53AM +0200, Christian Gmeiner wrote: > > > /sys/class/dvb/adapter0: > > > demux0 dvr0 frontend frontend0 name net0 > > > > The 'dev' file needs to be here. That's the problem. > Oh i forgot something - my fault: > > vdr root # ls -Rl /sys/class/dvb > /sys/class/dvb: > total 0 > drwxr-xr-x 5 root root 0 Jun 5 02:22 adapter0 > > /sys/class/dvb/adapter0: > total 0 > drwxr-xr-x 2 root root 0 Jun 5 02:22 demux0 > drwxr-xr-x 2 root root 0 Jun 5 02:22 dvr0 > -r--r--r-- 1 root root 4096 Jun 5 02:22 frontend > -r--r--r-- 1 root root 4096 Jun 5 02:22 name > drwxr-xr-x 2 root root 0 Jun 5 02:22 net0 > > /sys/class/dvb/adapter0/demux0: > total 0 > -r--r--r-- 1 root root 4096 Jun 5 02:22 adap > -r--r--r-- 1 root root 4096 Jun 5 02:22 dev > > /sys/class/dvb/adapter0/dvr0: > total 0 > -r--r--r-- 1 root root 4096 Jun 5 02:22 adap > -r--r--r-- 1 root root 4096 Jun 5 02:22 dev > > /sys/class/dvb/adapter0/net0: > total 0 > -r--r--r-- 1 root root 4096 Jun 5 02:22 adap > -r--r--r-- 1 root root 4096 Jun 5 02:22 dev > Hm, how about using 'tree' instead, it's much easier to show the heirchey with it :) Anyway, how are you putting struct class_device structures into such a tree? We don't currently allow parents of them in the kernel. Are you using basic kobjects here? What hotplug events get generated when you create your "demux0" and others devices? The solution is for you to put everything under the /sys/class/dvb/ directory, and not go one level deeper. Care to post your code? > > What happens if you run > > udevtest /sys/class/dvb/adapter0 > > vdr root # udevtest /sys/class/dvb/adapter0 > version 025 > looking at '/class/dvb/adapter0' > configured rule in '/etc/udev/rules.d//10-myrule.rules' at line 2 applied, > 'adapter0' becomes 'dvb/adapter%n/%k' > creating device node '/dev/dvb/adapter0/adapter0', major = '250', minor > '7', mode = '020660', uid = '0', gid = '27' Ok, so that works :) > > > > This is my udev rule: > # dvb devices > SYSFS{adap}="adapter[0-9]*", NAME="dvb/adapter%n/%k" > > And this is the result in /dev: > > vdr root # ls -Rl /dev/dvb > /dev/dvb: > total 0 > drwxr-xr-x 2 root root 0 Jun 5 02:22 adapter0 > > /dev/dvb/adapter0: > total 0 > crw-rw---- 1 root video 250, 7 Jun 5 02:22 adapter0 > crw-rw---- 1 root video 250, 4 Jun 5 02:22 demux0 > crw-rw---- 1 root video 250, 5 Jun 5 02:22 dvr0 > crw-rw---- 1 root video 250, 7 Jun 5 02:22 net0 > > > And here is the problem: > vdr root # ls /dev/dvb/adapter0/demux0 > /dev/dvb/adapter0/demux0 > vdr root # cat /dev/dvb/adapter0/demux0 > cat: /dev/dvb/adapter0/demux0: No such device or address Ok, that's your kernel driver problem, not a udev issue :) Are you sure 250:4 is the proper major:minor assigned to your kernel object? Again, code would help here. Good luck, greg k-h ------------------------------------------------------- This SF.Net email is sponsored by the new InstallShield X. >From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel