Recently, I've been testing the Garmin Foretrex 601 handheld GPS receiver.
When connected to a computer, the unit should function as a Mass Storage device, exposing track and waypoint data as GPX (XML) files which can be downloaded, uploaded and so on.
But once I plugged it, while powered up, into my laptop running Debian (Jessie), the unit would freeze with the prompt Enter Mass Storage Mode? on the screen. (When the unit was turned on while already connected to the computer, it would freeze on the Loading waypoints, tracks and routes ... screen instead.)
Once the unit froze, disconnecting it from USB wouldn't do anything - it would remain frozen until I powered it down by a few-second hold of the Power button and turned it back on.
Looking into /var/log/syslog, I saw that connecting the GPS generates these entries:
kernel: [27800.914317] usb 2-1.1: new full-speed USB device number 3 using ehci-pci
kernel: [27801.024885] usb 2-1.1: New USB device found, idVendor=091e, idProduct=0003
kernel: [27801.024891] usb 2-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
mtp-probe: checking bus 2, device 3: "/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1"
mtp-probe: bus: 2, device: 3 was not an MTP device
kernel: [27802.104048] usbcore: registered new interface driver usbserial
kernel: [27802.104072] usbcore: registered new interface driver usbserial_generic
kernel: [27802.104092] usbserial: USB Serial support registered for generic
kernel: [27802.105057] usbcore: registered new interface driver garmin_gps
kernel: [27802.105078] usbserial: USB Serial support registered for Garmin GPS usb/tty
kernel: [27802.105102] garmin_gps 2-1.1:1.0: Garmin GPS usb/tty converter detected
kernel: [27802.105401] usb 2-1.1: Garmin GPS usb/tty converter now attached to ttyUSB0
ModemManager[591]: <warn> (ttyUSB0): port attributes not fully set
More digging revealed that the freezing is linked to the mtp-probe line - so the GPS freezes while the computer probes whether or not the GPS supports transfer of media files.
Since the GPS is not a music player, it's safe to tell mtp-probe to leave it alone!
To do that, edit the MTP rules file ...
sudo nano /lib/udev/rules.d/69-libmtp.rules
Almost at the end of the file, an entry that looks like this ...
# Autoprobe vendor-specific, communication and PTP devices
ENV{ID_MTP_DEVICE}!="1", ENV{MTP_NO_PROBE}!="1", ENV{COLOR_MEASUREMENT_DEVICE}!="1", ENV{libsane_matched}!="yes", ATTR{bDeviceClass}=="00|02|06|ef|ff", PROGRAM="mtp-probe /sys$env{DEVPATH} $attr{busnum} $attr{devnum}", RESULT=="1", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"
... and just above it, add a new entry:
# Garmin Foretrex 601 (skip mtp-probe)
ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", GOTO="libmtp_rules_end"
Save the file and reload the rules by sudo udevadm control --reload-rules.
With this change in place, the GPS unit no longer crashes and Mass Storage mode works as expected.