[BusyBox 0002144]: mdev hotplug behavior for char/block devices

bugs at busybox.net bugs at busybox.net
Fri Feb 15 14:49:08 UTC 2008


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=2144 
====================================================================== 
Reported By:                joeyoravec
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   2144
Category:                   Standards Compliance
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             02-14-2008 16:14 PST
Last Modified:              02-15-2008 06:49 PST
====================================================================== 
Summary:                    mdev hotplug behavior for char/block devices
Description: 
On an embedded system, mdev in busybox 1.7.2 will sometimes create block
instead of character drivers. I experience this problem with two character
devices. Please see additional information for my investigation, and the
attached file for a proposed patch.
====================================================================== 

---------------------------------------------------------------------- 
 vapier - 02-14-08 17:47  
---------------------------------------------------------------------- 
please post the hotplug environment and the sysfs path for the device that
you are seeing problems with 

---------------------------------------------------------------------- 
 espakman - 02-15-08 02:45  
---------------------------------------------------------------------- 
I see the same behaviour with the watchdog device and softdog module

mdev used for hotplugging, echo /sbin/mdev > /proc/sys/kernel/hotplug
/sys/devices/virtual/misc/watchdog


insmod softdog:
/dev/watchdog is added because of hotplugging by mdev, as block device:
brw-rw----  1   root   root  10,130

rm /dev/watchdog, mdev -s:
/dev/watchdog is added as character device:
crw-rw----  1   root   root  10,130

Obviously /usr/sbin/watchdog fails to start in the hotplugging case. 

---------------------------------------------------------------------- 
 joeyoravec - 02-15-08 06:49  
---------------------------------------------------------------------- 
Here's are two of my problem devices, info captured with "env >>
/tmp/mdevlogfile" on a hotplug event. These are devices for an ALSA sound
chip/card over a SPI bitbang bus. There's a dev file under dev path, and
in this situation mdev should create a character device. Without my
proposed patch it would create a block device.

As I said in the original posting "mdev -s" would work fine because it
uses a completely different algorithm (scanning class and bus) and would
correctly create a character device. On hotplug events the situation is
different; the documentation says to use the SUBSYSTEM variable, not to
parse the path.

ACTION=add
HOME=/
SEQNUM=115
MAJOR=116
DEVPATH=/devices/platform/ermine_spi_bb_dac26/spi3.0/sound/card0/pcmC0D0p
SUBSYSTEM=sound
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MINOR=16
PWD=/

ACTION=add
HOME=/
SEQNUM=116
MAJOR=116
DEVPATH=/devices/platform/ermine_spi_bb_dac26/spi3.0/sound/card0/controlC0
SUBSYSTEM=sound
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MINOR=0
PWD=/ 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
02-14-08 16:14  joeyoravec     New Issue                                    
02-14-08 16:14  joeyoravec     Status                   new => assigned     
02-14-08 16:14  joeyoravec     Assigned To               => BusyBox         
02-14-08 16:14  joeyoravec     File Added: busybox-1.7.2-mdevblock.patch        
           
02-14-08 16:15  joeyoravec     Issue Monitored: joeyoravec                    
02-14-08 17:47  vapier         Note Added: 0004854                          
02-15-08 02:45  espakman       Note Added: 0004864                          
02-15-08 06:49  joeyoravec     Note Added: 0004874                          
======================================================================




More information about the busybox-cvs mailing list