Bug 7701

Summary: raw1394 should in- & decrement refcount of ohci1394 and pcilynx
Product: Drivers Reporter: Stefan Richter (stefanr)
Component: IEEE1394Assignee: Stefan Richter (stefanr)
Status: CLOSED CODE_FIX    
Severity: normal    
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: all Subsystem:
Regression: --- Bisected commit-id:
Attachments: ieee1394: raw1394: prevent unloading of low-level driver

Description Stefan Richter 2006-12-17 12:30:53 UTC
ohci1394 and pcilynx can be unloaded while an application is using a host
adapter through raw1394. This especially happens if dv1394 or video1394 are
unloaded because this decrements ohci1394's use count. The result is inadvertent
loss of functionality or even system-wide lock-up, if ohci1394 is reloaded after
this. http://lkml.org/lkml/2006/12/17/91

I think we should add try_module_get(host->driver->owner) and
module_put(host->driver->owner)
 - either to initiation and release of requests,
 - or to the raw1394_open() and raw1394_release() hooks for all hosts which are
present when the file is opened,
 - or simply to raw1394's add_host() and remove_host() hooks.
Comment 1 Stefan Richter 2007-02-03 08:50:35 UTC
proposed patch posted at
http://thread.gmane.org/gmane.linux.kernel.firewire.devel/9000
Comment 2 Stefan Richter 2007-02-03 08:51:30 UTC
Created attachment 10272 [details]
ieee1394: raw1394: prevent unloading of low-level driver
Comment 3 Stefan Richter 2007-02-09 15:39:57 UTC
patch will appear in 2.6.21-rc1