1. 13 6月, 2017 2 次提交
  2. 02 6月, 2017 1 次提交
  3. 17 5月, 2017 1 次提交
  4. 11 4月, 2017 1 次提交
  5. 24 1月, 2017 1 次提交
    • K
      usb: gadget: udc-core: Rescan pending list on driver unbind · 8236800d
      Krzysztof Opasiak 提交于
      Since:
      
      commit 855ed04a ("usb: gadget: udc-core: independent registration
      of gadgets and gadget drivers")
      
      if we load gadget module but there is no free udc available
      then it will be stored on a pending gadgets list.
      
      $ modprobe g_zero.ko
      $ modprobe g_ether.ko
      [] udc-core: couldn't find an available UDC - added [g_ether] to list
      of pending drivers
      
      We scan this list each time when new UDC appears in system.
      But we can get a free UDC each time after gadget unbind.
      This commit add scanning of that list directly after unbinding
      gadget from udc.
      
      Thanks to this, when we unload first gadget:
      
      $ rmmod g_zero.ko
      
      gadget which is pending is automatically
      attached to that UDC (if name matches).
      
      Fixes: 855ed04a  ("usb: gadget: udc-core: independent registration of gadgets and gadget drivers")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NKrzysztof Opasiak <k.opasiak@samsung.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      8236800d
  6. 02 1月, 2017 1 次提交
    • F
      usb: gadget: udc: core: fix return code of usb_gadget_probe_driver() · 7b017381
      Felix Hädicke 提交于
      This fixes a regression which was introduced by commit f1bddbb3, by
      reverting a small fragment of commit 855ed04a.
      
      If the following conditions were met, usb_gadget_probe_driver() returned
      0, although the call was unsuccessful:
      1. A particular UDC was specified by thge gadget driver (using member
      "udc_name" of struct usb_gadget_driver).
      2. The UDC with this name is available.
      3. Another gadget driver is already bound to this gadget.
      4. The gadget driver has the "match_existing_only" flag set.
      In this case, the return code variable "ret" is set to 0, the return
      code of a strcmp() call (to check for the second condition).
      
      This also fixes an oops which could occur in the following scenario:
      1. Two usb gadget instances were configured using configfs.
      2. The first gadget configuration was bound to a UDC (using the configfs
      attribute "UDC").
      3. It was tried to bind the second gadget configuration to the same UDC
      in the same way. This operation was then wrongly reported as being
      successful.
      4. The second gadget configuration's "UDC" attribute is cleared, to
      unbind the (not really bound) second gadget configuration from the UDC.
      
      <BUG: unable to handle kernel NULL pointer dereference
      at           (null)
      IP: [<ffffffff94f5e5e9>] __list_del_entry+0x29/0xc0
      PGD 41b4c5067
      PUD 41a598067
      PMD 0
      
      Oops: 0000 [#1] SMP
      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
      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]
      CPU: 5 PID: 829 Comm: bash Not tainted 4.9.0-rc7 #1
      Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./Z77
      Extreme3, BIOS P1.50 07/11/2013
      task: ffff880419ce4040 task.stack: ffffc90002ed4000
      RIP: 0010:[<ffffffff94f5e5e9>]  [<ffffffff94f5e5e9>]
      __list_del_entry+0x29/0xc0
      RSP: 0018:ffffc90002ed7d68  EFLAGS: 00010207
      RAX: 0000000000000000 RBX: ffff88041787ec30 RCX: dead000000000200
      RDX: 0000000000000000 RSI: ffff880417482002 RDI: ffff88041787ec30
      RBP: ffffc90002ed7d68 R08: 0000000000000000 R09: 0000000000000010
      R10: 0000000000000000 R11: ffff880419ce4040 R12: ffff88041787eb68
      R13: ffff88041787eaa8 R14: ffff88041560a2c0 R15: 0000000000000001
      FS:  00007fe4e49b8700(0000) GS:ffff88042f340000(0000)
      knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000000 CR3: 000000041b4c4000 CR4: 00000000001406e0
      Stack:
      ffffc90002ed7d80 ffffffff94f5e68d ffffffffc0ae5ef0 ffffc90002ed7da0
      ffffffffc0ae22aa ffff88041787e800 ffff88041787e800 ffffc90002ed7dc0
      ffffffffc0d7a727 ffffffff952273fa ffff88041aba5760 ffffc90002ed7df8
      Call Trace:
      [<ffffffff94f5e68d>] list_del+0xd/0x30
      [<ffffffffc0ae22aa>] usb_gadget_unregister_driver+0xaa/0xc0 [udc_core]
      [<ffffffffc0d7a727>] unregister_gadget+0x27/0x60 [libcomposite]
      [<ffffffff952273fa>] ? mutex_lock+0x1a/0x30
      [<ffffffffc0d7a9b8>] gadget_dev_desc_UDC_store+0x88/0xe0 [libcomposite]
      [<ffffffffc0af8aa0>] configfs_write_file+0xa0/0x100 [configfs]
      [<ffffffff94e10d27>] __vfs_write+0x37/0x160
      [<ffffffff94e31430>] ? __fd_install+0x30/0xd0
      [<ffffffff95229dae>] ? _raw_spin_unlock+0xe/0x10
      [<ffffffff94e11458>] vfs_write+0xb8/0x1b0
      [<ffffffff94e128f8>] SyS_write+0x58/0xc0
      [<ffffffff94e31594>] ? __close_fd+0x94/0xc0
      [<ffffffff9522a0fb>] entry_SYSCALL_64_fastpath+0x1e/0xad
      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
      RIP  [<ffffffff94f5e5e9>] __list_del_entry+0x29/0xc0
      RSP <ffffc90002ed7d68>
      CR2: 0000000000000000
      ---[ end trace 99fc090ab3ff6cbc ]---
      
      Fixes: f1bddbb3 ("usb: gadget: Fix binding to UDC via configfs
      interface")
      Signed-off-by: NFelix Hädicke <felixhaedicke@web.de>
      Tested-by: NKrzysztof Opasiak <k.opasiak@samsung.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      7b017381
  7. 25 8月, 2016 2 次提交
  8. 11 8月, 2016 1 次提交
  9. 21 6月, 2016 2 次提交
  10. 31 5月, 2016 1 次提交
  11. 19 4月, 2016 2 次提交
  12. 06 4月, 2016 1 次提交
  13. 04 3月, 2016 1 次提交
  14. 23 2月, 2016 1 次提交
  15. 17 12月, 2015 3 次提交
  16. 06 8月, 2015 2 次提交
  17. 03 8月, 2015 1 次提交
  18. 21 7月, 2015 1 次提交
  19. 20 3月, 2015 2 次提交
  20. 30 1月, 2015 1 次提交
  21. 04 11月, 2014 5 次提交
  22. 23 10月, 2014 1 次提交
    • F
      usb: gadget: udc: core: fix kernel oops with soft-connect · bfa6b18c
      Felipe Balbi 提交于
      Currently, there's no guarantee that udc->driver
      will be valid when using soft_connect sysfs
      interface. In fact, we can very easily trigger
      a NULL pointer dereference by trying to disconnect
      when a gadget driver isn't loaded.
      
      Fix this bug:
      
      ~# echo disconnect > soft_connect
      [   33.685743] Unable to handle kernel NULL pointer dereference at virtual address 00000014
      [   33.694221] pgd = ed0cc000
      [   33.697174] [00000014] *pgd=ae351831, *pte=00000000, *ppte=00000000
      [   33.703766] Internal error: Oops: 17 [#1] SMP ARM
      [   33.708697] Modules linked in: xhci_plat_hcd xhci_hcd snd_soc_davinci_mcasp snd_soc_tlv320aic3x snd_soc_edma snd_soc_omap snd_soc_evm snd_soc_core dwc3 snd_compress snd_pcm_dmaengine snd_pcm snd_timer snd lis3lv02d_i2c matrix_keypad lis3lv02d dwc3_omap input_polldev soundcore
      [   33.734372] CPU: 0 PID: 1457 Comm: bash Not tainted 3.17.0-09740-ga93416e-dirty #345
      [   33.742457] task: ee71ce00 ti: ee68a000 task.ti: ee68a000
      [   33.748116] PC is at usb_udc_softconn_store+0xa4/0xec
      [   33.753416] LR is at mark_held_locks+0x78/0x90
      [   33.758057] pc : [<c04df128>]    lr : [<c00896a4>]    psr: 20000013
      [   33.758057] sp : ee68bec8  ip : c0c00008  fp : ee68bee4
      [   33.770050] r10: ee6b394c  r9 : ee68bf80  r8 : ee6062c0
      [   33.775508] r7 : 00000000  r6 : ee6062c0  r5 : 0000000b  r4 : ee739408
      [   33.782346] r3 : 00000000  r2 : 00000000  r1 : ee71d390  r0 : ee664170
      [   33.789168] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      [   33.796636] Control: 10c5387d  Table: ad0cc059  DAC: 00000015
      [   33.802638] Process bash (pid: 1457, stack limit = 0xee68a248)
      [   33.808740] Stack: (0xee68bec8 to 0xee68c000)
      [   33.813299] bec0:                   0000000b c0411284 ee6062c0 00000000 ee68bef4 ee68bee8
      [   33.821862] bee0: c04112ac c04df090 ee68bf14 ee68bef8 c01c2868 c0411290 0000000b ee6b3940
      [   33.830419] bf00: 00000000 00000000 ee68bf4c ee68bf18 c01c1a24 c01c2818 00000000 00000000
      [   33.838990] bf20: ee61b940 ee2f47c0 0000000b 000ce408 ee68bf80 c000f304 ee68a000 00000000
      [   33.847544] bf40: ee68bf7c ee68bf50 c0152dd8 c01c1960 ee68bf7c c0170af8 ee68bf7c ee2f47c0
      [   33.856099] bf60: ee2f47c0 000ce408 0000000b c000f304 ee68bfa4 ee68bf80 c0153330 c0152d34
      [   33.864653] bf80: 00000000 00000000 0000000b 000ce408 b6e7fb50 00000004 00000000 ee68bfa8
      [   33.873204] bfa0: c000f080 c01532e8 0000000b 000ce408 00000001 000ce408 0000000b 00000000
      [   33.881763] bfc0: 0000000b 000ce408 b6e7fb50 00000004 0000000b 00000000 000c5758 00000000
      [   33.890319] bfe0: 00000000 bec2c924 b6de422d b6e1d226 40000030 00000001 75716d2f 00657565
      [   33.898890] [<c04df128>] (usb_udc_softconn_store) from [<c04112ac>] (dev_attr_store+0x28/0x34)
      [   33.907920] [<c04112ac>] (dev_attr_store) from [<c01c2868>] (sysfs_kf_write+0x5c/0x60)
      [   33.916200] [<c01c2868>] (sysfs_kf_write) from [<c01c1a24>] (kernfs_fop_write+0xd0/0x194)
      [   33.924773] [<c01c1a24>] (kernfs_fop_write) from [<c0152dd8>] (vfs_write+0xb0/0x1bc)
      [   33.932874] [<c0152dd8>] (vfs_write) from [<c0153330>] (SyS_write+0x54/0xb0)
      [   33.940247] [<c0153330>] (SyS_write) from [<c000f080>] (ret_fast_syscall+0x0/0x48)
      [   33.948160] Code: e1a01007 e12fff33 e5140004 e5143008 (e5933014)
      [   33.954625] ---[ end trace f849bead94eab7ea ]---
      
      Fixes: 2ccea03a (usb: gadget: introduce UDC Class)
      Cc: <stable@vger.kernel.org> # v3.1+
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      bfa6b18c
  23. 25 9月, 2014 2 次提交
  24. 16 9月, 2014 1 次提交
  25. 12 9月, 2014 1 次提交
  26. 17 7月, 2014 1 次提交
  27. 13 5月, 2014 1 次提交