1. 14 4月, 2016 35 次提交
  2. 13 4月, 2016 5 次提交
    • D
      Merge branch 'mediatek-stress-test-fixes' · b30d27f5
      David S. Miller 提交于
      John Crispin says:
      
      ====================
      net: mediatek: make the driver pass stress tests
      
      While testing the driver we managed to get the TX path to stall and fail
      to recover. When dual MAC support was added to the driver, the whole queue
      stop/wake code was not properly adapted. There was also a regression in the
      locking of the xmit function. The fact that watchdog_timeo was not set and
      that the tx_timeout code failed to properly reset the dma, irq and queue
      just made the mess complete.
      
      This series make the driver pass stress testing. With this series applied
      the testbed has been running for several days and still has not locked up.
      We have a second setup that has a small hack patch applied to randomly stop
      irqs and/or one of the queues and successfully manages to recover from these
      simulated tx stalls.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b30d27f5
    • J
      net: mediatek: do not set the QID field in the TX DMA descriptors · 369f0453
      John Crispin 提交于
      The QID field gets set to the mac id. This made the DMA linked list queue
      the traffic of each MAC on a different internal queue. However during long
      term testing we found that this will cause traffic stalls as the multi
      queue setup requires a more complete initialisation which is not part of
      the upstream driver yet.
      
      This patch removes the code setting the QID field, resulting in all
      traffic ending up in queue 0 which works without any special setup.
      Signed-off-by: NJohn Crispin <blogic@openwrt.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      369f0453
    • J
      net: mediatek: move the pending_work struct to the device generic struct · 7c78b4ad
      John Crispin 提交于
      The worker always touches both netdevs. It is ethernet core and not MAC
      specific. We only need one worker, which belongs into the ethernets core
      struct.
      Signed-off-by: NJohn Crispin <blogic@openwrt.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7c78b4ad
    • J
      net: mediatek: fix mtk_pending_work · e7d425dc
      John Crispin 提交于
      The driver supports 2 MACs. Both run on the same DMA ring. If we hit a TX
      timeout we need to stop both netdevs before restarting them again. If we
      don't do this, mtk_stop() wont shutdown DMA and the consecutive call to
      mtk_open() wont restart DMA and enable IRQs.
      Signed-off-by: NJohn Crispin <blogic@openwrt.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e7d425dc
    • J
      net: mediatek: fix TX locking · 34c2e4c9
      John Crispin 提交于
      Inside the TX path there is a lock inside the tx_map function. This is
      however too late. The patch moves the lock to the start of the xmit
      function right before the free count check of the DMA ring happens.
      If we do not do this, the code becomes racy leading to TX stalls and
      dropped packets. This happens as there are 2 netdevs running on the
      same physical DMA ring.
      Signed-off-by: NJohn Crispin <blogic@openwrt.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      34c2e4c9