SD card autodetect and scan
Thanks aus9 for your reply. The link you provided is more clear on how to enable kernel-polling.
I am harding coding the kernel driver block/genhd.c to enable in-kernel-polling.
In disk_add_events()
ev->disk = disk;
spin_lock_init(&ev->lock);
ev->block = 1;
ev->poll_msecs = 2000;
INIT_DELAYED_WORK(&ev->dwork, disk_events_workfn);
Then I added some prints in disk_events_workfn(), which is called every 2 seconds.
disk_events_workfn() checks for events and strobes a KOBJ_CHANGE event if there is media change.
If I reboot my board without SD card inserted and with the above changes in kernel, I see prints in the disk_events_workfn() every two seconds.
Now here is my problem:
If I reboot my board with SD card inserted and with the above changes in kernel, I see the my SD card is scanned and see prints of its size and partition name sda1... But I dont see my prints in disk_events_workfn(), which may mean the polling is stopped.
Is that normal? once the SD card card is scanned there wont be any more polling? I want the polling to be on, so that it should be rescanned even if I replace it with another SD card or inserted it again.
I am working an embedded platform, and not sure about the filesystem manager.
Thanks again
Emmanuel
|