1. 17 Dec, 2018 1 commit
    • Marek Szyprowski's avatar
      usb: gadget: u_ether: fix unsafe list iteration · b641ee14
      Marek Szyprowski authored
      [ Upstream commit c9287fa6 ]
      
      list_for_each_entry_safe() is not safe for deleting entries from the
      list if the spin lock, which protects it, is released and reacquired during
      the list iteration. Fix this issue by replacing this construction with
      a simple check if list is empty and removing the first entry in each
      iteration. This is almost equivalent to a revert of the commit mentioned in
      the Fixes: tag.
      
      This patch fixes following issue:
      --->8---
      Unable to handle kernel NULL pointer dereference at virtual address 00000104
      pgd = (ptrval)
      [00000104] *pgd=00000000
      Internal error: Oops: 817 [#1] PREEMPT SMP ARM
      Modules linked in:
      CPU: 1 PID: 84 Comm: kworker/1:1 Not tainted 4.20.0-rc2-next-20181114-00009-g8266b35ec404 #1061
      Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
      Workqueue: events eth_work
      PC is at rx_fill+0x60/0xac
      LR is at _raw_spin_lock_irqsave+0x50/0x5c
      pc : [<c065fee0>]    lr : [<c0a056b8>]    psr: 80000093
      sp : ee7fbee8  ip : 00000100  fp : 00000000
      r10: 006000c0  r9 : c10b0ab0  r8 : ee7eb5c0
      r7 : ee7eb614  r6 : ee7eb5ec  r5 : 000000dc  r4 : ee12ac00
      r3 : ee12ac24  r2 : 00000200  r1 : 60000013  r0 : ee7eb5ec
      Flags: Nzcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment none
      Control: 10c5387d  Table: 6d5dc04a  DAC: 00000051
      Process kworker/1:1 (pid: 84, stack limit = 0x(ptrval))
      Stack: (0xee7fbee8 to 0xee7fc000)
      ...
      [<c065fee0>] (rx_fill) from [<c0143b7c>] (process_one_work+0x200/0x738)
      [<c0143b7c>] (process_one_work) from [<c0144118>] (worker_thread+0x2c/0x4c8)
      [<c0144118>] (worker_thread) from [<c014a8a4>] (kthread+0x128/0x164)
      [<c014a8a4>] (kthread) from [<c01010b4>] (ret_from_fork+0x14/0x20)
      Exception stack(0xee7fbfb0 to 0xee7fbff8)
      ...
      ---[ end trace 64480bc835eba7d6 ]---
      
      Fixes: fea14e68
      
       ("usb: gadget: u_ether: use better list accessors")
      Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      b641ee14
  2. 18 Aug, 2017 1 commit
  3. 11 Apr, 2017 2 commits
  4. 24 Jan, 2017 1 commit
  5. 03 Nov, 2016 2 commits
  6. 01 Nov, 2016 1 commit
  7. 20 Oct, 2016 1 commit
    • Jarod Wilson's avatar
      net: use core MTU range checking in misc drivers · b3e3893e
      Jarod Wilson authored
      firewire-net:
      - set min/max_mtu
      - remove fwnet_change_mtu
      
      nes:
      - set max_mtu
      - clean up nes_netdev_change_mtu
      
      xpnet:
      - set min/max_mtu
      - remove xpnet_dev_change_mtu
      
      hippi:
      - set min/max_mtu
      - remove hippi_change_mtu
      
      batman-adv:
      - set max_mtu
      - remove batadv_interface_change_mtu
      - initialization is a little async, not 100% certain that max_mtu is set
        in the optimal place, don't have hardware to test with
      
      rionet:
      - set min/max_mtu
      - remove rionet_change_mtu
      
      slip:
      - set min/max_mtu
      - streamline sl_change_mtu
      
      um/net_kern:
      - remove pointless ndo_change_mtu
      
      hsi/clients/ssi_protocol:
      - use core MTU range checking
      - remove now redundant ssip_pn_set_mtu
      
      ipoib:
      - set a default max MTU value
      - Note: ipoib's actual max MTU can vary, depending on if the device is in
        connected mode or not, so we'll just set the max_mtu value to the max
        possible, and let the ndo_change_mtu function continue to validate any new
        MTU change requests with checks for CM or not...
      b3e3893e
  8. 17 Oct, 2016 1 commit
  9. 19 Sep, 2016 1 commit
  10. 09 Sep, 2016 2 commits
  11. 31 Aug, 2016 1 commit
  12. 11 Aug, 2016 1 commit
  13. 04 May, 2016 1 commit
  14. 16 Dec, 2015 1 commit
    • Mike Looijmans's avatar
      usb: gadget: ether: Allow changing the MTU · ab738ff1
      Mike Looijmans authored
      The gadget ethernet driver supports changing the MTU, but only allows this
      when the USB cable is removed. The comment indicates that this is because
      the "peer won't know". Even if the network link is still down and only the
      USB link is established, the driver won't allow the change.
      
      Other network interfaces allow changing the MTU any time, and don't force
      the link to be disabled. This makes perfect sense, because in order to be
      able to negotiate the MTU, the link needs to be up.
      
      Remove the restriction so that it is now actually possible to change the
      MTU (e.g. using "ifconfig usb0 mtu 15000") without having to manually pull
      the plug or change the driver's default setting.
      
      This is especially important after commit bba787a8
      
      
      ("usb: gadget: ether: Allow jumbo frames")
      Signed-off-by: default avatarMike Looijmans <mike.looijmans@topic.nl>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      ab738ff1
  15. 27 Sep, 2015 2 commits
    • Robert Baldyga's avatar
      usb: gadget: u_ether: eliminate abuse of ep->driver data · 6e4bfc54
      Robert Baldyga authored
      
      
      Since ep->driver_data is not used for endpoint claiming, neither for
      enabled/disabled state storing, we can reduce number of places where
      we read or modify it's value, as now it has no particular meaning for
      function or framework logic.
      
      In case of u_ether we only need to store in ep->driver_data pointer to
      struct eth_dev, as it's used in rx_complete() and tx_complete() callbacks.
      All other uses of ep->driver_data are now meaningless and can be safely
      removed.
      Signed-off-by: default avatarRobert Baldyga <r.baldyga@samsung.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      6e4bfc54
    • Mike Looijmans's avatar
      usb: gadget: ether: Allow jumbo frames · bba787a8
      Mike Looijmans authored
      
      
      USB network adapters support Jumbo frames. The only thing blocking
      that feature is the code in the gadget driver that disposes of
      packets larger than 1518 bytes, and the limit on the ioctl to set
      the mtu.
      
      This patch relaxes these limits, and allows up to 15k frames sizes.
      The 15k value was chosen because 16k does not work on all platforms,
      and usingclose to 16k will result in allocating 5 or 8 4k pages to
      store the skb, wasting pages at no measurable performance gain.
      
      On a topic-miami board (Zynq-7000), iperf3 performance reports:
      MTU= 1500, PC-to-gadget: 139 Mbps, Gadget-to-PC: 116 Mbps
      MTU=15000, PC-to-gadget: 239 Mbps, Gadget-to-PC: 361 Mbps
      
      On boards with slower CPUs the performance improvement will be
      relatively much larger, e.g. an OMAP-L138 increased from 40 to
      220 Mbps using a similar patch on an  2.6.37 kernel.
      Signed-off-by: default avatarMike Looijmans <mike.looijmans@topic.nl>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      bba787a8
  16. 19 Jan, 2015 1 commit
  17. 19 Aug, 2014 1 commit
    • Li RongQing's avatar
      Revert "usb: gadget: u_ether: synchronize with transmit when stopping queue" · 7166c32d
      Li RongQing authored
      This reverts commit a9232076.
      
      It introduced a dead lock, and did not fix anything.
      
      it made netif_tx_lock() be called in IRQ context, but in softirq context,
      the same lock is locked without disabling IRQ. In fact, the commit a9232076
      
      
      did not fix anything, since netif_stop_queue did not free the any resource
      
      [   10.154920] =================================
      [   10.156026] [ INFO: inconsistent lock state ]
      [   10.156026] 3.16.0-rc5+ #13 Not tainted
      [   10.156026] ---------------------------------
      [   10.156026] inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
      [   10.156026] swapper/1/0 [HC0[0]:SC1[5]:HE1:SE0] takes:
      [   10.156026]  (_xmit_ETHER){?.-...}, at: [<80948b6a>] sch_direct_xmit+0x7a/0x250
      [   10.156026] {IN-HARDIRQ-W} state was registered at:
      [   10.156026]   [<804811f0>] __lock_acquire+0x800/0x17a0
      [   10.156026]   [<804828ba>] lock_acquire+0x6a/0xf0
      [   10.156026]   [<809ed477>] _raw_spin_lock+0x27/0x40
      [   10.156026]   [<8088d508>] gether_disconnect+0x68/0x280
      [   10.156026]   [<8088e777>] eem_set_alt+0x37/0xc0
      [   10.156026]   [<808847ce>] composite_setup+0x30e/0x1240
      [   10.156026]   [<8088b8ae>] pch_udc_isr+0xa6e/0xf50
      [   10.156026]   [<8048abe8>] handle_irq_event_percpu+0x38/0x1e0
      [   10.156026]   [<8048adc1>] handle_irq_event+0x31/0x50
      [   10.156026]   [<8048d94b>] handle_fasteoi_irq+0x6b/0x140
      [   10.156026]   [<804040a5>] handle_irq+0x65/0x80
      [   10.156026]   [<80403cfc>] do_IRQ+0x3c/0xc0
      [   10.156026]   [<809ee6ae>] common_interrupt+0x2e/0x34
      [   10.156026]   [<804668c5>] finish_task_switch+0x65/0xd0
      [   10.156026]   [<809e89df>] __schedule+0x20f/0x7d0
      [   10.156026]   [<809e94aa>] schedule_preempt_disabled+0x2a/0x70
      [   10.156026]   [<8047bf03>] cpu_startup_entry+0x143/0x410
      [   10.156026]   [<809e2e61>] rest_init+0xa1/0xb0
      [   10.156026]   [<80ce2a3b>] start_kernel+0x336/0x33b
      [   10.156026]   [<80ce22ab>] i386_start_kernel+0x79/0x7d
      [   10.156026] irq event stamp: 52070
      [   10.156026] hardirqs last  enabled at (52070): [<809375de>] neigh_resolve_output+0xee/0x2a0
      [   10.156026] hardirqs last disabled at (52069): [<809375a8>] neigh_resolve_output+0xb8/0x2a0
      [   10.156026] softirqs last  enabled at (52020): [<8044401f>] _local_bh_enable+0x1f/0x50
      [   10.156026] softirqs last disabled at (52021): [<80404036>] do_softirq_own_stack+0x26/0x30
      [   10.156026]
      [   10.156026] other info that might help us debug this:
      [   10.156026]  Possible unsafe locking scenario:
      [   10.156026]
      [   10.156026]        CPU0
      [   10.156026]        ----
      [   10.156026]   lock(_xmit_ETHER);
      [   10.156026]   <Interrupt>
      [   10.156026]     lock(_xmit_ETHER);
      [   10.156026]
      [   10.156026]  *** DEADLOCK ***
      [   10.156026]
      [   10.156026] 4 locks held by swapper/1/0:
      [   10.156026]  #0:  (((&idev->mc_ifc_timer))){+.-...}, at: [<8044b100>] call_timer_fn+0x0/0x190
      [   10.156026]  #1:  (rcu_read_lock){......}, at: [<a0577c40>] mld_sendpack+0x0/0x590 [ipv6]
      [   10.156026]  #2:  (rcu_read_lock_bh){......}, at: [<a055680c>] ip6_finish_output2+0x4c/0x7f0 [ipv6]
      [   10.156026]  #3:  (rcu_read_lock_bh){......}, at: [<8092e510>] __dev_queue_xmit+0x0/0x5f0
      [   10.156026]
      [   10.156026] stack backtrace:
      [   10.156026] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 3.16.0-rc5+ #13
      [   10.156026]  811dbb10 00000000 9e919d10 809e6785 9e8b8000 9e919d3c 809e561e 80b95511
      [   10.156026]  80b9545a 80b9543d 80b95450 80b95441 80b957e4 9e8b84e0 00000002 8047f7b0
      [   10.156026]  9e919d5c 8048043b 00000002 00000000 9e8b8000 00000001 00000004 9e8b8000
      [   10.156026] Call Trace:
      [   10.156026]  [<809e6785>] dump_stack+0x48/0x69
      [   10.156026]  [<809e561e>] print_usage_bug+0x18f/0x19c
      [   10.156026]  [<8047f7b0>] ? print_shortest_lock_dependencies+0x170/0x170
      [   10.156026]  [<8048043b>] mark_lock+0x53b/0x5f0
      [   10.156026]  [<804810cf>] __lock_acquire+0x6df/0x17a0
      [   10.156026]  [<804828ba>] lock_acquire+0x6a/0xf0
      [   10.156026]  [<80948b6a>] ? sch_direct_xmit+0x7a/0x250
      [   10.156026]  [<809ed477>] _raw_spin_lock+0x27/0x40
      [   10.156026]  [<80948b6a>] ? sch_direct_xmit+0x7a/0x250
      [   10.156026]  [<80948b6a>] sch_direct_xmit+0x7a/0x250
      [   10.156026]  [<8092e6bf>] __dev_queue_xmit+0x1af/0x5f0
      [   10.156026]  [<80947fc0>] ? ether_setup+0x80/0x80
      [   10.156026]  [<8092eb0f>] dev_queue_xmit+0xf/0x20
      [   10.156026]  [<8093764c>] neigh_resolve_output+0x15c/0x2a0
      [   10.156026]  [<a0556927>] ip6_finish_output2+0x167/0x7f0 [ipv6]
      [   10.156026]  [<a0559b05>] ip6_finish_output+0x85/0x1c0 [ipv6]
      [   10.156026]  [<a0559cb7>] ip6_output+0x77/0x240 [ipv6]
      [   10.156026]  [<a0578163>] mld_sendpack+0x523/0x590 [ipv6]
      [   10.156026]  [<80480501>] ? mark_held_locks+0x11/0x90
      [   10.156026]  [<a057947d>] mld_ifc_timer_expire+0x15d/0x280 [ipv6]
      [   10.156026]  [<8044b168>] call_timer_fn+0x68/0x190
      [   10.156026]  [<a0579320>] ? igmp6_group_added+0x150/0x150 [ipv6]
      [   10.156026]  [<8044b3fa>] run_timer_softirq+0x16a/0x240
      [   10.156026]  [<a0579320>] ? igmp6_group_added+0x150/0x150 [ipv6]
      [   10.156026]  [<80444984>] __do_softirq+0xd4/0x2f0
      [   10.156026]  [<804448b0>] ? tasklet_action+0x100/0x100
      [   10.156026]  [<80404036>] do_softirq_own_stack+0x26/0x30
      [   10.156026]  <IRQ>  [<80444d05>] irq_exit+0x65/0x70
      [   10.156026]  [<8042d758>] smp_apic_timer_interrupt+0x38/0x50
      [   10.156026]  [<809ee91f>] apic_timer_interrupt+0x2f/0x34
      [   10.156026]  [<8048007b>] ? mark_lock+0x17b/0x5f0
      [   10.156026]  [<8040a912>] ? default_idle+0x22/0xf0
      [   10.156026]  [<8040b13e>] arch_cpu_idle+0xe/0x10
      [   10.156026]  [<8047bfc6>] cpu_startup_entry+0x206/0x410
      [   10.156026]  [<8042bfbd>] start_secondary+0x19d/0x1e0
      Acked-by: default avatarTony Lindgren <tony@atomide.com>
      Reported-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Jeff Westfahl <jeff.westfahl@ni.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: <linux-usb@vger.kernel.org>
      Signed-off-by: default avatarLi RongQing <roy.qing.li@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      7166c32d
  18. 16 Jul, 2014 1 commit
  19. 10 Jul, 2014 1 commit
    • Jim Baxter's avatar
      usb: gadget: NCM: Add transmit multi-frame. · 6d3865f9
      Jim Baxter authored
      
      
      This adds multi-frame support to the NCM NTB's for
      the gadget driver. This allows multiple network
      packets to be put inside a single USB NTB with a
      maximum size of 16kB.
      
      It has a time out of 300ms to ensure that smaller
      number of packets still maintain a normal latency.
      
      Also the .fp_index and .next_fp_index have been
      changed to .ndp_index and .next_ndp_index to
      match the latest CDC-NCM specification and
      help with maintenance.
      
      Results transmitting from gadget to host.
      
      Before the change:
      
      TCP_STREAM Throughput (10^6bits/sec): 22.72
      UDP_STREAM Throughput (10^6bits/sec): 25.94
      
      Latency:
      netperf -H 192.168.1.101 -v2 -l 50 -t TCP_RR -- -r 16384,16384
      Trans.   RoundTrip  Throughput
      Rate     Latency    10^6bits/s
      per sec  usec/Tran  Outbound
      
      100.83   9918.116   13.215
      
      After the change:
      
      TCP_STREAM Throughput (10^6bits/sec): 124.26
      UDP_STREAM Throughput (10^6bits/sec): 227.48
      
      Latency:
      netperf -H 192.168.1.101 -v2 -l 50 -t TCP_RR -- -r 16384,16384
      Trans.   RoundTrip  Throughput
      Rate     Latency    10^6bits/s
      per sec  usec/Tran  Outbound
      
      156.80   6377.730   20.552
      Signed-off-by: default avatarJim Baxter <jim_baxter@mentor.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      6d3865f9
  20. 19 Jun, 2014 1 commit
  21. 13 May, 2014 1 commit
  22. 21 Apr, 2014 2 commits
    • Felipe Balbi's avatar
      usb: gadget: only GPL drivers in the gadget and phy framework · 0700faaf
      Felipe Balbi authored
      
      
      We only support GPL drivers in the USB Gadget Framework,
      it sounds correct to make all exported symbols GPL too.
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      0700faaf
    • Felipe Balbi's avatar
      Revert "usb: gadget: u_ether: move hardware transmit to RX NAPI" · 9189a330
      Felipe Balbi authored
      This reverts commit 716fb91d
      
      .
      
      That commit caused a regression which would end up in a kernel
      BUG() as below:
      
      [  101.554300] g_ether gadget: full-speed config #1: CDC Subset/SAFE
      [  101.585186] ------------[ cut here ]------------
      [  101.600587] kernel BUG at include/linux/netdevice.h:495!
      [  101.615850] Internal error: Oops - BUG: 0 [#1] PREEMPT ARM
      [  101.645539] Modules linked in:
      [  101.660483] CPU: 0 PID: 0 Comm: swapper Not tainted 3.15.0-rc1+ #104
      [  101.690175] task: c05dc5c8 ti: c05d2000 task.ti: c05d2000
      [  101.705579] PC is at eth_start+0x64/0x8c
      [  101.720981] LR is at __netif_schedule+0x7c/0x90
      [  101.736455] pc : [<c0299174>]    lr : [<c036a134>]    psr: 60000093
      [  101.736455] sp : c05d3d18  ip : c05d3cf8  fp : c05d3d2c
      [  101.782340] r10: 00000000  r9 : c196c1f0  r8 : c196c1a0
      [  101.797823] r7 : 00000000  r6 : 00000002  r5 : c1976400  r4 : c1976400
      [  101.828058] r3 : 00000000  r2 : c05d3ce8  r1 : 00000001  r0 : 00000002
      [  101.858722] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM Segment kernel
      Reported-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-of-by: default avatarFelipe Balbi <balbi@ti.com>
      9189a330
  23. 07 Mar, 2014 1 commit
    • Weinn Jheng's avatar
      usb: gadget: u_ether: move hardware transmit to RX NAPI · 716fb91d
      Weinn Jheng authored
      
      
      In order to reduce the interrupt times in the embedded system,
      a receiving workqueue is introduced.
      This modification also enhanced the overall throughput as the
      benefits of reducing interrupt occurrence.
      
      This work was derived from previous work:
      u_ether: move hardware transmit to RX workqueue.
      Which should be base on codeaurora's work.
      
      However, the benchmark on my platform shows the throughput
      with workqueue is slightly better than NAPI.
      Signed-off-by: default avatarWeinn Jheng <clanlab.proj@gmail.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Stephen Hemminger <shemminger@vyatta.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Manu Gautam <mgautam@codeaurora.org>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      716fb91d
  24. 26 Nov, 2013 1 commit
  25. 10 Jun, 2013 3 commits
  26. 03 Apr, 2013 1 commit
  27. 07 Jan, 2013 1 commit
  28. 08 Nov, 2012 2 commits
  29. 10 Sep, 2012 1 commit
  30. 31 Aug, 2012 1 commit
    • Michal Nazarewicz's avatar
      usb: gadget: get rid of USB_GADGET_{DUAL,SUPER}SPEED · 85b8614d
      Michal Nazarewicz authored
      
      
      This commit removes USB_GADGET_DUALSPEED and USB_GADGET_SUPERSPEED
      Kconfig options.  Since now kernel allows many UDC drivers to be
      compiled, those options may turn to no longer be valid.  For
      instance, if someone decides to build UDC that supports super
      speed and UDC that supports high speed only, the latter will be
      "assumed" to support super speed since USB_GADGET_SUPERSPEED will
      be selected by the former.
      
      The test of whether CONFIG_USB_GADGET_*SPEED was defined was just
      an optimisation which removed otherwise dead code (ie. if UDC is
      not dual speed, there is no need to handle cases that can happen
      if speed is high).  This commit removes those checks.
      Signed-off-by: default avatarMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      85b8614d
  31. 20 Aug, 2012 1 commit
    • Tejun Heo's avatar
      workqueue: deprecate flush[_delayed]_work_sync() · 43829731
      Tejun Heo authored
      
      
      flush[_delayed]_work_sync() are now spurious.  Mark them deprecated
      and convert all users to flush[_delayed]_work().
      
      If you're cc'd and wondering what's going on: Now all workqueues are
      non-reentrant and the regular flushes guarantee that the work item is
      not pending or running on any CPU on return, so there's no reason to
      use the sync flushes at all and they're going away.
      
      This patch doesn't make any functional difference.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Mattia Dongili <malattia@linux.it>
      Cc: Kent Yoder <key@linux.vnet.ibm.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Karsten Keil <isdn@linux-pingi.de>
      Cc: Bryan Wu <bryan.wu@canonical.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Alasdair Kergon <agk@redhat.com>
      Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: linux-wireless@vger.kernel.org
      Cc: Anton Vorontsov <cbou@mail.ru>
      Cc: Sangbeom Kim <sbkim73@samsung.com>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Eric Van Hensbergen <ericvh@gmail.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Petr Vandrovec <petr@vandrovec.name>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Avi Kivity <avi@redhat.com> 
      43829731
  32. 10 Aug, 2012 1 commit
    • Michael Grzeschik's avatar
      usb: gadget: u_ether: fix kworker 100% CPU issue with still used interfaces in eth_stop · b1b552a6
      Michael Grzeschik authored
      This patch fixes an issue introduced by patch:
      
          72c973dd
      
       usb: gadget: add usb_endpoint_descriptor to struct usb_ep
      
      Without this patch we see a kworker taking 100% CPU, after this sequence:
      
      - Connect gadget to a windows host
      - load g_ether
      - ifconfig up <ip>; ifconfig down; ifconfig up
      - ping <windows host>
      
      The "ifconfig down" results in calling eth_stop(), which will call
      usb_ep_disable() and, if the carrier is still ok, usb_ep_enable():
      
               usb_ep_disable(link->in_ep);
               usb_ep_disable(link->out_ep);
               if (netif_carrier_ok(net)) {
                       usb_ep_enable(link->in_ep);
                       usb_ep_enable(link->out_ep);
               }
      
      The ep should stay enabled, but will not, as ep_disable set the desc
      pointer to NULL, therefore the subsequent ep_enable will fail. This leads
      to permanent rescheduling of the eth_work() worker as usb_ep_queue()
      (called by the worker) will fail due to the unconfigured endpoint.
      
      We fix this issue by saving the ep descriptors and re-assign them before
      usb_ep_enable().
      
      Cc: Tatyana Brokhman <tlinder@codeaurora.org>
      Signed-off-by: default avatarMichael Grzeschik <m.grzeschik@pengutronix.de>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b1b552a6