Re: Running ADB on a "stock" distribution (g_ffs)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 05/21/2015 06:26 PM, Bastien Nocera wrote:
On Thu, 2015-05-21 at 11:08 +0200, Krzysztof Opasiak wrote:
On 05/21/2015 10:39 AM, Bastien Nocera wrote:
On Thu, 2015-05-21 at 10:09 +0200, Krzysztof Opasiak wrote:
Could you specify exactly the model?

Onda v975w

If android is running fine on it you may check android kernel
config
for
this device and check which udc is enabled.

No kernel sources from this Chinese vendor. But it looks like the
USB_DWC3 config is the one to enable.


I see that this tablet is running windows by default so just flash
it
with stock image and  check what device manager says about udc;)

The Baytrail UDC driver is supposed to be a DWC3 PCI device, but it
doesn't show up in lspci at all. Given that I managed to make an NFC
chip show up that I didn't know was in the machine, I guess it's
possibly hidden in the firmware somewhere.

In the meantime, shouldn't the ffs-test and adbd have failed with
ENOTSUPP instead of EBUSY if no hardware support was available?


As far as I understand the code it should fail with -ENODEV and
debug
message:

pr_debug("couldn't find an available UDC\n");

I get that stack trace when writing is attempted:
[  122.362269] ------------[ cut here ]------------
[  122.362287] WARNING: CPU: 2 PID: 2384 at drivers/usb/gadget/function/f_fs.c:3417 ffs_ep0_write+0x730/0x810 [usb_f_fs]()
[  122.362292] Modules linked in: g_ffs usb_f_fs libcomposite udc_core bnep bluetooth fuse hid_logitech_hidpp uvcvideo videobuf2_vmalloc snd_usb_audio videobuf2_core videobuf2_memops v4l2_common snd_usbmidi_lib videodev snd_hwdep snd_rawmidi media hid_multitouch hid_logitech_dj nf_conntrack_netbios_ns nf_conntrack_broadcast ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw vfat pn544_mei fat mei_phy pn544 intel_rapl hci intel_soc_dts_thermal coretemp nfc gpio_keys snd_soc_sst_baytrail_pcm
[  122.362412]  kvm_intel iTCO_wdt snd_soc_sst_ipc iTCO_vendor_support snd_soc_sst_dsp kvm snd_soc_sst_byt_rt5640_mach crc32_pclmul crc32c_intel snd_intel_sst_acpi snd_intel_sst_core snd_soc_sst_mfld_platform snd_soc_rt5640 snd_soc_rl6231 snd_soc_core snd_compress snd_pcm_dmaengine tpm_crb snd_seq tpm dw_dmac int3402_thermal dw_dmac_core snd_seq_device int3400_thermal kxcjk_1013 soc_button_array snd_pcm processor_thermal_device int3403_thermal acpi_thermal_rel int340x_thermal_zone mei_txe industrialio_triggered_buffer goodix mei snd_timer lpc_ich ac i2c_hid kfifo_buf acpi_pad dell_smo8800 iosf_mbi industrialio snd soundcore pwm_lpss_platform rfkill_gpio battery regmap_i2c pwm_lpss i2c_designware_platform rfkill snd_soc_sst_acpi i2c_designware_core nfsd auth_rpcgss nfs_acl lockd grace sunrpc dm9601 usbnet
[  122.362529]  mii i915 mmc_block i2c_algo_bit drm_kms_helper drm video sdhci_acpi sdhci mmc_core
[  122.362555] CPU: 2 PID: 2384 Comm: adbd Tainted: G        W       4.1.0-0.rc4.git0.1.1.fc22.i686 #1
[  122.362561] Hardware name: To be filled by O.E.M. To be filled by O.E.M./Aptio CRB, BIOS 5.6.5 07/25/2014
[  122.362567]  c0d1f947 415badfa 00000000 d1029e64 c0a86e54 00000000 d1029e94 c045b937
[  122.362584]  c0c37f94 00000002 00000950 f9b313d4 00000d59 f9b2ebf0 f9b2ebf0 fffffff0
[  122.362600]  00000003 deb53d00 d1029ea4 c045ba42 00000009 00000000 d1029f08 f9b2ebf0
[  122.362617] Call Trace:
[  122.362633]  [<c0a86e54>] dump_stack+0x41/0x52
[  122.362645]  [<c045b937>] warn_slowpath_common+0x87/0xc0
[  122.362658]  [<f9b2ebf0>] ? ffs_ep0_write+0x730/0x810 [usb_f_fs]
[  122.362668]  [<f9b2ebf0>] ? ffs_ep0_write+0x730/0x810 [usb_f_fs]
[  122.362678]  [<c045ba42>] warn_slowpath_null+0x22/0x30
[  122.362689]  [<f9b2ebf0>] ffs_ep0_write+0x730/0x810 [usb_f_fs]
[  122.362702]  [<f9b2e4c0>] ? ffs_ep0_read+0x380/0x380 [usb_f_fs]
[  122.362712]  [<c05a1c1f>] __vfs_write+0x2f/0x100
[  122.362722]  [<c05a42f2>] ? __sb_start_write+0x52/0x110
[  122.362731]  [<c05a2534>] vfs_write+0x94/0x1b0
[  122.362740]  [<c0a8a1c0>] ? mutex_lock+0x10/0x30
[  122.362749]  [<c05a2f41>] SyS_write+0x51/0xb0
[  122.362759]  [<c0a8c71f>] sysenter_do_call+0x12/0x12
[  122.362766] ---[ end trace 0673d3467cecf8db ]---


I have managed to reproduce your situation when I compiled kernel without any UDC driver. This stack trace is related to a bug in ffs.
I have prepared patches to fix this[1].

Unfortunately those patches will not make ffs working in your case. They will only make your adb failing with -ENODEV instead of -EBUSY as it should. Your basic problem is that you don't have any UDC in your system. Add one and you are ready to go;)

Have you tried loading other gadget modules?

No, I didn't try.

  If not, maybe try to load
g_ether and check what dmesg says.

I didn't have g_ether built, so tried with g_serial:
# modprobe g_serial
modprobe: ERROR: could not insert 'g_serial': No such device

This is exactly what I expected and what write(&strings) should set in errno. After those patches it is be in this way.

Footnotes:
1 - http://article.gmane.org/gmane.linux.usb.general/126038

Cheers,
--
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux