1. 18 3月, 2014 1 次提交
    • B
      net: cpsw: do not register cpts twice · b085f311
      Benedikt Spranger 提交于
      commit f280e89a (drivers: net: cpsw: fix for cpsw crash when build as modules)
      moved cpts_register()/cpts_unregister() to  ndo_open()/ndo_stop(), but failed
      to remove cpts_register in cpsw_probe() which leads to a double registration
      and the following debug object splat.
      
      [   18.991902] ODEBUG: init active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x2c
      [   19.082249] [<c0059e80>] (init_timer_key) from [<c04965d4>] (cpts_register+0x1f0/0x2c4)
      [   19.090642] [<c04965d4>] (cpts_register) from [<c04931dc>] (cpsw_ndo_open+0x780/0x81c)
      [   19.098948] [<c04931dc>] (cpsw_ndo_open) from [<c0599c2c>] (__dev_open+0xb4/0x118)
      Signed-off-by: NBenedikt Spranger <b.spranger@linutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b085f311
  2. 04 3月, 2014 1 次提交
  3. 14 2月, 2014 2 次提交
  4. 31 1月, 2014 1 次提交
  5. 24 1月, 2014 1 次提交
  6. 23 12月, 2013 1 次提交
    • M
      drivers: net : cpsw: pass proper device name while requesting irq · db850559
      Mugunthan V N 提交于
      During checking the interrupts with "cat /proc/interrupts", it is showing
      device name as (null), this change was done with commit id aa1a15e2 where
      request_irq is changed to devm_request_irq also changing the irq name from
      platform device name to net device name, but the net device is not
      registered at this point with the network frame work, so devm_request_irq
      is called with device name as NULL, by which it is showed as "(null)" in
      "cat /proc/interrupts". So this patch changes back irq name to platform
      device name itself in devm_request_irq so that the device name shows as
      below.
      
      Previous to this patch
      root@am335x-evm:~# cat /proc/interrupts
                 CPU0
       28:       2265      INTC  12  edma
       30:         80      INTC  14  edma_error
       56:          0      INTC  40  (null)
       57:       1794      INTC  41  (null)
       58:          7      INTC  42  (null)
       59:          0      INTC  43  (null)
      
      With this patch
      root@am335x-evm:~# cat /proc/interrupts
                 CPU0
       28:        213      INTC  12  edma
       30:          9      INTC  14  edma_error
       56:          0      INTC  40  4a100000.ethernet
       57:      16097      INTC  41  4a100000.ethernet
       58:      11964      INTC  42  4a100000.ethernet
       59:          0      INTC  43  4a100000.ethernet
      Signed-off-by: NMugunthan V N <mugunthanvnm@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      db850559
  7. 19 12月, 2013 1 次提交
  8. 13 12月, 2013 1 次提交
  9. 12 12月, 2013 1 次提交
  10. 03 12月, 2013 1 次提交
  11. 22 11月, 2013 1 次提交
  12. 16 11月, 2013 1 次提交
  13. 15 11月, 2013 1 次提交
  14. 22 10月, 2013 1 次提交
    • M
      drivers: net: cpsw: fix kernel warn during iperf test with interrupt pacing · 49595b7b
      Mugunthan V N 提交于
      When interrupt pacing is enabled, receive/transmit statistics are not
      updated properly by hardware which leads to ISR return with IRQ_NONE
      and inturn kernel disables the interrupt. This patch removed the checking
      of receive/transmit statistics from ISR.
      
      This patch is verified with AM335x Beagle Bone Black and below is the
      kernel warn when interrupt pacing is enabled.
      
      [  104.298254] irq 58: nobody cared (try booting with the "irqpoll" option)
      [  104.305356] CPU: 0 PID: 1073 Comm: iperf Not tainted 3.12.0-rc3-00342-g77d4015b #3
      [  104.313284] [<c001bb84>] (unwind_backtrace+0x0/0xf0) from [<c0017db0>] (show_stack+0x10/0x14)
      [  104.322282] [<c0017db0>] (show_stack+0x10/0x14) from [<c0507920>] (dump_stack+0x78/0x94)
      [  104.330816] [<c0507920>] (dump_stack+0x78/0x94) from [<c0088c1c>] (__report_bad_irq+0x20/0xc0)
      [  104.339889] [<c0088c1c>] (__report_bad_irq+0x20/0xc0) from [<c008912c>] (note_interrupt+0x1dc/0x23c)
      [  104.349505] [<c008912c>] (note_interrupt+0x1dc/0x23c) from [<c0086d74>] (handle_irq_event_percpu+0xc4/0x238)
      [  104.359851] [<c0086d74>] (handle_irq_event_percpu+0xc4/0x238) from [<c0086f24>] (handle_irq_event+0x3c/0x5c)
      [  104.370198] [<c0086f24>] (handle_irq_event+0x3c/0x5c) from [<c008991c>] (handle_level_irq+0xac/0x10c)
      [  104.379907] [<c008991c>] (handle_level_irq+0xac/0x10c) from [<c00866d8>] (generic_handle_irq+0x20/0x30)
      [  104.389812] [<c00866d8>] (generic_handle_irq+0x20/0x30) from [<c0014ce8>] (handle_IRQ+0x4c/0xb0)
      [  104.399066] [<c0014ce8>] (handle_IRQ+0x4c/0xb0) from [<c000856c>] (omap3_intc_handle_irq+0x60/0x74)
      [  104.408598] [<c000856c>] (omap3_intc_handle_irq+0x60/0x74) from [<c050d8e4>] (__irq_svc+0x44/0x5c)
      [  104.418021] Exception stack(0xde4f7c00 to 0xde4f7c48)
      [  104.423345] 7c00: 00000001 00000000 00000000 dd002140 60000013 de006e54 00000002 00000000
      [  104.431952] 7c20: de345748 00000040 c11c8588 00018ee0 00000000 de4f7c48 c009dfc8 c050d300
      [  104.440553] 7c40: 60000013 ffffffff
      [  104.444237] [<c050d8e4>] (__irq_svc+0x44/0x5c) from [<c050d300>] (_raw_spin_unlock_irqrestore+0x34/0x44)
      [  104.454220] [<c050d300>] (_raw_spin_unlock_irqrestore+0x34/0x44) from [<c00868c0>] (__irq_put_desc_unlock+0x14/0x38)
      [  104.465295] [<c00868c0>] (__irq_put_desc_unlock+0x14/0x38) from [<c0088068>] (enable_irq+0x4c/0x74)
      [  104.474829] [<c0088068>] (enable_irq+0x4c/0x74) from [<c03abd24>] (cpsw_poll+0xb8/0xdc)
      [  104.483276] [<c03abd24>] (cpsw_poll+0xb8/0xdc) from [<c044ef68>] (net_rx_action+0xc0/0x1e8)
      [  104.492085] [<c044ef68>] (net_rx_action+0xc0/0x1e8) from [<c0048a90>] (__do_softirq+0x100/0x27c)
      [  104.501338] [<c0048a90>] (__do_softirq+0x100/0x27c) from [<c0048cd0>] (do_softirq+0x68/0x70)
      [  104.510224] [<c0048cd0>] (do_softirq+0x68/0x70) from [<c0048e8c>] (local_bh_enable+0xd0/0xe4)
      [  104.519211] [<c0048e8c>] (local_bh_enable+0xd0/0xe4) from [<c048c774>] (tcp_rcv_established+0x450/0x648)
      [  104.529201] [<c048c774>] (tcp_rcv_established+0x450/0x648) from [<c0494904>] (tcp_v4_do_rcv+0x154/0x474)
      [  104.539195] [<c0494904>] (tcp_v4_do_rcv+0x154/0x474) from [<c043d750>] (release_sock+0xac/0x1ac)
      [  104.548448] [<c043d750>] (release_sock+0xac/0x1ac) from [<c04844e8>] (tcp_recvmsg+0x4d0/0xa8c)
      [  104.557528] [<c04844e8>] (tcp_recvmsg+0x4d0/0xa8c) from [<c04a8720>] (inet_recvmsg+0xcc/0xf0)
      [  104.566507] [<c04a8720>] (inet_recvmsg+0xcc/0xf0) from [<c0439744>] (sock_recvmsg+0x90/0xb0)
      [  104.575394] [<c0439744>] (sock_recvmsg+0x90/0xb0) from [<c043b778>] (SyS_recvfrom+0x88/0xd8)
      [  104.584280] [<c043b778>] (SyS_recvfrom+0x88/0xd8) from [<c043b7e0>] (sys_recv+0x18/0x20)
      [  104.592805] [<c043b7e0>] (sys_recv+0x18/0x20) from [<c0013da0>] (ret_fast_syscall+0x0/0x48)
      [  104.601587] handlers:
      [  104.603992] [<c03acd94>] cpsw_interrupt
      [  104.608040] Disabling IRQ #58
      
      Cc: Sebastian Siewior <bigeasy@linutronix.de>
      Signed-off-by: NMugunthan V N <mugunthanvnm@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      49595b7b
  15. 18 10月, 2013 1 次提交
  16. 08 10月, 2013 2 次提交
  17. 02 10月, 2013 1 次提交
  18. 24 9月, 2013 2 次提交
  19. 21 8月, 2013 2 次提交
  20. 14 8月, 2013 1 次提交
  21. 06 8月, 2013 1 次提交
  22. 03 8月, 2013 1 次提交
  23. 31 7月, 2013 1 次提交
  24. 25 7月, 2013 1 次提交
  25. 29 6月, 2013 1 次提交
  26. 24 6月, 2013 1 次提交
  27. 20 6月, 2013 1 次提交
  28. 18 6月, 2013 1 次提交
  29. 16 6月, 2013 1 次提交
  30. 05 6月, 2013 1 次提交
  31. 28 5月, 2013 1 次提交
  32. 03 5月, 2013 1 次提交
  33. 01 5月, 2013 1 次提交
    • M
      drivers: net: cpsw: fix kernel warn on cpsw irq enable · 7dcf313a
      Mugunthan V N 提交于
      With the commit a11fbba9 (net/cpsw: fix irq_disable() with threaded interrupts)
      from Sebastian Siewior, a kernel warning is generated as below. This warning
      is generated as the irq_enabled is not initialized for the primary interface
      and in probe it is initialized for the second interface. This patch moves
      irq_enabled initialization from second interface to primary interface.
      
      [    3.049173] net eth0: phy found : id is : 0x4dd074
      [    3.054552] net eth0: phy found : id is : 0x4dd074
      [    3.070421] ------------[ cut here ]------------
      [    3.075308] WARNING: at kernel/irq/manage.c:437 enable_irq+0x3c/0x74()
      [    3.082173] Unbalanced enable for IRQ 56
      [    3.086299] Modules linked in:
      [    3.089557] [<c001abcc>] (unwind_backtrace+0x0/0xf0) from [<c004294c>] (warn_slowpath_common+0x4c/0x68)
      [    3.099450] [<c004294c>] (warn_slowpath_common+0x4c/0x68) from [<c00429fc>] (warn_slowpath_fmt+0x30/0x40)
      [    3.109521] [<c00429fc>] (warn_slowpath_fmt+0x30/0x40) from [<c00a29fc>] (enable_irq+0x3c/0x74)
      [    3.118681] [<c00a29fc>] (enable_irq+0x3c/0x74) from [<c03a7818>] (cpsw_ndo_open+0x61c/0x684)
      [    3.127669] [<c03a7818>] (cpsw_ndo_open+0x61c/0x684) from [<c0445c08>] (__dev_open+0x9c/0xf8)
      [    3.136646] [<c0445c08>] (__dev_open+0x9c/0xf8) from [<c0445e34>] (__dev_change_flags+0x78/0x13c)
      [    3.145988] [<c0445e34>] (__dev_change_flags+0x78/0x13c) from [<c0445f64>] (dev_change_flags+0x10/0x48)
      [    3.155884] [<c0445f64>] (dev_change_flags+0x10/0x48) from [<c0736d88>] (ip_auto_config+0x198/0x111c)
      [    3.165592] [<c0736d88>] (ip_auto_config+0x198/0x111c) from [<c00086a4>] (do_one_initcall+0x34/0x180)
      [    3.175309] [<c00086a4>] (do_one_initcall+0x34/0x180) from [<c07078f8>] (kernel_init_freeable+0xfc/0x1c8)
      [    3.185393] [<c07078f8>] (kernel_init_freeable+0xfc/0x1c8) from [<c04f36ec>] (kernel_init+0x8/0xe4)
      [    3.194929] [<c04f36ec>] (kernel_init+0x8/0xe4) from [<c00133d0>] (ret_from_fork+0x14/0x24)
      [    3.203712] ---[ end trace d6f979da080bc391 ]---
      
      Cc: Sebastian Siewior <bigeasy@linutronix.de>
      Signed-off-by: NMugunthan V N <mugunthanvnm@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7dcf313a
  34. 25 4月, 2013 3 次提交
    • S
      net/cpsw: fix irq_disable() with threaded interrupts · a11fbba9
      Sebastian Siewior 提交于
      During high throughput it is likely that we receive both: an RX and TX
      interrupt. The normal behaviour is that once we enter the ISR the
      interrupts are disabled in the IRQ chip and so the ISR is invoked only
      once and the interrupt line is disabled once. It will be re-enabled
      after napi completes.
      With threaded interrupts on the other hand the interrupt the interrupt
      is disabled immediately and the ISR is marked for "later". By having TX
      and RX interrupt marked pending we invoke them both and disable the
      interrupt line twice. The napi callback is still executed once and so
      after it completes we remain with interrupts disabled.
      
      The initial patch simply removed the cpsw_{enable|disable}_irq() calls
      and it worked well on my AM335X ES1.0 (beagle bone). On ES2.0 (beagle
      bone black) it caused an never ending interrupt (even after the mask via
      cpsw_intr_disable()) according to Mugunthan V N. Since I don't have the
      ES2.0 and no idea what is going on this patch tracks the state of the
      irq_disable() call and execute it only when not yet done.
      The book keeping is done on the first struct since with dual_emac we can
      have two of those and only one interrupt line.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Acked-by: NMugunthan V N <mugunthanvnm@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a11fbba9
    • S
      net/cpsw: optimize the for_each_slave_macro() · 6e6ceaed
      Sebastian Siewior 提交于
      text    data     bss     dec     hex filename
      15530      92       4   15626    3d0a cpsw.o.before
      15478      92       4   15574    3cd6 cpsw.o.after
      
      52 bytes smaller, 13 for each invocation.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Acked-by: NMugunthan V N <mugunthanvnm@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6e6ceaed
    • S
      net/cpsw: make sure modules remove does not leak any ressources · d1bd9acf
      Sebastian Siewior 提交于
      This driver does not clean up properly after leaving. Here is a list:
      - Use unregister_netdev(). free_netdev() is good but not enough
      - Use the above also on the other ndev in case of dual mac
      - Free data.slave_data. The name of the strucre makes it look like
        it is platform_data but it is not. It is just a trick!
      - Free all irqs. Again: freeing one irq is good start, but freeing all
        of them is better.
      
      With this rmmod & modprobe of cpsw seems to work. The remaining issue
      is:
      |WARNING: at fs/sysfs/dir.c:536 sysfs_add_one+0x9c/0xd4()
      |sysfs: cannot create duplicate filename '/devices/ocp.2/4a100000.ethernet/4a101000.mdio'
      |WARNING: at lib/kobject.c:196 kobject_add_internal+0x1a4/0x1c8()
      
      comming from of_platform_populate() and I am not sure that this belongs
      here.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Acked-by: NMugunthan V N <mugunthanvnm@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d1bd9acf