1. 16 5月, 2015 4 次提交
  2. 04 5月, 2015 1 次提交
  3. 17 4月, 2015 1 次提交
  4. 05 3月, 2015 1 次提交
    • A
      stmmac: check IRQ availability early on probe · 8f02d8da
      Alexey Brodkin 提交于
      Currently we're getting IRQs after lots of resources are already
      allocated:
       * netdev
       * clocks
       * MDIO bus
      Also HW gets initialized by the time when checking IRQs as well.
      
      Now there's a possibility for master interrupt controller to be not
      probed yet. This will lead to exit from GMAC probe routine with "-
      EPROBE_DEFER" and so deferred probe will hapen later on.
      
      But since we exited the first GMAC probe without release of all
      allocated resources there could be conflicts on subsequent probes.
      
      For example this is what happens for me:
       --->8---
       stmmaceth e0018000.ethernet: no reset control found
       stmmac - user ID: 0x10, Synopsys ID: 0x37
        Ring mode enabled
        DMA HW capability register supported
        Normal descriptors
        RX Checksum Offload Engine supported (type 2)
        TX Checksum insertion supported
        Enable RX Mitigation via HW Watchdog Timer
       libphy: stmmac: probed
       eth0: PHY ID 20005c7a at 1 IRQ POLL (stmmac-0:01) active
       platform e0018000.ethernet: Driver stmmaceth requests probe deferral
       ...
       ...
       ...
       stmmaceth e0018000.ethernet: no reset control found
       stmmac - user ID: 0x10, Synopsys ID: 0x37
        Ring mode enabled
        DMA HW capability register supported
        Normal descriptors
        RX Checksum Offload Engine supported (type 2)
        TX Checksum insertion supported
        Enable RX Mitigation via HW Watchdog Timer
       ------------[ cut here ]------------
       WARNING: CPU: 0 PID: 6 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x4e/0x68()
       sysfs: cannot create duplicate filename
      '/devices/platform/axs10x_mb/e0018000.ethernet/mdio_bus/stmmac-0'
       CPU: 0 PID: 6 Comm: kworker/u2:0 Not tainted 4.0.0-rc1-next-20150303+#8
       Workqueue: deferwq deferred_probe_work_func
      
       Stack Trace:
        arc_unwind_core+0xb8/0x114
        warn_slowpath_common+0x5a/0x8c
        warn_slowpath_fmt+0x2e/0x38
        sysfs_warn_dup+0x4e/0x68
        sysfs_create_dir_ns+0x98/0xa0
        kobject_add_internal+0x8c/0x2e8
        kobject_add+0x4a/0x8c
        device_add+0xc6/0x448
        mdiobus_register+0x6c/0x164
        stmmac_mdio_register+0x112/0x264
        stmmac_dvr_probe+0x6c0/0x85c
        stmmac_pltfr_probe+0x2e4/0x50c
        platform_drv_probe+0x26/0x5c
        really_probe+0x76/0x1dc
        bus_for_each_drv+0x42/0x7c
        device_attach+0x64/0x6c
        bus_probe_device+0x74/0xa4
        deferred_probe_work_func+0x50/0x84
        process_one_work+0xf8/0x2cc
        worker_thread+0x110/0x478
        kthread+0x8a/0x9c
        ret_from_fork+0x14/0x18
       ---[ end trace a2dfaa7d630c8be1 ]---
       ------------[ cut here ]------------
       WARNING: CPU: 0 PID: 6 at lib/kobject.c:240
      kobject_add_internal+0x218/0x2e8()
       kobject_add_internal failed for stmmac-0 with -EEXIST, don't try to
      register things with the same name in the same di.
       CPU: 0 PID: 6 Comm: kworker/u2:0 Tainted: G        W
      4.0.0-rc1-next-20150303+ #8
       Workqueue: deferwq deferred_probe_work_func
      
       Stack Trace:
        arc_unwind_core+0xb8/0x114
        warn_slowpath_common+0x5a/0x8c
        warn_slowpath_fmt+0x2e/0x38
        kobject_add_internal+0x218/0x2e8
        kobject_add+0x4a/0x8c
        device_add+0xc6/0x448
        mdiobus_register+0x6c/0x164
        stmmac_mdio_register+0x112/0x264
        stmmac_dvr_probe+0x6c0/0x85c
        stmmac_pltfr_probe+0x2e4/0x50c
        platform_drv_probe+0x26/0x5c
        really_probe+0x76/0x1dc
        bus_for_each_drv+0x42/0x7c
        device_attach+0x64/0x6c
        bus_probe_device+0x74/0xa4
        deferred_probe_work_func+0x50/0x84
        process_one_work+0xf8/0x2cc
        worker_thread+0x110/0x478
        kthread+0x8a/0x9c
        ret_from_fork+0x14/0x18
       ---[ end trace a2dfaa7d630c8be2 ]---
       libphy: mii_bus stmmac-0 failed to register
       : Cannot register as MDIO bus
       stmmac_pltfr_probe: main driver probe failed
       stmmaceth: probe of e0018000.ethernet failed with error -22
       --->8---
      
      Essential fix is to check for IRQs availability as early as possible and
      then safely go to deferred probe if IRQs are not there yet.
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Sonic Zhang <sonic.zhang@analog.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8f02d8da
  5. 27 1月, 2015 1 次提交
  6. 01 1月, 2015 1 次提交
    • R
      GMAC: add driver for Rockchip RK3288 SoCs integrated GMAC · 7ad269ea
      Roger Chen 提交于
      This driver is based on stmmac driver.
      
      changes since v2:
      - use tab instead of space for macros
      - use HIWORD_UPDATE macro for GMAC_CLK_RX_DL_CFG and GMAC_CLK_TX_DL_CFG
      - remove drive-strength setting in the driver and set it in the pinctrl settings
      - use dev_err instead of pr_err
      - remove clock names's macros, just use the real name of the clock
      - use devm_clk_get() instead of clk_get()
      - remove clk_set_parent(bsp_priv->clk_mac, bsp_priv->clk_mac_pll)
      - remove gpio setting for LDO, just use regulator API
      - remove phy reset using gpio in the glue layer, it has been handled in the stmmac driver
      - remove handling phy interrupt (mii interrupt)
      
      changes since v1:
      - use BIT() to set register
      - combine two remap_write() operations into one for the same register
      - use macros for register value setting
      - remove grf fail check in rk_gmac_setup() and save all the check in set_rgmii_speed()
      - remove .tx_coe=1 in rk_gmac_data
      Signed-off-by: NRoger Chen <roger.chen@rock-chips.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7ad269ea
  7. 23 12月, 2014 1 次提交
  8. 30 11月, 2014 1 次提交
  9. 27 11月, 2014 1 次提交
  10. 20 11月, 2014 1 次提交
  11. 12 11月, 2014 1 次提交
  12. 08 11月, 2014 1 次提交
    • A
      stmmac: platform: fix sparse warnings · f10f9fb2
      Andy Shevchenko 提交于
      This patch fixes the following sparse warnings. One is fixed by casting return
      value to a return type of the function. The others by creating a specific
      stmmac_platform.h which provides the bits related to the platform driver.
      
      drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c:59:29: warning: incorrect type in return expression (different address spaces)
      drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c:59:29:    expected void *
      drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c:59:29:    got void [noderef] <asn:2>*reg
      
      drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c:64:29: warning: symbol 'meson6_dwmac_data' was not declared. Should it be static?
      drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c:354:29: warning: symbol 'stih4xx_dwmac_data' was not declared. Should it be static?
      drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c:361:29: warning: symbol 'stid127_dwmac_data' was not declared. Should it be static?
      drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c:133:29: warning: symbol 'sun7i_gmac_data' was not declared. Should it be static?
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f10f9fb2
  13. 06 11月, 2014 1 次提交
  14. 15 10月, 2014 3 次提交
  15. 26 9月, 2014 1 次提交
  16. 01 8月, 2014 1 次提交
    • V
      net: stmmac: Support devicetree configs for mcast and ucast filter entries · 3b57de95
      Vince Bridgers 提交于
      This patch adds and modifies code to support multiple Multicast and Unicast
      Synopsys MAC filter configurations. The default configuration is defined to
      support legacy driver behavior, which is 64 Multicast bins. The Unicast
      filter code previously assumed all controllers support 32 or 16 Unicast
      addresses based on controller version number, but this has been corrected
      to support a default of 1 Unicast address. The filter configuration may
      be specified through the devicetree using a Synopsys specific device tree
      entry. This information was verified with Synopsys through
      Synopsys Support Case #8000684337 and shared with the maintainer.
      Signed-off-by: NVince Bridgers <vbridgers2013@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3b57de95
  17. 03 6月, 2014 1 次提交
  18. 29 3月, 2014 1 次提交
  19. 12 3月, 2014 1 次提交
  20. 14 2月, 2014 1 次提交
  21. 22 1月, 2014 1 次提交
    • V
      stmmac: Fix kernel crashes for jumbo frames · 2618abb7
      Vince Bridgers 提交于
      These changes correct the following issues with jumbo frames on the
      stmmac driver:
      
      1) The Synopsys EMAC can be configured to support different FIFO
      sizes at core configuration time. There's no way to query the
      controller and know the FIFO size, so the driver needs to get this
      information from the device tree in order to know how to correctly
      handle MTU changes and setting up dma buffers. The default
      max-frame-size is as currently used, which is the size of a jumbo
      frame.
      
      2) The driver was enabling Jumbo frames by default, but was not allocating
      dma buffers of sufficient size to handle the maximum possible packet
      size that could be received. This led to memory corruption since DMAs were
      occurring beyond the extent of the allocated receive buffers for certain types
      of network traffic.
      
      kernel BUG at net/core/skbuff.c:126!
      Internal error: Oops - BUG: 0 [#1] SMP ARM
      Modules linked in:
      CPU: 0 PID: 563 Comm: sockperf Not tainted 3.13.0-rc6-01523-gf7111b9 #31
      task: ef35e580 ti: ef252000 task.ti: ef252000
      PC is at skb_panic+0x60/0x64
      LR is at skb_panic+0x60/0x64
      pc : [<c03c7c3c>]    lr : [<c03c7c3c>]    psr: 60000113
      sp : ef253c18  ip : 60000113  fp : 00000000
      r10: ef3a5400  r9 : 00000ebc  r8 : ef3a546c
      r7 : ee59f000  r6 : ee59f084  r5 : ee59ff40  r4 : ee59f140
      r3 : 000003e2  r2 : 00000007  r1 : c0b9c420  r0 : 0000007d
      Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      Control: 10c5387d  Table: 2e8ac04a  DAC: 00000015
      Process sockperf (pid: 563, stack limit = 0xef252248)
      Stack: (0xef253c18 to 0xef254000)
      3c00:                                                       00000ebc ee59f000
      3c20: ee59f084 ee59ff40 ee59f140 c04a9cd8 ee8c50c0 00000ebc ee59ff40 00000000
      3c40: ee59f140 c02d0ef0 00000056 ef1eda80 ee8c50c0 00000ebc 22bbef29 c0318f8c
      3c60: 00000056 ef3a547c ffe2c716 c02c9c90 c0ba1298 ef3a5838 ef3a5838 ef3a5400
      3c80: 000020c0 ee573840 000055cb ef3f2050 c053f0e0 c0319214 22b9b085 22d92813
      3ca0: 00001c80 004b8e00 ef3a5400 ee573840 ef3f2064 22d92813 ef3f2064 000055cb
      3cc0: ef3f2050 c031a19c ef252000 00000000 00000000 c0561bc0 00000000 ff00ffff
      3ce0: c05621c0 ef3a5400 ef3f2064 ee573840 00000020 ef3f2064 000055cb ef3f2050
      3d00: c053f0e0 c031cad0 c053e740 00000e60 00000000 00000000 ee573840 ef3a5400
      3d20: ef0a6e00 00000000 ef3f2064 c032507c 00010000 00000020 c0561bc0 c0561bc0
      3d40: ee599850 c032799c 00000000 ee573840 c055a380 ef3a5400 00000000 ef3f2064
      3d60: ef3f2050 c032799c 0101c7c0 2b6755cb c059a280 c030e4d8 000055cb ffffffff
      3d80: ee574fc0 c055a380 ee574000 ee573840 00002b67 ee573840 c03fe9c4 c053fa68
      3da0: c055a380 00001f6f 00000000 ee573840 c053f0e0 c0304fdc ef0a6e01 ef3f2050
      3dc0: ee573858 ef031000 ee573840 c03055d8 c0ba0c40 ef000f40 00100100 c053f0dc
      3de0: c053ffdc c053f0f0 00000008 00000000 ef031000 c02da948 00001140 00000000
      3e00: c0563c78 ef253e5f 00000020 ee573840 00000020 c053f0f0 ef313400 ee573840
      3e20: c053f0e0 00000000 00000000 c05380c0 ef313400 00001000 00000015 c02df280
      3e40: ee574000 ef001e00 00000000 00001080 00000042 005cd980 ef031500 ef031500
      3e60: 00000000 c02df824 ef031500 c053e390 c0541084 f00b1e00 c05925e8 c02df864
      3e80: 00001f5c ef031440 c053e390 c0278524 00000002 00000000 c0b9eb48 c02df280
      3ea0: ee8c7180 00000100 c0542ca8 00000015 00000040 ef031500 ef031500 ef031500
      3ec0: c027803c ef252000 00000040 000000ec c05380c0 c0b9eb40 c0b9eb48 c02df940
      3ee0: ef060780 ffffa4dd c0564a9c c056343c 002e80a8 00000080 ef031500 00000001
      3f00: c053808c ef252000 fffec100 00000003 00000004 002e80a8 0000000c c00258f0
      3f20: 002e80a8 c005e704 00000005 00000100 c05634d0 c0538080 c05333e0 00000000
      3f40: 0000000a c0565580 c05380c0 ffffa4dc c05434f4 00400100 00000004 c0534cd4
      3f60: 00000098 00000000 fffec100 002e80a8 00000004 002e80a8 002a20e0 c0025da8
      3f80: c0534cd4 c000f020 fffec10c c053ea60 ef253fb0 c0008530 0000ffe2 b6ef67f4
      3fa0: 40000010 ffffffff 00000124 c0012f3c 0000ffe2 002e80f0 0000ffe2 00004000
      3fc0: becb6338 becb6334 00000004 00000124 002e80a8 00000004 002e80a8 002a20e0
      3fe0: becb6300 becb62f4 002773bb b6ef67f4 40000010 ffffffff 00000000 00000000
      [<c03c7c3c>] (skb_panic+0x60/0x64) from [<c02d0ef0>] (skb_put+0x4c/0x50)
      [<c02d0ef0>] (skb_put+0x4c/0x50) from [<c0318f8c>] (tcp_collapse+0x314/0x3ec)
      [<c0318f8c>] (tcp_collapse+0x314/0x3ec) from [<c0319214>]
      (tcp_try_rmem_schedule+0x1b0/0x3c4)
      [<c0319214>] (tcp_try_rmem_schedule+0x1b0/0x3c4) from [<c031a19c>]
      (tcp_data_queue+0x480/0xe6c)
      [<c031a19c>] (tcp_data_queue+0x480/0xe6c) from [<c031cad0>]
      (tcp_rcv_established+0x180/0x62c)
      [<c031cad0>] (tcp_rcv_established+0x180/0x62c) from [<c032507c>]
      (tcp_v4_do_rcv+0x13c/0x31c)
      [<c032507c>] (tcp_v4_do_rcv+0x13c/0x31c) from [<c032799c>]
      (tcp_v4_rcv+0x718/0x73c)
      [<c032799c>] (tcp_v4_rcv+0x718/0x73c) from [<c0304fdc>]
      (ip_local_deliver+0x98/0x274)
      [<c0304fdc>] (ip_local_deliver+0x98/0x274) from [<c03055d8>]
      (ip_rcv+0x420/0x758)
      [<c03055d8>] (ip_rcv+0x420/0x758) from [<c02da948>]
      (__netif_receive_skb_core+0x44c/0x5bc)
      [<c02da948>] (__netif_receive_skb_core+0x44c/0x5bc) from [<c02df280>]
      (netif_receive_skb+0x48/0xb4)
      [<c02df280>] (netif_receive_skb+0x48/0xb4) from [<c02df824>]
      (napi_gro_flush+0x70/0x94)
      [<c02df824>] (napi_gro_flush+0x70/0x94) from [<c02df864>]
      (napi_complete+0x1c/0x34)
      [<c02df864>] (napi_complete+0x1c/0x34) from [<c0278524>]
      (stmmac_poll+0x4e8/0x5c8)
      [<c0278524>] (stmmac_poll+0x4e8/0x5c8) from [<c02df940>]
      (net_rx_action+0xc4/0x1e4)
      [<c02df940>] (net_rx_action+0xc4/0x1e4) from [<c00258f0>]
      (__do_softirq+0x12c/0x2e8)
      [<c00258f0>] (__do_softirq+0x12c/0x2e8) from [<c0025da8>] (irq_exit+0x78/0xac)
      [<c0025da8>] (irq_exit+0x78/0xac) from [<c000f020>] (handle_IRQ+0x44/0x90)
      [<c000f020>] (handle_IRQ+0x44/0x90) from [<c0008530>]
      (gic_handle_irq+0x2c/0x5c)
      [<c0008530>] (gic_handle_irq+0x2c/0x5c) from [<c0012f3c>]
      (__irq_usr+0x3c/0x60)
      
      3) The driver was setting the dma buffer size after allocating dma buffers,
      which caused a system panic when changing the MTU.
      
      BUG: Bad page state in process ifconfig  pfn:2e850
      page:c0b72a00 count:0 mapcount:0 mapping:  (null) index:0x0
      page flags: 0x200(arch_1)
      Modules linked in:
      CPU: 0 PID: 566 Comm: ifconfig Not tainted 3.13.0-rc6-01523-gf7111b9 #29
      [<c001547c>] (unwind_backtrace+0x0/0xf8) from [<c00122dc>]
      (show_stack+0x10/0x14)
      [<c00122dc>] (show_stack+0x10/0x14) from [<c03c793c>] (dump_stack+0x70/0x88)
      [<c03c793c>] (dump_stack+0x70/0x88) from [<c00b2620>] (bad_page+0xc8/0x118)
      [<c00b2620>] (bad_page+0xc8/0x118) from [<c00b302c>]
      (get_page_from_freelist+0x744/0x870)
      [<c00b302c>] (get_page_from_freelist+0x744/0x870) from [<c00b40f4>]
      (__alloc_pages_nodemask+0x118/0x86c)
      [<c00b40f4>] (__alloc_pages_nodemask+0x118/0x86c) from [<c00b4858>]
      (__get_free_pages+0x10/0x54)
      [<c00b4858>] (__get_free_pages+0x10/0x54) from [<c00cba1c>]
      (kmalloc_order_trace+0x24/0xa0)
      [<c00cba1c>] (kmalloc_order_trace+0x24/0xa0) from [<c02d199c>]
      (__kmalloc_reserve.isra.21+0x24/0x70)
      [<c02d199c>] (__kmalloc_reserve.isra.21+0x24/0x70) from [<c02d240c>]
      (__alloc_skb+0x68/0x13c)
      [<c02d240c>] (__alloc_skb+0x68/0x13c) from [<c02d3930>]
      (__netdev_alloc_skb+0x3c/0xe8)
      [<c02d3930>] (__netdev_alloc_skb+0x3c/0xe8) from [<c0279378>]
      (stmmac_open+0x63c/0x1024)
      [<c0279378>] (stmmac_open+0x63c/0x1024) from [<c02e18cc>]
      (__dev_open+0xa0/0xfc)
      [<c02e18cc>] (__dev_open+0xa0/0xfc) from [<c02e1b40>]
      (__dev_change_flags+0x94/0x158)
      [<c02e1b40>] (__dev_change_flags+0x94/0x158) from [<c02e1c24>]
      (dev_change_flags+0x18/0x48)
      [<c02e1c24>] (dev_change_flags+0x18/0x48) from [<c0337bc0>]
      (devinet_ioctl+0x638/0x700)
      [<c0337bc0>] (devinet_ioctl+0x638/0x700) from [<c02c7aec>]
      (sock_ioctl+0x64/0x290)
      [<c02c7aec>] (sock_ioctl+0x64/0x290) from [<c0100890>]
      (do_vfs_ioctl+0x78/0x5b8)
      [<c0100890>] (do_vfs_ioctl+0x78/0x5b8) from [<c0100e0c>] (SyS_ioctl+0x3c/0x5c)
      [<c0100e0c>] (SyS_ioctl+0x3c/0x5c) from [<c000e760>]
      
      The fixes have been verified using reproducible, automated testing.
      Signed-off-by: NVince Bridgers <vbridgers2013@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2618abb7
  22. 20 1月, 2014 6 次提交
  23. 17 1月, 2014 2 次提交
  24. 20 12月, 2013 1 次提交
  25. 06 9月, 2013 1 次提交
  26. 31 8月, 2013 2 次提交
  27. 29 8月, 2013 1 次提交
  28. 25 7月, 2013 1 次提交