Hello, in 4.8.11 and 4.9-rc7, I get an Oops (see below), when I try to activate and afterward deactivate a second gadget configfs configuration, like this:
mkdir /sys/kernel/config/usb_gadget/acm cd /sys/kernel/config/usb_gadget/acm echo 0x0200 > bcdUSB echo 0x0525 > idVendor echo 0xa4a7 > idProduct echo 0x03 > bDeviceClass mkdir functions/acm.1 mkdir configs/c.2 ln -s functions/acm.1/ configs/c.2 echo dummy_udc.0 > UDC mkdir /sys/kernel/config/usb_gadget/gser cd /sys/kernel/config/usb_gadget/gser echo 0x0525 > idVendor echo 0xa4a6 > idProduct echo 0xff > bDeviceClass mkdir functions/gser.1 mkdir configs/c.1 ln -s functions/gser.1/ configs/c.1 echo dummy_udc.0 > UDC echo > UDC I had expected that writing "dummy_udc.0" to /sys/kernel/config/usb_gadget/gser/UDC would fail, because the UDC is already bound to another gadget configuration (/sys/kernel/config/usb_gadget/acm/UDC). However, this doesn't give me an error, but the ACM configuration remains active. The same happens when using a real UDC (PLX3380 via driver net2280 in my case) instead of dummy_hcd. [ 600.276226] <BUG: unable to handle kernel NULL pointer dereference at (null) [ 600.276841] IP: [<ffffffff94f5e5e9>] __list_del_entry+0x29/0xc0 [ 600.277450] PGD 41b4c5067 [ 600.277455] PUD 41a598067 [ 600.278063] PMD 0 [ 600.278680] Oops: 0000 [#1] SMP [ 600.279297] Modules linked in: cdc_acm usb_f_fs usb_f_serial usb_f_acm u_serial libcomposite configfs dummy_hcd bnep intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm snd_hda_codec_hdmi irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd snd_hda_codec_realtek snd_hda_codec_generic serio_raw uvcvideo videobuf2_vmalloc btusb snd_usb_audio snd_hda_intel videobuf2_memops btrtl snd_hda_codec snd_hda_core snd_usbmidi_lib btbcm videobuf2_v4l2 btintel snd_hwdep videobuf2_core snd_seq_midi bluetooth snd_seq_midi_event videodev xpad efi_pstore snd_pcm_oss rfkill joydev media crc16 ff_memless snd_mixer_oss snd_rawmidi nls_ascii snd_pcm snd_seq snd_seq_device nls_cp437 mei_me snd_timer vfat sg udc_core lpc_ich fat [ 600.280153] efivars mfd_core mei snd soundcore battery nuvoton_cir rc_core evdev intel_smartconnect ie31200_edac edac_core shpchp tpm_tis tpm_tis_core tpm parport_pc ppdev lp parport efivarfs autofs4 btrfs xor raid6_pq hid_logitech_hidpp hid_logitech_dj hid_generic usbhid hid uas usb_storage sr_mod cdrom sd_mod ahci libahci nouveau i915 crc32c_intel i2c_algo_bit psmouse ttm xhci_pci libata scsi_mod ehci_pci drm_kms_helper xhci_hcd ehci_hcd r8169 mii usbcore drm nvme nvme_core fjes button [last unloaded: net2280] [ 600.281688] CPU: 5 PID: 829 Comm: bash Not tainted 4.9.0-rc7 #1 [ 600.282424] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./Z77 Extreme3, BIOS P1.50 07/11/2013 [ 600.283163] task: ffff880419ce4040 task.stack: ffffc90002ed4000 [ 600.283910] RIP: 0010:[<ffffffff94f5e5e9>] [<ffffffff94f5e5e9>] __list_del_entry+0x29/0xc0 [ 600.284668] RSP: 0018:ffffc90002ed7d68 EFLAGS: 00010207 [ 600.285426] RAX: 0000000000000000 RBX: ffff88041787ec30 RCX: dead000000000200 [ 600.286192] RDX: 0000000000000000 RSI: ffff880417482002 RDI: ffff88041787ec30 [ 600.286955] RBP: ffffc90002ed7d68 R08: 0000000000000000 R09: 0000000000000010 [ 600.287728] R10: 0000000000000000 R11: ffff880419ce4040 R12: ffff88041787eb68 [ 600.288513] R13: ffff88041787eaa8 R14: ffff88041560a2c0 R15: 0000000000000001 [ 600.289300] FS: 00007fe4e49b8700(0000) GS:ffff88042f340000(0000) knlGS:0000000000000000 [ 600.290097] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 600.290893] CR2: 0000000000000000 CR3: 000000041b4c4000 CR4: 00000000001406e0 [ 600.291696] Stack: [ 600.292504] ffffc90002ed7d80 ffffffff94f5e68d ffffffffc0ae5ef0 ffffc90002ed7da0 [ 600.293327] ffffffffc0ae22aa ffff88041787e800 ffff88041787e800 ffffc90002ed7dc0 [ 600.294153] ffffffffc0d7a727 ffffffff952273fa ffff88041aba5760 ffffc90002ed7df8 [ 600.294985] Call Trace: [ 600.295809] [<ffffffff94f5e68d>] list_del+0xd/0x30 [ 600.296653] [<ffffffffc0ae22aa>] usb_gadget_unregister_driver+0xaa/0xc0 [udc_core] [ 600.297496] [<ffffffffc0d7a727>] unregister_gadget+0x27/0x60 [libcomposite] [ 600.298342] [<ffffffff952273fa>] ? mutex_lock+0x1a/0x30 [ 600.299188] [<ffffffffc0d7a9b8>] gadget_dev_desc_UDC_store+0x88/0xe0 [libcomposite] [ 600.300046] [<ffffffffc0af8aa0>] configfs_write_file+0xa0/0x100 [configfs] [ 600.300904] [<ffffffff94e10d27>] __vfs_write+0x37/0x160 [ 600.301761] [<ffffffff94e31430>] ? __fd_install+0x30/0xd0 [ 600.302627] [<ffffffff95229dae>] ? _raw_spin_unlock+0xe/0x10 [ 600.303494] [<ffffffff94e11458>] vfs_write+0xb8/0x1b0 [ 600.304364] [<ffffffff94e128f8>] SyS_write+0x58/0xc0 [ 600.305228] [<ffffffff94e31594>] ? __close_fd+0x94/0xc0 [ 600.306103] [<ffffffff9522a0fb>] entry_SYSCALL_64_fastpath+0x1e/0xad [ 600.306980] Code: 66 90 55 48 8b 07 48 b9 00 01 00 00 00 00 ad de 48 8b 57 08 48 89 e5 48 39 c8 74 29 48 b9 00 02 00 00 00 00 ad de 48 39 ca 74 3a <4c> 8b 02 4c 39 c7 75 52 4c 8b 40 08 4c 39 c7 75 66 48 89 50 08 [ 600.308031] RIP [<ffffffff94f5e5e9>] __list_del_entry+0x29/0xc0 [ 600.308960] RSP <ffffc90002ed7d68> [ 600.309880] CR2: 0000000000000000 [ 600.310845] ---[ end trace 99fc090ab3ff6cbc ]--- -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html