>As Mr.Alan Suggested there was one resource freeing which was still in
use >by Application. That is Driver Specific structure, which is soted
in file->private_data in open system call. When disconnected was called
i was >freeing this structure also which i think i should not free.
Because Even >though device is disconnected application does not know
about it yet. So >it may call further system calls on it, like read,
write, ioctl... In >those function the first usual step we do is ...
struct scanner_dev *dev;
dev = (struct scanner_dev *)file->private_data;
if(!dev) // or if(!dev->device_present)
return -EBADF;
>As soon as i free this dev structure in disconnect, there was kernel
>panic!!! ( Correct me if i am wrong)
Have some simple if's to make sure your application is not using the
driver and there are no IO taking place between your driver and the
device, this will solve your problem. Just have look at neat
usb-skeleton.c code and follow the same sequence.
Regards, Iqbal
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Savita
H. Neelannava
Sent: Wednesday, October 26, 2005 11:24 PM
To: [email protected]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [linux-usb-devel] Device surprise removal-kernel panic
Hi All,
As Mr.Alan Suggested there was one resource freeing which was still in
use by Application. That is Driver Specific structure, which is soted in
file->private_data in open system call. When disconnected was called i
was freeing this structure also which i think i should not free. Because
Even though device is disconnected application does not know about it
yet. So it may call further system calls on it, like read, write,
ioctl... In those function the first usual step we do is ...
struct scanner_dev *dev;
dev = (struct scanner_dev *)file->private_data;
if(!dev) // or if(!dev->device_present)
return -EBADF;
As soon as i free this dev structure in disconnect, there was kernel
panic!!! ( Correct me if i am wrong)
One question:
What if probe function fails for some reason n user do insmod
driver.ko... User doesn't understand any printk's of driver n tries to
open application n fail.
Is there anyway to tell him or notify him not to do that( other than
printing some Msg to console)? this may be very silly question but plz
ans me...
Thanks alot for inputs
Savita
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel