Ricardo, I think I figured out the problem: my 3380 was running in legacy adapter mode. I am now capable of connecting both g_mass_storage and g_ether without any kernel panics after ensuring the 3380 is in enhanced adapter mode. My only concern is the speed from my Mac to Linux: - g_ether: scp transfer 42Mb/s - g_mass_storage: dd bs=64k 116Mb/s (backed by SSD storage) For comparison, a direct gigabit connection allows between 90 and 95Mb/s using scp between the machines. Local writes on the linux side using dd is around 480Mb/s (on the same SSD storage). Any ideas on how to achieve a higher performance? Regards, Paul. On 25 Nov 2014, at 16:30, Paul Jones <p.jones@xxxxxxxxxx> wrote: > Ricardo, > > Unfortunately your latest change gives similar results, cycling errors in the log: > [ 201.287706] ------------[ cut here ]------------ > [ 201.288328] WARNING: CPU: 3 PID: 1500 at drivers/usb/gadget/udc/net2280.c:816 start_dma+0x153/0x160 [net2280]() > [ 201.288991] Modules linked in: g_mass_storage usb_f_mass_storage libcomposite configfs net2280 udc_core snd_hda_codec_hdmi joydev hid_generic usbhid hid i915 intel_rapl x86_pkg_temp_thermal intel_powerclamp snd_hda_codec_realtek coretemp kvm_intel snd_hda_codec_generic kvm snd_hda_intel eeepc_wmi asus_wmi snd_hda_controller rfcomm snd_seq_midi bnep snd_seq_midi_event bluetooth sparse_keymap snd_hda_codec crct10dif_pclmul snd_rawmidi snd_hwdep crc32_pclmul snd_pcm ghash_clmulni_intel aesni_intel aes_x86_64 drm_kms_helper lrw gf128mul glue_helper ablk_helper cryptd snd_seq mei_me mei serio_raw drm lpc_ich video mac_hid tpm_infineon wmi snd_seq_device snd_timer snd parport_pc i2c_algo_bit soundcore ppdev lp parport e1000e psmouse r8169 ahci libahci mii ptp pps_core > [ 201.292574] CPU: 3 PID: 1500 Comm: file-storage Tainted: G W 3.17.0-rc5+ #2 > [ 201.293277] Hardware name: ASUS All Series/Q87T, BIOS 0215 09/06/2013 > [ 201.293976] 0000000000000009 ffff8803f1d8fd28 ffffffff81746707 0000000000000000 > [ 201.294689] ffff8803f1d8fd60 ffffffff8106c93d ffff8803efc26478 ffff8800ce317100 > [ 201.295398] ffffc90005b9c1a0 ffff8800ce317168 ffff8803efc26320 ffff8803f1d8fd70 > [ 201.296109] Call Trace: > [ 201.296815] [<ffffffff81746707>] dump_stack+0x45/0x56 > [ 201.297524] [<ffffffff8106c93d>] warn_slowpath_common+0x7d/0xa0 > [ 201.298218] [<ffffffff8106ca1a>] warn_slowpath_null+0x1a/0x20 > [ 201.298891] [<ffffffffa0428103>] start_dma+0x153/0x160 [net2280] > [ 201.299554] [<ffffffffa0429b1b>] net2280_queue+0x2db/0x480 [net2280] > [ 201.300209] [<ffffffffa04724f1>] start_transfer.isra.32+0x71/0xe0 [usb_f_mass_storage] > [ 201.300851] [<ffffffffa047259e>] start_out_transfer+0x3e/0x80 [usb_f_mass_storage] > [ 201.301474] [<ffffffffa0473967>] fsg_main_thread+0x207/0x17f0 [usb_f_mass_storage] > [ 201.302069] [<ffffffff81749eda>] ? __schedule+0x37a/0x830 > [ 201.302607] [<ffffffffa0473760>] ? handle_exception+0x460/0x460 [usb_f_mass_storage] > [ 201.303200] [<ffffffff8108a3e2>] kthread+0xd2/0xf0 > [ 201.303776] [<ffffffff8108a310>] ? kthread_create_on_node+0x180/0x180 > [ 201.304328] [<ffffffff8174ecbc>] ret_from_fork+0x7c/0xb0 > [ 201.304973] [<ffffffff8108a310>] ? kthread_create_on_node+0x180/0x180 > [ 201.305486] ---[ end trace a7f3e86a1a37203b ]— > Followed by: > [ 263.311338] net2280 0000:01:00.0: The dmastat return = 5002!! > [ 263.409818] g_mass_storage gadget: super-speed config #1: Linux File-Backed Storage > > as long as you have ideas, I’ll be more than happy to try them :) > > Paul. > > On 25 Nov 2014, at 15:59, Ricardo Ribalda Delgado <ricardo.ribalda@xxxxxxxxx> wrote: > >> One last try :) >> >> Instead of: >> >> if (likely(t & BIT(FIFO_EMPTY))) { >> >> have this: >> >> if ( t & BIT(NAK_OUT_PACKETS)){ >> count = readl(&ep->dma->dmacount); >> count &= DMA_BYTE_COUNT_MASK; >> break; >> } >> >> if (likely(t & BIT(FIFO_EMPTY))) { >> >> >> >> On Tue, Nov 25, 2014 at 3:54 PM, Paul Jones <p.jones@xxxxxxxxxx> wrote: >>> Ricardo, >>> >>> it no longer locks up but if I try to write to the drive, I get cycles of: >>> [ 2334.127653] ------------[ cut here ]------------ >>> [ 2334.128318] WARNING: CPU: 0 PID: 2140 at drivers/usb/gadget/udc/net2280.c:816 start_dma+0x153/0x160 [net2280]() >>> [ 2334.129105] Modules linked in: g_mass_storage usb_f_mass_storage libcomposite configfs net2280 udc_core snd_hda_codec_hdmi i915 rfcomm bnep bluetooth snd_hda_codec_realtek snd_hda_codec_generic intel_rapl x86_pkg_temp_thermal snd_hda_intel intel_powerclamp coretemp snd_hda_controller kvm_intel snd_hda_codec kvm drm_kms_helper snd_hwdep snd_pcm drm snd_seq_midi joydev snd_seq_midi_event snd_rawmidi hid_generic snd_seq eeepc_wmi asus_wmi sparse_keymap crct10dif_pclmul usbhid crc32_pclmul ghash_clmulni_intel aesni_intel snd_seq_device snd_timer aes_x86_64 hid lrw gf128mul glue_helper snd ablk_helper mei_me mei cryptd serio_raw lpc_ich i2c_algo_bit wmi soundcore video tpm_infineon mac_hid parport_pc ppdev lp parport e1000e psmouse r8169 ahci ptp libahci mii pps_core >>> [ 2334.132731] CPU: 0 PID: 2140 Comm: file-storage Tainted: G W 3.17.0-rc5+ #2 >>> [ 2334.133438] Hardware name: ASUS All Series/Q87T, BIOS 0215 09/06/2013 >>> [ 2334.134146] 0000000000000009 ffff8804087a3d28 ffffffff81746707 0000000000000000 >>> [ 2334.134863] ffff8804087a3d60 ffffffff8106c93d ffff88002e693478 ffff8803efd14480 >>> [ 2334.135583] ffffc900018fc1a0 ffff8803efd144e8 ffff88002e693320 ffff8804087a3d70 >>> [ 2334.136299] Call Trace: >>> [ 2334.137023] [<ffffffff81746707>] dump_stack+0x45/0x56 >>> [ 2334.137734] [<ffffffff8106c93d>] warn_slowpath_common+0x7d/0xa0 >>> [ 2334.138433] [<ffffffff8106ca1a>] warn_slowpath_null+0x1a/0x20 >>> [ 2334.139109] [<ffffffffa0372103>] start_dma+0x153/0x160 [net2280] >>> [ 2334.139795] [<ffffffffa0373b1b>] net2280_queue+0x2db/0x480 [net2280] >>> [ 2334.140449] [<ffffffffa03b94f1>] start_transfer.isra.32+0x71/0xe0 [usb_f_mass_storage] >>> [ 2334.141128] [<ffffffffa03b959e>] start_out_transfer+0x3e/0x80 [usb_f_mass_storage] >>> [ 2334.141772] [<ffffffffa03ba967>] fsg_main_thread+0x207/0x17f0 [usb_f_mass_storage] >>> [ 2334.142374] [<ffffffff81749eda>] ? __schedule+0x37a/0x830 >>> [ 2334.142950] [<ffffffffa03ba760>] ? handle_exception+0x460/0x460 [usb_f_mass_storage] >>> [ 2334.143534] [<ffffffff8108a3e2>] kthread+0xd2/0xf0 >>> [ 2334.144054] [<ffffffff8108a310>] ? kthread_create_on_node+0x180/0x180 >>> [ 2334.144595] [<ffffffff8174ecbc>] ret_from_fork+0x7c/0xb0 >>> [ 2334.145155] [<ffffffff8108a310>] ? kthread_create_on_node+0x180/0x180 >>> [ 2334.145699] ---[ end trace 4ded8927b95f4eec ]--- >>> followed by: >>> [ 2396.154501] net2280 0000:01:00.0: The dmastat return = 5002!! >>> [ 2396.253653] g_mass_storage gadget: super-speed config #1: Linux File-Backed Storage >>> >>> Unplugging and re-plugging the USB cable does allow me to remount the volume. >>> >>> Paul. >>> On 25 Nov 2014, at 15:24, Ricardo Ribalda Delgado <ricardo.ribalda@xxxxxxxxx> wrote: >>> >>>> Could you try >>>> if (likely(t & (BIT(FIFO_EMPTY) | BIT(NAK_OUT_PACKETS)))){ >>>> >>>> instead of >>>> >>>> if (likely(t & BIT(FIFO_EMPTY))) >>>> >>>> >>>> And tell if it works better >>> >> >> >> >> -- >> Ricardo Ribalda >> -- >> 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 > -- 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