2010-02-28 23:06:07     Problem with USB MSD Hotplug

Document created by Aaronwu Employee on Aug 20, 2013
Version 1Show Document
  • View in full screen mode

2010-02-28 23:06:07     Problem with USB MSD Hotplug

Vinay Kumar (INDIA)

Message: 86650   

 

Hi all,

 

I am working BF527-Ezkit, it has a USB otg, i am trying to implement usb automount function, i went to forums, i got lot of stuff regarding hotplug, i tried all the ways nothing worked. At last i tried to debug mdev using print statements and found that mdev is called at the initial bootup, and not been called when the usb is inserted. i cross verified this running mdev from command prompt, i got the print statements. from this i came to a conclusion that hotplug is not called when the usb is inserted, and i am trying to find the driver, which is responsible for calling hotplug.

 

Am i in the right track, Am i missing any config options(i enabled CONFIG_HOTPLUG). please guide me.

 

 

 

Thanks.

QuoteReplyEditDelete

 

 

2010-03-01 14:39:51     Re: Problem with USB MSD Hotplug

Robin Getz (UNITED STATES)

Message: 86681   

 

Vinay:

 

What version of silicon do you have? Hotplug seems to work for everyone else on recent silicon.

 

-Robin

QuoteReplyEditDelete

 

 

2010-03-01 22:44:54     Re: Problem with USB MSD Hotplug

Vinay Kumar (INDIA)

Message: 86692   

 

Hi Robin,

 

Thank you for your time,

 

I have a silicon version of 0.0.

QuoteReplyEditDelete

 

 

2010-03-02 04:10:26     Re: Problem with USB MSD Hotplug

Vinay Kumar (INDIA)

Message: 86710   

 

Hi Robin,

 

I am able to solve the problem, for this i did the following,

 

1. Changed the shell to Hash(default msh)

 

2. In rc file i did this " echo /sbin/hotplug > /proc/sys/kernel/hotplug"

 

3. I placed my hotplug script in /bin/

 

now its working fine.

 

I have a question regarding this, 

 

While answering to thread    blackfin.uclinux.org/gf/project/uclinux-dist/forum/?action=ForumBrowse&forum_id=39&thread_id=36728&_forum_action=ForumMessageBrowse

 

Wolfgang Muees says that this procedure is wrong and suggests to make an entry in mdev.conf, but the procedure is not working for me. Is there any problem if i use the above procedure to automount the USB?

 

Thank you.

QuoteReplyEditDelete

 

 

2010-03-02 04:39:54     Re: Problem with USB MSD Hotplug

Robin Getz (UNITED STATES)

Message: 86712   

 

Vinay:

 

There are lots of USB problems in 0.0 - try upgrading to something more recent.

 

-Robin

QuoteReplyEditDelete

 

 

2010-03-02 05:50:20     Re: Problem with USB MSD Hotplug

Wolfgang Muees (GERMANY)

Message: 86717   

 

Hi Vinay,

 

you wrote:

 

Wolfgang Muees says that this procedure is wrong and suggests to make an entry in mdev.conf, but the procedure is not working for me.

 

Maybe you have missed some step.

 

echo /bin/mdev >/proc/sys/kernel/hotplug

 

in your RC file.

 

 

 

/bin/mdev

 

must be there.

 

 

 

sda[0-9] 0:0 0664 */bin/hotplug-usb

 

in /etc/mdev.conf

 

 

 

And last, in your /bin/hotplug-usb:

 

#!/bin/sh

 

USB_MPOINT=/data/mnt/usb

 

case "$ACTION" in

        add|"")

                mkdir -p $USB_MPOINT

                mount -t auto $MDEV $USB_MPOINT

                ;;

        remove)

                umount $USB_MPOINT

                rmdir $USB_MPOINT

                ;;

esac

 

And - for coldplug - I think that /bin/mdev is called with the "-s" option from the RC scripts.

TranslateQuoteReplyEditDelete

 

 

2010-03-02 06:09:12     Re: Problem with USB MSD Hotplug

Vinay Kumar (INDIA)

Message: 86720   

 

Hi Wolfgang,

 

I tried all the possibilities you suggested, nothing worked for me, i wil give it a fresh try once again.

 

Thank you for your time.

QuoteReplyEditDelete

 

 

2010-03-04 03:03:57     Re: Problem with USB MSD Hotplug

Wolfgang Muees (GERMANY)

Message: 86779   

 

Vinay,

 

maybe you need to enable the MSH shell in the uclinux configuration for the script to work.

 

regards

 

Wolfgang

TranslateQuoteReplyEditDelete

 

 

2010-03-04 20:57:27     Re: Problem with USB MSD Hotplug

Mike Frysinger (UNITED STATES)

Message: 86817   

 

please read the documentation.  it states that hotplug scripts are not run with std{in,err,out} so any debug statements you add are meaningless -- you're not going to see them unless you take care of re-attaching std{err,out} yourself.

Attachments

    Outcomes