Bug 15853

Summary: sysfs: cannot create duplicate filename '/bus/ieee1394/drivers/sbp2/00027a0e440020c2-1
Product: Drivers Reporter: Stefan Richter (stefanr)
Component: IEEE1394Assignee: drivers_ieee1394
Status: CLOSED WILL_NOT_FIX    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: circa 2.6.31...2.6.34 Subsystem:
Regression: No Bisected commit-id:
Bug Depends on:    
Bug Blocks: 10046    

Description Stefan Richter 2010-04-26 01:21:32 UTC
When ohci1394 is loaded while a dual-unit SBP-2 device is attached to the FireWire bus, ieee1394 may attempt to bind sbp2 to the second unit of the device twice:

Apr 26 03:06:17 stein kernel: ohci1394 0000:04:00.0: setting latency timer to 64
Apr 26 03:06:17 stein kernel: ohci1394: fw-host0: OHCI-1394 1.1 (PCI): IRQ=[19]  MMIO=[f0600000-f06007ff]  Max Packet=[4096]  IR/IT contexts=[8/8]                                              
Apr 26 03:06:19 stein kernel: ieee1394: Node added: ID:BUS[0-02:1023]  GUID[00027a0e440020c2]   
Apr 26 03:06:19 stein kernel: ieee1394: Host added: ID:BUS[0-03:1023]  GUID[0814438400000389]   
Apr 26 03:06:19 stein kernel: scsi45 : SBP-2 IEEE-1394                                          
Apr 26 03:06:19 stein kernel: ieee1394: sbp2: Workarounds for node 0-02:1023: 0x2 (firmware_revision 0x000241, vendor_id 0x00027a, model_id 0x000000)                                           
Apr 26 03:06:20 stein kernel: ieee1394: sbp2: Logged into SBP-2 device                          
Apr 26 03:06:20 stein kernel: ieee1394: sbp2: Node 0-02:1023: Max speed [S800] - Max payload [4096]                                                                                             
Apr 26 03:06:20 stein kernel: scsi 45:0:0:0: CD-ROM            TEAC     DV-516GC         XT11 PQ: 0 ANSI: 0                                                                                     
Apr 26 03:06:20 stein kernel: sr1: scsi3-mmc drive: 48x/48x cd/rw xa/form2 cdda tray            
Apr 26 03:06:20 stein kernel: sr 45:0:0:0: Attached scsi CD-ROM sr1                             
Apr 26 03:06:20 stein kernel: sr 45:0:0:0: Attached scsi generic sg5 type 5                     
Apr 26 03:06:20 stein kernel: scsi46 : SBP-2 IEEE-1394                                          
Apr 26 03:06:20 stein kernel: ieee1394: sbp2: Workarounds for node 0-02:1023: 0x2 (firmware_revision 0x000241, vendor_id 0x00027a, model_id 0x000000)                                           
Apr 26 03:06:21 stein kernel: ieee1394: sbp2: Logged into SBP-2 device                          
Apr 26 03:06:21 stein kernel: ieee1394: sbp2: Node 0-02:1023: Max speed [S800] - Max payload [4096]                                                                                             
Apr 26 03:06:21 stein kernel: scsi 46:0:1:0: CD-ROM            TEAC     DV-516GC         XT11 PQ: 0 ANSI: 0                                                                                     
Apr 26 03:06:21 stein kernel: sr2: scsi3-mmc drive: 48x/48x cd/rw xa/form2 cdda tray            
Apr 26 03:06:21 stein kernel: sr 46:0:1:0: Attached scsi CD-ROM sr2                             
Apr 26 03:06:21 stein kernel: sr 46:0:1:0: Attached scsi generic sg6 type 5                     
Apr 26 03:06:21 stein kernel: ------------[ cut here ]------------                              
Apr 26 03:06:21 stein kernel: WARNING: at fs/sysfs/dir.c:451 sysfs_add_one+0x85/0x99()          
Apr 26 03:06:21 stein kernel: Hardware name: System Product Name                                
Apr 26 03:06:21 stein kernel: sysfs: cannot create duplicate filename '/bus/ieee1394/drivers/sbp2/00027a0e440020c2-1'                                                                           
Apr 26 03:06:21 stein kernel: Modules linked in: firedtv dvb_core firewire_core crc_itu_t sbp2 ohci1394 ieee1394 cpufreq_ondemand powernow_k8 freq_table nfsd lockd sunrpc exportfs snd_pcm_oss snd_mixer_oss snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device ext4 jbd2 crc16 sr_mod cdrom snd_hda_codec_atihdmi snd_hda_codec_realtek snd_hda_intel k10temp yenta_socket snd_hda_codec pcmcia_core r8169 pata_atiixp mii snd_pcm sg snd_timer snd processor snd_page_alloc thermal [last unloaded: ieee1394]                                                                             
Apr 26 03:06:21 stein kernel: Pid: 7603, comm: knodemgrd_2 Tainted: G  RM    W  2.6.34-rc5 #5   
Apr 26 03:06:21 stein kernel: Call Trace:                                                       
Apr 26 03:06:21 stein kernel: [<ffffffff810dc761>] ? sysfs_add_one+0x85/0x99                    
Apr 26 03:06:21 stein kernel: [<ffffffff810dc761>] ? sysfs_add_one+0x85/0x99                    
Apr 26 03:06:21 stein kernel: [<ffffffff8102f08b>] ? warn_slowpath_common+0x77/0xa3             
Apr 26 03:06:21 stein kernel: [<ffffffff8102f113>] ? warn_slowpath_fmt+0x51/0x59                
Apr 26 03:06:21 stein kernel: [<ffffffff811173b8>] ? ida_get_new_above+0xf5/0x1b3               
Apr 26 03:06:21 stein kernel: [<ffffffff810dc6d4>] ? sysfs_pathname+0x35/0x3d                   
Apr 26 03:06:21 stein kernel: [<ffffffff810dc6d4>] ? sysfs_pathname+0x35/0x3d                   
Apr 26 03:06:21 stein kernel: [<ffffffff810dc6d4>] ? sysfs_pathname+0x35/0x3d                   
Apr 26 03:06:21 stein kernel: [<ffffffff810dc6d4>] ? sysfs_pathname+0x35/0x3d                   
Apr 26 03:06:21 stein kernel: [<ffffffff810dc761>] ? sysfs_add_one+0x85/0x99                    
Apr 26 03:06:21 stein kernel: [<ffffffff810dd299>] ? sysfs_do_create_link+0xba/0x11a            
Apr 26 03:06:21 stein kernel: [<ffffffff81215f10>] ? driver_sysfs_add+0x22/0x63                 
Apr 26 03:06:21 stein kernel: [<ffffffff812161bf>] ? device_bind_driver+0xe/0x23                
Apr 26 03:06:21 stein kernel: [<ffffffff812161fe>] ? device_attach+0x2a/0x7e                    
Apr 26 03:06:21 stein kernel: [<ffffffff81215081>] ? bus_rescan_devices_helper+0x0/0x4c         
Apr 26 03:06:21 stein kernel: [<ffffffff812150af>] ? bus_rescan_devices_helper+0x2e/0x4c        
Apr 26 03:06:21 stein kernel: [<ffffffff81215928>] ? bus_for_each_dev+0x43/0x74                 
Apr 26 03:06:21 stein kernel: [<ffffffffa0209c8f>] ? nodemgr_host_thread+0x7e5/0x957 [ieee1394] 
Apr 26 03:06:21 stein kernel: [<ffffffffa02094aa>] ? nodemgr_host_thread+0x0/0x957 [ieee1394]
Apr 26 03:06:21 stein kernel: [<ffffffff810415f9>] ? kthread+0x79/0x81
Apr 26 03:06:21 stein kernel: [<ffffffff81002c14>] ? kernel_thread_helper+0x4/0x10
Apr 26 03:06:21 stein kernel: [<ffffffff81041580>] ? kthread+0x0/0x81
Apr 26 03:06:21 stein kernel: [<ffffffff81002c10>] ? kernel_thread_helper+0x0/0x10
Apr 26 03:06:21 stein kernel: ---[ end trace 209e31082f5f6ef7 ]---
Apr 26 03:06:21 stein kernel: ------------[ cut here ]------------
Apr 26 03:06:21 stein kernel: WARNING: at fs/sysfs/dir.c:451 sysfs_add_one+0x85/0x99()
Apr 26 03:06:21 stein kernel: Hardware name: System Product Name
Apr 26 03:06:21 stein kernel: sysfs: cannot create duplicate filename '/bus/ieee1394/drivers/sbp2/00027a0e440020c2-1'
Apr 26 03:06:21 stein kernel: Modules linked in: firedtv dvb_core firewire_core crc_itu_t sbp2 ohci1394 ieee1394 cpufreq_ondemand powernow_k8 freq_table nfsd lockd sunrpc exportfs snd_pcm_oss snd_mixer_oss snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device ext4 jbd2 crc16 sr_mod cdrom snd_hda_codec_atihdmi snd_hda_codec_realtek snd_hda_intel k10temp yenta_socket snd_hda_codec pcmcia_core r8169 pata_atiixp mii snd_pcm sg snd_timer snd processor snd_page_alloc thermal [last unloaded: ieee1394]
Apr 26 03:06:21 stein kernel: Pid: 7604, comm: knodemgrd_3 Tainted: G  RM    W  2.6.34-rc5 #5
Apr 26 03:06:21 stein kernel: Call Trace:
Apr 26 03:06:21 stein kernel: [<ffffffff810dc761>] ? sysfs_add_one+0x85/0x99
Apr 26 03:06:21 stein kernel: [<ffffffff810dc761>] ? sysfs_add_one+0x85/0x99
Apr 26 03:06:21 stein kernel: [<ffffffff8102f08b>] ? warn_slowpath_common+0x77/0xa3
Apr 26 03:06:21 stein kernel: [<ffffffff8102f113>] ? warn_slowpath_fmt+0x51/0x59
Apr 26 03:06:21 stein kernel: [<ffffffff811173b8>] ? ida_get_new_above+0xf5/0x1b3
Apr 26 03:06:21 stein kernel: [<ffffffff810dc6d4>] ? sysfs_pathname+0x35/0x3d
Apr 26 03:06:21 stein kernel: [<ffffffff810dc6d4>] ? sysfs_pathname+0x35/0x3d
Apr 26 03:06:21 stein kernel: [<ffffffff810dc6d4>] ? sysfs_pathname+0x35/0x3d
Apr 26 03:06:21 stein kernel: [<ffffffff810dc6d4>] ? sysfs_pathname+0x35/0x3d
Apr 26 03:06:21 stein kernel: [<ffffffff810dc761>] ? sysfs_add_one+0x85/0x99
Apr 26 03:06:21 stein kernel: [<ffffffff810dd299>] ? sysfs_do_create_link+0xba/0x11a
Apr 26 03:06:21 stein kernel: [<ffffffff81215f10>] ? driver_sysfs_add+0x22/0x63
Apr 26 03:06:21 stein kernel: [<ffffffff81216024>] ? driver_probe_device+0x66/0x14b
Apr 26 03:06:21 stein kernel: [<ffffffff81216178>] ? __device_attach+0x0/0x39
Apr 26 03:06:21 stein kernel: [<ffffffff81215684>] ? bus_for_each_drv+0x46/0x77
Apr 26 03:06:21 stein kernel: [<ffffffff81216234>] ? device_attach+0x60/0x7e
Apr 26 03:06:21 stein kernel: [<ffffffff81215081>] ? bus_rescan_devices_helper+0x0/0x4c
Apr 26 03:06:21 stein kernel: [<ffffffff812150af>] ? bus_rescan_devices_helper+0x2e/0x4c
Apr 26 03:06:21 stein kernel: [<ffffffff81215928>] ? bus_for_each_dev+0x43/0x74
Apr 26 03:06:21 stein kernel: [<ffffffffa0209c8f>] ? nodemgr_host_thread+0x7e5/0x957 [ieee1394]
Apr 26 03:06:21 stein kernel: [<ffffffffa02094aa>] ? nodemgr_host_thread+0x0/0x957 [ieee1394]
Apr 26 03:06:21 stein kernel: [<ffffffff810415f9>] ? kthread+0x79/0x81
Apr 26 03:06:21 stein kernel: [<ffffffff81002c14>] ? kernel_thread_helper+0x4/0x10
Apr 26 03:06:21 stein kernel: [<ffffffff81041580>] ? kthread+0x0/0x81
Apr 26 03:06:21 stein kernel: [<ffffffff81002c10>] ? kernel_thread_helper+0x0/0x10
Apr 26 03:06:21 stein kernel: ---[ end trace 209e31082f5f6ef8 ]---
Apr 26 03:06:21 stein kernel: really_probe: driver_sysfs_add(00027a0e440020c2-1) failed
Apr 26 03:06:21 stein kernel: sbp2: probe of 00027a0e440020c2-1 failed with error 0

I cannot reproduce it merely by plugging the device in while the drivers are already loaded.  Nor does it happen at all attempts to reproduce it by loading the drivers when the device is already plugged.  It seemed as if the condition is that the local node is not root node while ieee1394 is loaded, but the above log shows the contrary.

Originally reported against OpenSUSE in https://bugzilla.novell.com/show_bug.cgi?id=586172 but reproduced on mainline.
Comment 1 Stefan Richter 2010-05-31 18:25:21 UTC
life is too short -> won't fix