Closed Bug 1113518 Opened 10 years ago Closed 10 years ago

[gonk-l] [nexus-5] MTP sometimes doesn't work on Nexus 5

Categories

(Firefox OS Graveyard :: MTP/UMS, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(firefox36 wontfix, firefox37 wontfix, firefox38 fixed, b2g-v2.2 fixed, b2g-master fixed)

RESOLVED FIXED
2.2 S5 (6feb)
Tracking Status
firefox36 --- wontfix
firefox37 --- wontfix
firefox38 --- fixed
b2g-v2.2 --- fixed
b2g-master --- fixed

People

(Reporter: askeing, Assigned: alchen)

References

Details

Attachments

(2 files, 2 obsolete files)

MTP doesn't work. Build Info: Build ID 20141218151450 Gaia Revision 58734e8a48157f99d5b733412b600c2e04c954fe Gaia Date 2014-12-18 05:21:04 Gecko Revision n/a Gecko Version 37.0a1 Device Name hammerhead Firmware(Release) 5.0 Firmware(Incremental) eng.askeing.20141218.150855 Firmware Date Thu Dec 18 15:10:01 CST 2014 Bootloader HHZ12d
MTP sometimes dosen't work on Nexus 5, it's not stable. It seems like a bug, not a porting blocker issue. Alphan will help to find the root cause.
Summary: [gonk-l] MTP dosen't work → [gonk-l] [nexus-5] MTP sometimes dosen't work on Nexus 5
From log, when error happened, the state of automounter keep in "UMS_CONFIGURING". Since Nexus 5 is a fuse architecture, we cannot use UMS on Nexus 5.
Attached file automounter.log (deleted) —
Here is the automounter and mtp log.
Component: General → MTP/UMS
Hi Alphan, Are you gonna take it? would also need ETA for better understanding the risk. thanks.
Flags: needinfo?(alchen)
Target Milestone: --- → 2.2 S3 (9jan)
Yes, I will take this bug.
Assignee: nobody → alchen
Flags: needinfo?(alchen)
The following is the reason of why MTP cannot restart successfully. When restarting MozMtpServer, "/dev/mtp_usb" cannot be opened. (the error code is "Device or resource busy") 12-18 15:21:40.937 193 423 I AutoMounter: Changing mode from 'Enable-MTP' to 'Disable' 12-18 15:21:40.937 193 423 I AutoMounter: Stopping MtpServer 12-18 15:21:40.937 193 423 I MozMtp : ~MozMtpStorage: Storage destructed for Volume sdcard mStorageID 0x00010001 12-18 15:21:40.937 193 423 I MozMtp : StorageUnavailable: Removing mStorageID 0x00010001 from MtpServer 12-18 15:21:40.937 193 423 I MozMtp : StorageUnavailable: Removing mStorageID 0x00010001 from MozMtpDatabse 12-18 15:21:40.937 193 423 I AutoMounter: AutoMounter state changed from MTP_STARTED to IDLE 12-18 15:21:40.937 193 423 I AutoMounter: UpdateState: ums:A0C0E0 mtp:A1C1E0 mode:0 usb:1 tryToShare:0 state:IDLE 12-18 15:21:40.937 193 423 I AutoMounter: UpdateState: Volume sdcard is Mounted and inserted @ /storage/emulated/legacy gen 1 locked 0 sharing x 12-18 15:21:40.937 193 423 I AutoMounterSetting: Changing status from 'Enabled' to 'Disabled' 12-18 15:21:47.250 193 423 I AutoMounter: Changing mode from 'Disable' to 'Enable-MTP' 12-18 15:21:47.250 193 423 I AutoMounter: Starting MtpServer 12-18 15:21:47.250 193 423 E MozMtp : Init: open of '/dev/mtp_usb' failed
/dev/mtp_usb is busy when server is still running. class MtpServerRunnable : public nsRunnable { ... nsresult Run() { ... MTP_LOG("MozMtpServer started"); server->run(); MTP_LOG("MozMtpServer finished"); ... } ... private: nsRefPtr<MozMtpServer> mMozMtpServer; ScopedClose mMtpUsbFd; // We want to hold this open while the server runs }
The patch contain the three parts: 1. Add one case for disabling MTP on fuse device. 2. Need to set sMozMtpServer as nullptr when "sMozMtpServer->Init()" failed. 3. Print the reason of opening "/dev/mtp_usb" failed.
Attachment #8542795 - Flags: review?(dhylands)
Update a new version.
Attachment #8542795 - Attachment is obsolete: true
Attachment #8542795 - Flags: review?(dhylands)
Attachment #8543743 - Flags: review?(dhylands)
Summary: [gonk-l] [nexus-5] MTP sometimes dosen't work on Nexus 5 → [gonk-l] [nexus-5] MTP sometimes doesn't work on Nexus 5
Comment on attachment 8543743 [details] [diff] [review] [automounter] Add a case for fuse and add some useful logs-0105 Review of attachment 8543743 [details] [diff] [review]: ----------------------------------------------------------------- Looks good - just a couple minor nits to address. ::: dom/system/gonk/AutoMounter.cpp @@ +105,5 @@ > #define USB_FUNC_MTP "mtp" > #define USB_FUNC_NONE "none" > #define USB_FUNC_RNDIS "rndis" > #define USB_FUNC_UMS "mass_storage" > +#define USB_FUNC_DFT "default" nit: Since we're introducing a "fake" USB Function, let's choose a name like ~~default~~ or something that isn't likely to ever be used in real life. nit: Let's use USB_FUNC_DEFAULT rather than abbreviating to DFT
Attachment #8543743 - Flags: review?(dhylands) → review+
Keywords: checkin-needed
Could you please also land the patch to v2.2? Thanks.
Flags: needinfo?(alchen)
Sure. I will do the test by myself first and request the approval for v2.2 later.
Flags: needinfo?(alchen)
Comment on attachment 8555140 [details] [diff] [review] [automounter] Add a case for fuse and add some useful logs. r=dhylands [Approval Request Comment] Bug caused by (feature/regressing bug #): It is a lack of MTP implementation. User impact if declined: The MTP functionality may be broken when doing enable and disable frequently. Testing completed: MTP testcases(http://goo.gl/pZIds0) are passed. Risk to taking this patch (and alternatives if risky): (low risk) It is a patch for the lack. String or UUID changes made by this patch: none
Attachment #8555140 - Flags: approval-mozilla-b2g37?
Attachment #8555140 - Flags: approval-mozilla-b2g37? → approval-mozilla-b2g37+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: