1. 22 3月, 2017 4 次提交
  2. 17 3月, 2017 1 次提交
  3. 06 3月, 2017 3 次提交
  4. 02 3月, 2017 2 次提交
  5. 25 1月, 2017 1 次提交
  6. 24 1月, 2017 10 次提交
  7. 14 1月, 2017 1 次提交
    • P
      locking/atomic, kref: Add kref_read() · 2c935bc5
      Peter Zijlstra 提交于
      Since we need to change the implementation, stop exposing internals.
      
      Provide kref_read() to read the current reference count; typically
      used for debug messages.
      
      Kills two anti-patterns:
      
      	atomic_read(&kref->refcount)
      	kref->refcount.counter
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      2c935bc5
  8. 12 1月, 2017 1 次提交
  9. 03 1月, 2017 1 次提交
  10. 02 1月, 2017 3 次提交
    • B
      usb: gadget: f_fs: Fix possibe deadlock · b3ce3ce0
      Baolin Wang 提交于
      When system try to close /dev/usb-ffs/adb/ep0 on one core, at the same
      time another core try to attach new UDC, which will cause deadlock as
      below scenario. Thus we should release ffs lock before issuing
      unregister_gadget_item().
      
      [   52.642225] c1 ======================================================
      [   52.642228] c1 [ INFO: possible circular locking dependency detected ]
      [   52.642236] c1 4.4.6+ #1 Tainted: G        W  O
      [   52.642241] c1 -------------------------------------------------------
      [   52.642245] c1 usb ffs open/2808 is trying to acquire lock:
      [   52.642270] c0  (udc_lock){+.+.+.}, at: [<ffffffc00065aeec>]
      		usb_gadget_unregister_driver+0x3c/0xc8
      [   52.642272] c1  but task is already holding lock:
      [   52.642283] c0  (ffs_lock){+.+.+.}, at: [<ffffffc00066b244>]
      		ffs_data_clear+0x30/0x140
      [   52.642285] c1 which lock already depends on the new lock.
      [   52.642287] c1
                     the existing dependency chain (in reverse order) is:
      [   52.642295] c0
      	       -> #1 (ffs_lock){+.+.+.}:
      [   52.642307] c0        [<ffffffc00012340c>] __lock_acquire+0x20f0/0x2238
      [   52.642314] c0        [<ffffffc000123b54>] lock_acquire+0xe4/0x298
      [   52.642322] c0        [<ffffffc000aaf6e8>] mutex_lock_nested+0x7c/0x3cc
      [   52.642328] c0        [<ffffffc00066f7bc>] ffs_func_bind+0x504/0x6e8
      [   52.642334] c0        [<ffffffc000654004>] usb_add_function+0x84/0x184
      [   52.642340] c0        [<ffffffc000658ca4>] configfs_composite_bind+0x264/0x39c
      [   52.642346] c0        [<ffffffc00065b348>] udc_bind_to_driver+0x58/0x11c
      [   52.642352] c0        [<ffffffc00065b49c>] usb_udc_attach_driver+0x90/0xc8
      [   52.642358] c0        [<ffffffc0006598e0>] gadget_dev_desc_UDC_store+0xd4/0x128
      [   52.642369] c0        [<ffffffc0002c14e8>] configfs_write_file+0xd0/0x13c
      [   52.642376] c0        [<ffffffc00023c054>] vfs_write+0xb8/0x214
      [   52.642381] c0        [<ffffffc00023cad4>] SyS_write+0x54/0xb0
      [   52.642388] c0        [<ffffffc000085ff0>] el0_svc_naked+0x24/0x28
      [   52.642395] c0
                    -> #0 (udc_lock){+.+.+.}:
      [   52.642401] c0        [<ffffffc00011e3d0>] print_circular_bug+0x84/0x2e4
      [   52.642407] c0        [<ffffffc000123454>] __lock_acquire+0x2138/0x2238
      [   52.642412] c0        [<ffffffc000123b54>] lock_acquire+0xe4/0x298
      [   52.642420] c0        [<ffffffc000aaf6e8>] mutex_lock_nested+0x7c/0x3cc
      [   52.642427] c0        [<ffffffc00065aeec>] usb_gadget_unregister_driver+0x3c/0xc8
      [   52.642432] c0        [<ffffffc00065995c>] unregister_gadget_item+0x28/0x44
      [   52.642439] c0        [<ffffffc00066b34c>] ffs_data_clear+0x138/0x140
      [   52.642444] c0        [<ffffffc00066b374>] ffs_data_reset+0x20/0x6c
      [   52.642450] c0        [<ffffffc00066efd0>] ffs_data_closed+0xac/0x12c
      [   52.642454] c0        [<ffffffc00066f070>] ffs_ep0_release+0x20/0x2c
      [   52.642460] c0        [<ffffffc00023dbe4>] __fput+0xb0/0x1f4
      [   52.642466] c0        [<ffffffc00023dd9c>] ____fput+0x20/0x2c
      [   52.642473] c0        [<ffffffc0000ee944>] task_work_run+0xb4/0xe8
      [   52.642482] c0        [<ffffffc0000cd45c>] do_exit+0x360/0xb9c
      [   52.642487] c0        [<ffffffc0000cf228>] do_group_exit+0x4c/0xb0
      [   52.642494] c0        [<ffffffc0000dd3c8>] get_signal+0x380/0x89c
      [   52.642501] c0        [<ffffffc00008a8f0>] do_signal+0x154/0x518
      [   52.642507] c0        [<ffffffc00008af00>] do_notify_resume+0x70/0x78
      [   52.642512] c0        [<ffffffc000085ee8>] work_pending+0x1c/0x20
      [   52.642514] c1
                    other info that might help us debug this:
      [   52.642517] c1  Possible unsafe locking scenario:
      [   52.642518] c1        CPU0                    CPU1
      [   52.642520] c1        ----                    ----
      [   52.642525] c0   lock(ffs_lock);
      [   52.642529] c0                                lock(udc_lock);
      [   52.642533] c0                                lock(ffs_lock);
      [   52.642537] c0   lock(udc_lock);
      [   52.642539] c1
                            *** DEADLOCK ***
      [   52.642543] c1 1 lock held by usb ffs open/2808:
      [   52.642555] c0  #0:  (ffs_lock){+.+.+.}, at: [<ffffffc00066b244>]
      		ffs_data_clear+0x30/0x140
      [   52.642557] c1 stack backtrace:
      [   52.642563] c1 CPU: 1 PID: 2808 Comm: usb ffs open Tainted: G
      [   52.642565] c1 Hardware name: Spreadtrum SP9860g Board (DT)
      [   52.642568] c1 Call trace:
      [   52.642573] c1 [<ffffffc00008b430>] dump_backtrace+0x0/0x170
      [   52.642577] c1 [<ffffffc00008b5c0>] show_stack+0x20/0x28
      [   52.642583] c1 [<ffffffc000422694>] dump_stack+0xa8/0xe0
      [   52.642587] c1 [<ffffffc00011e548>] print_circular_bug+0x1fc/0x2e4
      [   52.642591] c1 [<ffffffc000123454>] __lock_acquire+0x2138/0x2238
      [   52.642595] c1 [<ffffffc000123b54>] lock_acquire+0xe4/0x298
      [   52.642599] c1 [<ffffffc000aaf6e8>] mutex_lock_nested+0x7c/0x3cc
      [   52.642604] c1 [<ffffffc00065aeec>] usb_gadget_unregister_driver+0x3c/0xc8
      [   52.642608] c1 [<ffffffc00065995c>] unregister_gadget_item+0x28/0x44
      [   52.642613] c1 [<ffffffc00066b34c>] ffs_data_clear+0x138/0x140
      [   52.642618] c1 [<ffffffc00066b374>] ffs_data_reset+0x20/0x6c
      [   52.642621] c1 [<ffffffc00066efd0>] ffs_data_closed+0xac/0x12c
      [   52.642625] c1 [<ffffffc00066f070>] ffs_ep0_release+0x20/0x2c
      [   52.642629] c1 [<ffffffc00023dbe4>] __fput+0xb0/0x1f4
      [   52.642633] c1 [<ffffffc00023dd9c>] ____fput+0x20/0x2c
      [   52.642636] c1 [<ffffffc0000ee944>] task_work_run+0xb4/0xe8
      [   52.642640] c1 [<ffffffc0000cd45c>] do_exit+0x360/0xb9c
      [   52.642644] c1 [<ffffffc0000cf228>] do_group_exit+0x4c/0xb0
      [   52.642647] c1 [<ffffffc0000dd3c8>] get_signal+0x380/0x89c
      [   52.642651] c1 [<ffffffc00008a8f0>] do_signal+0x154/0x518
      [   52.642656] c1 [<ffffffc00008af00>] do_notify_resume+0x70/0x78
      [   52.642659] c1 [<ffffffc000085ee8>] work_pending+0x1c/0x20
      Acked-by: NMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: NBaolin Wang <baolin.wang@linaro.org>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      b3ce3ce0
    • V
      usb: gadget: f_fs: Fix ExtCompat descriptor validation · 354bc45b
      Vincent Pelletier 提交于
      Reserved1 is documented as expected to be set to 0, but this test fails
      when it it set to 0. Reverse the condition.
      Signed-off-by: NVincent Pelletier <plr.vincent@gmail.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      354bc45b
    • V
      usb: gadget: f_fs: Document eventfd effect on descriptor format. · 96a420d2
      Vincent Pelletier 提交于
      When FUNCTIONFS_EVENTFD flag is set, __ffs_data_got_descs reads a 32bits,
      little-endian value right after the fixed structure header, and passes it
      to eventfd_ctx_fdget. Document this.
      
      Also, rephrase a comment to be affirmative about the role of string
      descriptor at index 0. Ref: USB 2.0 spec paragraph "9.6.7 String", and
      also checked to still be current in USB 3.0 spec paragraph "9.6.9 String".
      Signed-off-by: NVincent Pelletier <plr.vincent@gmail.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      96a420d2
  11. 26 12月, 2016 1 次提交
    • T
      ktime: Cleanup ktime_set() usage · 8b0e1953
      Thomas Gleixner 提交于
      ktime_set(S,N) was required for the timespec storage type and is still
      useful for situations where a Seconds and Nanoseconds part of a time value
      needs to be converted. For anything where the Seconds argument is 0, this
      is pointless and can be replaced with a simple assignment.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      8b0e1953
  12. 15 12月, 2016 1 次提交
  13. 10 12月, 2016 1 次提交
  14. 06 12月, 2016 1 次提交
    • A
      [iov_iter] new primitives - copy_from_iter_full() and friends · cbbd26b8
      Al Viro 提交于
      copy_from_iter_full(), copy_from_iter_full_nocache() and
      csum_and_copy_from_iter_full() - counterparts of copy_from_iter()
      et.al., advancing iterator only in case of successful full copy
      and returning whether it had been successful or not.
      
      Convert some obvious users.  *NOTE* - do not blindly assume that
      something is a good candidate for those unless you are sure that
      not advancing iov_iter in failure case is the right thing in
      this case.  Anything that does short read/short write kind of
      stuff (or is in a loop, etc.) is unlikely to be a good one.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      cbbd26b8
  15. 01 12月, 2016 1 次提交
    • A
      fs: configfs: don't return anything from drop_link · e16769d4
      Andrzej Pietrasiewicz 提交于
      Documentation/filesystems/configfs/configfs.txt says:
      
      "When unlink(2) is called on the symbolic link, the source item is
      notified via the ->drop_link() method.  Like the ->drop_item() method,
      this is a void function and cannot return failure."
      
      The ->drop_item() is indeed a void function, the ->drop_link() is
      actually not. This, together with the fact that the value of ->drop_link()
      is silently ignored suggests, that it is the ->drop_link() return
      type that should be corrected and changed to void.
      
      This patch changes drop_link() signature and all its users.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      [hch: reverted reformatting of some code]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      e16769d4
  16. 18 11月, 2016 4 次提交
    • F
      usb: gadget: serial: fix possible Oops caused by calling kthread_stop(NULL) · d5c024f3
      Felix Hädicke 提交于
      Add check for NULL before calling kthread_stop().
      
      There were cases in which gserial_console_exit() was called, but the
      console thread was not started. This resulted in an invalid
      kthread_stop(NULL) call.
      
      Without this, the following Oops may occur:
      
          BUG: unable to handle kernel
          NULL pointer dereference at 0000000000000018
          IP: [<ffffffffb3ca1166>] kthread_stop+0x16/0x110
          ...
          CPU: 2 PID: 853 Comm: rmmod Not tainted 4.9.0-rc5 #3
          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: ffff880419f6a100 task.stack: ffffc90002e8c000
          RIP: 0010:[<ffffffffb3ca1166>]  [<ffffffffb3ca1166>] kthread_stop+0x16/0x110
          RSP: 0018:ffffc90002e8fdb0  EFLAGS: 00010286
          RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000000
          RDX: 0000000000000001 RSI: 0000000000000246 RDI: 0000000000000000
          RBP: ffffc90002e8fdc8 R08: 0000000000000000 R09: 0000000000000001
          R10: 000000000000019d R11: 000000000000001f R12: 0000000000000000
          R13: ffff88041b8d8400 R14: 0000000000000001 R15: 000055fd59f5a1e0
          FS:  00007f82500be700(0000) GS:ffff88042f280000(0000) knlGS:0000000000000000
          CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
          CR2: 0000000000000018 CR3: 000000041bee2000 CR4: 00000000001406e0
          Stack:
           0000000000000000 ffffffffc0b8e720 ffff88041b8d8400 ffffc90002e8fdf0
           ffffffffc0b8bb52 ffff88041a106300 0000000000000001 ffff880419fc2ea8
           ffffc90002e8fe08 ffffffffc0aed749 ffffffffc0aef600 ffffc90002e8fe20
          Call Trace:
           [<ffffffffc0b8bb52>] gserial_free_line+0x72/0xb0 [u_serial]
           [<ffffffffc0aed749>] acm_free_instance+0x19/0x30 [usb_f_acm]
           [<ffffffffc0b01b40>] usb_put_function_instance+0x20/0x30 [libcomposite]
           [<ffffffffc04a603b>] gs_unbind+0x3b/0x70 [g_serial]
           [<ffffffffc0b018d1>] __composite_unbind+0x61/0xb0 [libcomposite]
           [<ffffffffc0b01933>] composite_unbind+0x13/0x20 [libcomposite]
           [<ffffffffc08ef1ad>] usb_gadget_remove_driver+0x3d/0x90 [udc_core]
           [<ffffffffc08ef26e>] usb_gadget_unregister_driver+0x6e/0xc0 [udc_core]
           [<ffffffffc0aff6d2>] usb_composite_unregister+0x12/0x20 [libcomposite]
           [<ffffffffc04a6268>] cleanup+0x10/0xda8 [g_serial]
           [<ffffffffb3d0c0c2>] SyS_delete_module+0x192/0x270
           [<ffffffffb3c032a0>] ? exit_to_usermode_loop+0x90/0xb0
           [<ffffffffb4228a3b>] entry_SYSCALL_64_fastpath+0x1e/0xad
          Code: 89 c6 e8 6e ff ff ff 48 89 df e8 06 bd fd ff 5b 5d c3 0f 1f 00 0f 1f 44 00 00 55 48 89 e5 41 55 41 54 49 89 fc 53 0f 1f 44 00 00 <f0> 41 ff 44 24 18 4c 89 e7 e8 bc f1 ff ff 48 85 c0 48 89 c3 74
          RIP  [<ffffffffb3ca1166>] kthread_stop+0x16/0x110
           RSP <ffffc90002e8fdb0>
          CR2: 0000000000000018
          ---[ end trace 5b3336a407e1698c ]---
      Signed-off-by: NFelix Hädicke <felixhaedicke@web.de>
      Tested-by: NPeter Chen <peter.chen@nxp.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      d5c024f3
    • A
      usb: gadget: Fix checkpatch error for braces · 97f0117b
      Anson Jacob 提交于
      Fix error message by checkpath.pl
      open brace '{' following struct/enum go on the same line
      
      Patch applied by running fix inplace capability of checkpatch:
      checkpatch.pl -f *.[ch] --types OPEN_BRACE --fix-inplace
      Signed-off-by: NAnson Jacob <ansonjacob.aj@gmail.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      97f0117b
    • P
      usb: gadget: f_uac2: fix error handling at afunc_bind · f1d3861d
      Peter Chen 提交于
      The current error handling flow uses incorrect goto label, fix it
      
      Cc: <stable@vger.kernel.org>
      Fixes: d12a8727 ("usb: gadget: function: Remove
      	redundant usb_free_all_descriptors")
      Signed-off-by: NPeter Chen <peter.chen@nxp.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      f1d3861d
    • F
      usb: gadget: f_fs: fix wrong parenthesis in ffs_func_req_match() · 05e78c69
      Felix Hädicke 提交于
      Properly check the return code of ffs_func_revmap_intf() and
      ffs_func_revmap_ep() for a non-negative value.
      
      Instead of checking the return code, the comparison was performed for the last
      parameter of the function calls, because of wrong parenthesis.
      
      This also fixes the following static checker warning:
      drivers/usb/gadget/function/f_fs.c:3152 ffs_func_req_match()
      warn: always true condition '(((creq->wIndex)) >= 0) => (0-u16max >= 0)'
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NFelix Hädicke <felixhaedicke@web.de>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      05e78c69
  17. 08 11月, 2016 1 次提交
  18. 03 11月, 2016 3 次提交