On Wed, Jun 10, 2015 at 04:54:47AM +0000, Gujulan Elango, Hari Prasath (H.) wrote: > From: Hari Prasath Gujulan Elango <hgujulan@xxxxxxxxxxx> > <snip> > @@ -7159,8 +7144,9 @@ err_stop: > */ > static void dgap_cleanup_module(void) > { > - if (dgap_numboards) > - pci_unregister_driver(&dgap_driver); > + dgap_remove_driver_sysfiles(&dgap_driver); > + pci_unregister_driver(&dgap_driver); > + dgap_stop(); just a minor doubt... in this logic the poll timer will still be running when the sysfiles are removed or tty ports destroyed. So then isn't there a chance that someone is trying to access them when it is being removed? the original code was first doing dgap_poll_stop = 1 before doing anything else. I think the original code is wrong, dgap_start() registers the devices and starts the timer before the initialization is complete. But dgap_start() should have been called at the end after pci driver is registered and the sysfiles created, then in that case the timer and polling will start after all initialization is complete and in that way we could have also removed the dgap_driver_state variable and some related code in dgap_poll_handler(). And then dgap_stop() should have been called first in the module_exit part. Dan, your views? regards sudip _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel