1. 13 7月, 2017 1 次提交
  2. 12 7月, 2017 15 次提交
  3. 11 7月, 2017 1 次提交
  4. 08 7月, 2017 4 次提交
    • G
      net: ethernet: mediatek: remove useless code in mtk_probe() · e8df7603
      Gustavo A. R. Silva 提交于
      Remove useless local variables _match_, _soc_ and the code related.
      
      Notice that
      
      const struct of_device_id of_mtk_match[] = {
              { .compatible = "mediatek,mt2701-eth" },
              {},
      };
      
      So match->data is NULL.
      Suggested-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NGustavo A. R. Silva <garsilva@embeddedor.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e8df7603
    • Y
      net: hns: Fix a skb used after free bug · 27463ad9
      Yunsheng Lin 提交于
      skb maybe freed in hns_nic_net_xmit_hw() and return NETDEV_TX_OK,
      which cause hns_nic_net_xmit to use a freed skb.
      
      BUG: KASAN: use-after-free in hns_nic_net_xmit_hw+0x62c/0x940...
      	[17659.112635]      alloc_debug_processing+0x18c/0x1a0
      	[17659.117208]      __slab_alloc+0x52c/0x560
      	[17659.120909]      kmem_cache_alloc_node+0xac/0x2c0
      	[17659.125309]      __alloc_skb+0x6c/0x260
      	[17659.128837]      tcp_send_ack+0x8c/0x280
      	[17659.132449]      __tcp_ack_snd_check+0x9c/0xf0
      	[17659.136587]      tcp_rcv_established+0x5a4/0xa70
      	[17659.140899]      tcp_v4_do_rcv+0x27c/0x620
      	[17659.144687]      tcp_prequeue_process+0x108/0x170
      	[17659.149085]      tcp_recvmsg+0x940/0x1020
      	[17659.152787]      inet_recvmsg+0x124/0x180
      	[17659.156488]      sock_recvmsg+0x64/0x80
      	[17659.160012]      SyS_recvfrom+0xd8/0x180
      	[17659.163626]      __sys_trace_return+0x0/0x4
      	[17659.167506] INFO: Freed in kfree_skbmem+0xa0/0xb0 age=23 cpu=1 pid=13
      	[17659.174000]      free_debug_processing+0x1d4/0x2c0
      	[17659.178486]      __slab_free+0x240/0x390
      	[17659.182100]      kmem_cache_free+0x24c/0x270
      	[17659.186062]      kfree_skbmem+0xa0/0xb0
      	[17659.189587]      __kfree_skb+0x28/0x40
      	[17659.193025]      napi_gro_receive+0x168/0x1c0
      	[17659.197074]      hns_nic_rx_up_pro+0x58/0x90
      	[17659.201038]      hns_nic_rx_poll_one+0x518/0xbc0
      	[17659.205352]      hns_nic_common_poll+0x94/0x140
      	[17659.209576]      net_rx_action+0x458/0x5e0
      	[17659.213363]      __do_softirq+0x1b8/0x480
      	[17659.217062]      run_ksoftirqd+0x64/0x80
      	[17659.220679]      smpboot_thread_fn+0x224/0x310
      	[17659.224821]      kthread+0x150/0x170
      	[17659.228084]      ret_from_fork+0x10/0x40
      
      	BUG: KASAN: use-after-free in hns_nic_net_xmit+0x8c/0xc0...
      	[17751.080490]      __slab_alloc+0x52c/0x560
      	[17751.084188]      kmem_cache_alloc+0x244/0x280
      	[17751.088238]      __build_skb+0x40/0x150
      	[17751.091764]      build_skb+0x28/0x100
      	[17751.095115]      __alloc_rx_skb+0x94/0x150
      	[17751.098900]      __napi_alloc_skb+0x34/0x90
      	[17751.102776]      hns_nic_rx_poll_one+0x180/0xbc0
      	[17751.107097]      hns_nic_common_poll+0x94/0x140
      	[17751.111333]      net_rx_action+0x458/0x5e0
      	[17751.115123]      __do_softirq+0x1b8/0x480
      	[17751.118823]      run_ksoftirqd+0x64/0x80
      	[17751.122437]      smpboot_thread_fn+0x224/0x310
      	[17751.126575]      kthread+0x150/0x170
      	[17751.129838]      ret_from_fork+0x10/0x40
      	[17751.133454] INFO: Freed in kfree_skbmem+0xa0/0xb0 age=19 cpu=7 pid=43
      	[17751.139951]      free_debug_processing+0x1d4/0x2c0
      	[17751.144436]      __slab_free+0x240/0x390
      	[17751.148051]      kmem_cache_free+0x24c/0x270
      	[17751.152014]      kfree_skbmem+0xa0/0xb0
      	[17751.155543]      __kfree_skb+0x28/0x40
      	[17751.159022]      napi_gro_receive+0x168/0x1c0
      	[17751.163074]      hns_nic_rx_up_pro+0x58/0x90
      	[17751.167041]      hns_nic_rx_poll_one+0x518/0xbc0
      	[17751.171358]      hns_nic_common_poll+0x94/0x140
      	[17751.175585]      net_rx_action+0x458/0x5e0
      	[17751.179373]      __do_softirq+0x1b8/0x480
      	[17751.183076]      run_ksoftirqd+0x64/0x80
      	[17751.186691]      smpboot_thread_fn+0x224/0x310
      	[17751.190826]      kthread+0x150/0x170
      	[17751.194093]      ret_from_fork+0x10/0x40
      
      Fixes: 13ac695e ("net:hns: Add support of Hip06 SoC to the Hislicon Network Subsystem")
      Signed-off-by: NYunsheng Lin <linyunsheng@huawei.com>
      Signed-off-by: Nlipeng <lipeng321@huawei.com>
      Reported-by: NJun He <hjat2005@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      27463ad9
    • Y
      net: hns: Fix a wrong op phy C45 code · ebe8d359
      Yunsheng Lin 提交于
      As the user manual described, the second step to write to C45 phy
      by mdio should be data, but not address. Here we should fix this
      issue.
      
      Fixes: 5b904d39 ("net: add Hisilicon Network Subsystem MDIO support")
      Signed-off-by: NYunsheng Lin <linyunsheng@huawei.com>
      Reviewed-by: Nlipeng <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ebe8d359
    • V
      net: macb: Adding Support for Jumbo Frames up to 10240 Bytes in SAMA5D3 · 233a1587
      vishnuvardhan 提交于
      As per the SAMA5D3 device specification it supports Jumbo frames.
      But the suggested flag and length of bytes it supports was not updated
      in this driver config_structure.
      The maximum jumbo frames the device supports :
      10240 bytes as per the device spec.
      
      While changing the MTU value greater than 1500, it threw error:
      sudo ifconfig eth1 mtu 9000
      SIOCSIFMTU: Invalid argument
      
      Add this support to driver so that it works as expected and designed.
      Signed-off-by: Nvishnuvardhan <vardhanraj4143@gmail.com>
      [nicolas.ferre@microchip.com: modify slightly commit msg]
      Signed-off-by: NNicolas Ferre <nicolas.ferre@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      233a1587
  5. 07 7月, 2017 1 次提交
  6. 06 7月, 2017 8 次提交
  7. 05 7月, 2017 7 次提交
  8. 04 7月, 2017 2 次提交
    • S
      net: ethernet: mediatek: fixed deadlock captured by lockdep · 8d32e062
      Sean Wang 提交于
      Lockdep found an inconsistent lock state when mtk_get_stats64 is called
      in user context while NAPI updates MAC statistics in softirq.
      
      Use spin_trylock_bh/spin_unlock_bh fix following lockdep warning.
      
      [   81.321030] WARNING: inconsistent lock state
      [   81.325266] 4.12.0-rc1-00035-gd9dda65 #32 Not tainted
      [   81.330273] --------------------------------
      [   81.334505] inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
      [   81.340464] ksoftirqd/0/7 [HC0[0]:SC1[1]:HE1:SE0] takes:
      [   81.345731]  (&syncp->seq#2){+.?...}, at: [<c054ba3c>] mtk_handle_status_irq.part.6+0x70/0x84
      [   81.354219] {SOFTIRQ-ON-W} state was registered at:
      [   81.359062]   lock_acquire+0xfc/0x2b0
      [   81.362696]   mtk_stats_update_mac+0x60/0x2c0
      [   81.367017]   mtk_get_stats64+0x17c/0x18c
      [   81.370995]   dev_get_stats+0x48/0xbc
      [   81.374628]   rtnl_fill_stats+0x48/0x128
      [   81.378520]   rtnl_fill_ifinfo+0x4ac/0xd1c
      [   81.382584]   rtmsg_ifinfo_build_skb+0x7c/0xe0
      [   81.386991]   rtmsg_ifinfo.part.5+0x24/0x54
      [   81.391139]   rtmsg_ifinfo+0x24/0x28
      [   81.394685]   __dev_notify_flags+0xa4/0xac
      [   81.398749]   dev_change_flags+0x50/0x58
      [   81.402640]   devinet_ioctl+0x768/0x85c
      [   81.406444]   inet_ioctl+0x1a4/0x1d0
      [   81.409990]   sock_ioctl+0x16c/0x33c
      [   81.413538]   do_vfs_ioctl+0xb4/0xa34
      [   81.417169]   SyS_ioctl+0x44/0x6c
      [   81.420458]   ret_fast_syscall+0x0/0x1c
      [   81.424260] irq event stamp: 3354692
      [   81.427806] hardirqs last  enabled at (3354692): [<c0678168>] net_rx_action+0xc0/0x504
      [   81.435660] hardirqs last disabled at (3354691): [<c0678134>] net_rx_action+0x8c/0x504
      [   81.443515] softirqs last  enabled at (3354106): [<c0101944>] __do_softirq+0x4b4/0x614
      [   81.451370] softirqs last disabled at (3354109): [<c012f0c4>] run_ksoftirqd+0x44/0x80
      [   81.459134]
      [   81.459134] other info that might help us debug this:
      [   81.465608]  Possible unsafe locking scenario:
      [   81.465608]
      [   81.471478]        CPU0
      [   81.473900]        ----
      [   81.476321]   lock(&syncp->seq#2);
      [   81.479701]   <Interrupt>
      [   81.482294]     lock(&syncp->seq#2);
      [   81.485847]
      [   81.485847]  *** DEADLOCK ***
      [   81.485847]
      [   81.491720] 1 lock held by ksoftirqd/0/7:
      [   81.495693]  #0:  (&(&mac->hw_stats->stats_lock)->rlock){+.+...}, at: [<c054ba14>] mtk_handle_status_irq.part.6+0x48/0x84
      [   81.506579]
      [   81.506579] stack backtrace:
      [   81.510904] CPU: 0 PID: 7 Comm: ksoftirqd/0 Not tainted 4.12.0-rc1-00035-gd9dda65 #32
      [   81.518668] Hardware name: Mediatek Cortex-A7 (Device Tree)
      [   81.524208] [<c0113dc4>] (unwind_backtrace) from [<c010e3f0>] (show_stack+0x20/0x24)
      [   81.531899] [<c010e3f0>] (show_stack) from [<c03f9c64>] (dump_stack+0xb4/0xe0)
      [   81.539072] [<c03f9c64>] (dump_stack) from [<c017e970>] (print_usage_bug+0x234/0x2e0)
      [   81.546846] [<c017e970>] (print_usage_bug) from [<c017f058>] (mark_lock+0x63c/0x7bc)
      [   81.554532] [<c017f058>] (mark_lock) from [<c017fe90>] (__lock_acquire+0x654/0x1bfc)
      [   81.562217] [<c017fe90>] (__lock_acquire) from [<c0181d04>] (lock_acquire+0xfc/0x2b0)
      [   81.569990] [<c0181d04>] (lock_acquire) from [<c054b76c>] (mtk_stats_update_mac+0x60/0x2c0)
      [   81.578283] [<c054b76c>] (mtk_stats_update_mac) from [<c054ba3c>] (mtk_handle_status_irq.part.6+0x70/0x84)
      [   81.587865] [<c054ba3c>] (mtk_handle_status_irq.part.6) from [<c054c2b8>] (mtk_napi_tx+0x358/0x37c)
      [   81.596845] [<c054c2b8>] (mtk_napi_tx) from [<c06782ec>] (net_rx_action+0x244/0x504)
      [   81.604533] [<c06782ec>] (net_rx_action) from [<c01015c4>] (__do_softirq+0x134/0x614)
      [   81.612306] [<c01015c4>] (__do_softirq) from [<c012f0c4>] (run_ksoftirqd+0x44/0x80)
      [   81.619907] [<c012f0c4>] (run_ksoftirqd) from [<c0154680>] (smpboot_thread_fn+0x14c/0x25c)
      [   81.628110] [<c0154680>] (smpboot_thread_fn) from [<c014f8cc>] (kthread+0x150/0x180)
      [   81.635798] [<c014f8cc>] (kthread) from [<c0109290>] (ret_from_fork+0x14/0x24)
      Signed-off-by: NSean Wang <sean.wang@mediatek.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8d32e062
    • M
      qed: initialize ll2_syn_handle at start of function · 25f4535a
      Michal Kalderon 提交于
      Fix compilation warning
      qed_iwarp.c:1721:5: warning: ll2_syn_handle may be used
      uninitialized in this function
      Signed-off-by: NMichal Kalderon <Michal.Kalderon@cavium.com>
      Signed-off-by: NAriel Elior <Ariel.Elior@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      25f4535a
  9. 03 7月, 2017 1 次提交