Question about USB gadget driver usage

Mikhail Boiko mikhailboiko85 at gmail.com
Mon Oct 17 11:35:55 EDT 2011


Hi

We have linux-2.6.35 based device. Device has removable SD-card, which by
certain condition is shared to PC vis USB connection using g_file_storage
driver. Everything if fine, but when I manualy eject sd-card from
cardholder, on my linux host machine, sd-card partition is still being
mounted. In sources, there is a note, that if pass 'removable' parametr to
g_file_storage module, locations specified by 'file' argument could be
unmounted from sysfs by writing zero string to 'file'. But when try to do
so, removal attempt is rejected
in drivers/usb/gadget/storage_common.c:fsg_store_file() by first
if-condition.
755         if (curlun->prevent_medium_removal && fsg_lun_is_open(curlun)) {
756                 printk("eject attempt prevented\n");
757                 return -EBUSY;                          /* "Door is
locked" */
758         }
As far as I understand, my host-pc blocks driver to eject certain LUN.

Here is my parametrs to insert module
insmod /lib/modules/g_file_storage.ko stall=0 removable=1
file=/dev/mmcblk0p4,/dev/mmcblk1p1 ro=0,0
where /dev/mmcblk0p4 is device internal memory (chip is soldered to pcb, so
it can not be ejected)
and /dev/mmcblk1p1 is removable sd-card

Is there any way to perform `force eject` for one of my LUNs ?

Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20111017/e6426ae4/attachment.html 


More information about the Kernelnewbies mailing list