Re: Khubd calls disconnect() after driver module unloaded

David Woodhouse <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Tue, 2007-11-13 at 10:47 -0500, Alan Stern wrote:
> 
> The problem you describe is supposed to be handled as follows in
> drivers/base/dd.c.  The rmmod task goes through driver_unregister()
> and
> bus_remove_driver(), ending up in driver_detach() where the call
> to __device_release_driver() is in the scope of the dev->sem lock.
> Similarly, the khubd task goes through device_del() and
> bus_remove_device(), ending up in device_release_driver() where the
> call to __device_release_driver() is also in the scope of the dev->sem
> lock.  Only the first of those should be able to reach your driver's
> disconnect method, since the routine ends by setting dev->driver to
> NULL.
> 
> Maybe you should add some debugging to __device_release_driver(): 
> entry, exit, value of dev->driver, and call to the remove routine.

It seems that driver_detach() doesn't find any devices to detach _from_
(there were printks there for when it called a remove function, _and_
for when it didn't because the driver didn't match).

drv->klist_devices.k_list is empty already.

[   95.483274] Resetting OLPC wireless via EC...                                 
[   95.488458] olpc-ec:  running cmd 0x25
[   95.495271] usb 1-1: USB disconnect, address 2
[   95.500430] devpath 1 ep2out 3strikes
[   95.504751] usb8xxx: URB in failure status: -71
[   95.509998] devpath 1 ep3in 3strikes
[   95.514775] usbcore: deregistering interface driver usb8xxx
[   95.521642] PM: Removing info for No Bus:usbdev1.2_ep02
[   95.528213] PM: Removing info for No Bus:usbdev1.2_ep83
[   95.534965] khubd:49 -- __device_release_driver enter, Dev ce3a1270, drv d085e65c ('usb8xxx')
[   95.544922] khubd:49 call drv->remove at c0545b88                                                                  
[   95.556670] rmmod:2358 enter driver_detach drv d085e65c ('usb8xxx')                                                
[   95.564061] rmmod:2358 leave driver_detach                                                                         
[   95.571930] usb8xxx rmmod bye...                                                                                   
[root@localhost ~]#
[   95.655866] PM: Removing info for No Bus:msh0                                                  
[   95.706716] BUG: unable to handle kernel paging request at virtual address d085aefc                                
[   95.715646]  printing eip:                                                                                         
[   95.718784] d085aefc                                                                                               
[   95.721322] *pde = 0eb2c067                                                                                        
[   95.724563] *pte = 00000000                                                                                        
[   95.727813] Oops: 0000 [#1]                                                                                        
[   95.731052] PREEMPT                                                                                                
[   95.733644] Modules linked in: autofs4 sunrpc loop mmc_block libertas ieee80211 ieee80211_crypt serio_raw psmouse v
[   95.751010] CPU:    0                                                                                              
[   95.751018] EIP:    0060:[<d085aefc>]    Not tainted VLI                                                           
[   95.751031] EFLAGS: 00010282   (2.6.22 #57)                                                                        
[   95.764593] EIP is at 0xd085aefc                                                                                   
[   95.768335] eax: 00000000   ebx: cd500120   ecx: c1240d78   edx: 00000001                                          
[   95.776161] esi: cebb2460   edi: ce3a1258   ebp: c1240e8c   esp: c1240e74                                          
[   95.783982] ds: 007b   es: 007b   fs: 0000  gs: 0000  ss: 0068                                                     
[   95.790709] Process khubd (pid: 49, ti=c1240000 task=ced9f570 task.ti=c1240000)                                    
[   95.798948] Stack: c1240e8c c05438d8 ce717990 ce3a1258 ce3a1270 d085e620 c1240ea0 c0545bb8                         
[   95.832231]        ce3a1270 d085e65c 00000000 c1240ecc c051ac75 c0683975 ced9f718 00000031                         
[   95.866154]        c0545b88 ce3a1270 d085e65c d085c0a3 ce3a1270 ce3a1270 c1240ed8 c051b089                         
[   95.900658] Call Trace:                                                                                            
[   95.953846]  [<c040436e>] show_trace_log_lvl+0x1a/0x2f                                                             
[   95.984987]  [<c040441e>] show_stack_log_lvl+0x9b/0xa3                                                             
[   96.015757]  [<c0404605>] show_registers+0x1df/0x320                                                               
[   96.046074]  [<c040483f>] die+0xf9/0x20d                                                                           
[   96.074780]  [<c0619f4c>] do_page_fault+0x414/0x4e5                                                                
[   96.104604]  [<c0618ada>] error_code+0x6a/0x70                                                                     
[   96.133927]  [<c0545bb8>] usb_unbind_interface+0x30/0x72                                                           
[   96.164264]  [<c051ac75>] __device_release_driver+0x163/0x1ae                                                      
[   96.195170]  [<c051b089>] device_release_driver+0x2f/0x45                                                          
[   96.225801]  [<c051a51a>] bus_remove_device+0x61/0x6f                                                              
[   96.255912]  [<c0518ead>] device_del+0x1d6/0x24c                                                                   
[   96.285302]  [<c0543852>] usb_disable_device+0x5f/0xbc                                                             
[   96.315663]  [<c0540393>] usb_disconnect+0x94/0xf0                                                                 
[   96.344979]  [<c05409c0>] hub_thread+0x2ec/0x996                                                                   
[   96.373588]  [<c0420d26>] kthread+0x39/0x5f                                                                        
[   96.401403]  [<c0404017>] kernel_thread_helper+0x7/0x10                                                            
[   96.430482]  =======================                                                                               
[   96.457721] Code:  Bad EIP value.                                                                                  

-- 
dwmw2


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.