Ticket #2206 (new defect)

Opened 4 years ago

Last modified 3 years ago

Can't mount GadgetFS on OM.

Reported by: frankmpunkt Owned by: openmoko-devel
Priority: normal Milestone:
Component: unknown Version: unspecified
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Estimated Completion (week):
HasPatchForReview: no PatchReviewResult:
Reproducible:

Description

I've got problems starting GadgetFS on the OpenMoko? (the actual phone) and I think it could be a problem in the kernel or the GadgetFS source.

GadgetFS and g_ether are compiled as module. This is how I start it:

rmmod g_ether
insmod .../gadgetfs.ko default_uid=`id -u`
mkdir -p /dev/gadget

Although GadgetFS starts without errors (so far) and "gadgetfs" is listed in /proc/filesystems, the following

mount -t gadgetfs gadgetfs /dev/gadget

throws an error (unknown filesystem).

Attachments

gadgetfs-speed-check.patch (447 bytes) - added by Sander 4 years ago.
gadgetfs speed check

Change History

Changed 4 years ago by Sander

gadgetfs speed check

comment:1 follow-up: ↓ 2 Changed 4 years ago by Sander

This patch modifies the USB speed check in the gadgetfs module.

I'm not sure yet if this is semantically correct, but this allows to mount the gadgetfs.

The module only allowed USB1.1 'full speed', and I _assumed_ that only LOW speed wasn't valid for this module, so I changed the check so that it only excludes 'low speed' (thus includes USB2.0 'HIGH speed').

I haven't checked anything beyond mounting the gadgetfs, so it's very possible userspace cannot use it in high speed mode!

comment:2 in reply to: ↑ 1 Changed 4 years ago by frankmpunkt

Replying to Sander:
I am not sure if I applied the patch correctly, but after having build everything the following file shows your changes:

${OM}/build/tmp/work/om-gta01-angstrom-linux-gnueabi/linux-openmoko-3_2.6.24+gitr0+fb42ce6724576fc173faf8abfb04aa2c36d213b7-r2.01/git/drivers/usb/gadget/s3c2410_udc.c

Anyway, the kernel module still shows the same error: no such filesystem

comment:3 Changed 4 years ago by frankmpunkt

I need to correct myself: The patch works as expected (i forgot to remove g_ether). Anyway, I think it is inode.c (gadgetfs), that needs to be fixed. Gadgetfs probes the chipset with a fake driver with USB_SPEED_LOW. But all udc drivers (amd5536udc.c atmel_usba_udc.c fsl_usb2_udc.c goku_udc.c lh7a40x_udc.c m66592-udc.c omap_udc.c pxa27x_udc.c pxa2xx_udc.c and finally s3c2410_udc.c) throw an error for drivers with wrong speed configuration. In combination with all those drivers gadgetfs' probing would fail. Only dummy_hdc seems to support all possible speed-values...

Anyway, once gadgetfs is mounted, it is usable in combination with s3c2410_udc, since the user space application that uses gadgetfs should seem to do chipset-dependent configuration (like http://www.linux-usb.org/gadget/usb.c does). I wrote a gadget for gadgetfs based on this example application and i am happy to report, that it works just fine with OM.

comment:4 follow-up: ↓ 5 Changed 4 years ago by lindi

frankmpunkt, is your gadgetfs application available somewhere? I'd like to test it. Also, shouldn't this bug be closed?

comment:5 in reply to: ↑ 4 Changed 3 years ago by frankmpunkt

Replying to lindi:

frankmpunkt, is your gadgetfs application available somewhere? I'd like to test it.

Sorry for the late reply. The program I was talking about emulates a USB CCID smart card reader. It is part of Virtual Smartcard Architecture (http://sourceforge.net/projects/vsmartcard/).

Note: See TracTickets for help on using tickets.