1. 08 8月, 2018 1 次提交
  2. 07 7月, 2018 2 次提交
  3. 28 6月, 2018 1 次提交
    • A
      net: macb: initialize bp->queues[0].bp for at91rm9200 · fec9d3b1
      Alexandre Belloni 提交于
      The macb driver currently crashes on at91rm9200 with the following trace:
      
      Unable to handle kernel NULL pointer dereference at virtual address 00000014
      [...]
      [<c031da44>] (macb_rx_desc) from [<c031f2bc>] (at91ether_open+0x2e8/0x3f8)
      [<c031f2bc>] (at91ether_open) from [<c041e8d8>] (__dev_open+0x120/0x13c)
      [<c041e8d8>] (__dev_open) from [<c041ec08>] (__dev_change_flags+0x17c/0x1a8)
      [<c041ec08>] (__dev_change_flags) from [<c041ec4c>] (dev_change_flags+0x18/0x4c)
      [<c041ec4c>] (dev_change_flags) from [<c07a5f4c>] (ip_auto_config+0x220/0x10b0)
      [<c07a5f4c>] (ip_auto_config) from [<c000a4fc>] (do_one_initcall+0x78/0x18c)
      [<c000a4fc>] (do_one_initcall) from [<c0783e50>] (kernel_init_freeable+0x184/0x1c4)
      [<c0783e50>] (kernel_init_freeable) from [<c0574d70>] (kernel_init+0x8/0xe8)
      [<c0574d70>] (kernel_init) from [<c00090e0>] (ret_from_fork+0x14/0x34)
      
      Solve that by initializing bp->queues[0].bp in at91ether_init (as is done
      in macb_init).
      
      Fixes: ae1f2a56 ("net: macb: Added support for many RX queues")
      Signed-off-by: NAlexandre Belloni <alexandre.belloni@bootlin.com>
      Acked-by: NNicolas Ferre <nicolas.ferre@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fec9d3b1
  4. 17 5月, 2018 1 次提交
  5. 30 3月, 2018 1 次提交
  6. 16 3月, 2018 3 次提交
  7. 30 1月, 2018 1 次提交
  8. 06 12月, 2017 5 次提交
  9. 01 12月, 2017 3 次提交
  10. 11 11月, 2017 2 次提交
  11. 01 11月, 2017 1 次提交
  12. 18 7月, 2017 1 次提交
  13. 08 7月, 2017 1 次提交
  14. 05 7月, 2017 1 次提交
  15. 01 7月, 2017 3 次提交
  16. 26 6月, 2017 1 次提交
  17. 16 6月, 2017 1 次提交
    • J
      networking: introduce and use skb_put_data() · 59ae1d12
      Johannes Berg 提交于
      A common pattern with skb_put() is to just want to memcpy()
      some data into the new space, introduce skb_put_data() for
      this.
      
      An spatch similar to the one for skb_put_zero() converts many
      of the places using it:
      
          @@
          identifier p, p2;
          expression len, skb, data;
          type t, t2;
          @@
          (
          -p = skb_put(skb, len);
          +p = skb_put_data(skb, data, len);
          |
          -p = (t)skb_put(skb, len);
          +p = skb_put_data(skb, data, len);
          )
          (
          p2 = (t2)p;
          -memcpy(p2, data, len);
          |
          -memcpy(p, data, len);
          )
      
          @@
          type t, t2;
          identifier p, p2;
          expression skb, data;
          @@
          t *p;
          ...
          (
          -p = skb_put(skb, sizeof(t));
          +p = skb_put_data(skb, data, sizeof(t));
          |
          -p = (t *)skb_put(skb, sizeof(t));
          +p = skb_put_data(skb, data, sizeof(t));
          )
          (
          p2 = (t2)p;
          -memcpy(p2, data, sizeof(*p));
          |
          -memcpy(p, data, sizeof(*p));
          )
      
          @@
          expression skb, len, data;
          @@
          -memcpy(skb_put(skb, len), data, len);
          +skb_put_data(skb, data, len);
      
      (again, manually post-processed to retain some comments)
      Reviewed-by: NStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      59ae1d12
  18. 01 5月, 2017 1 次提交
  19. 07 4月, 2017 1 次提交
  20. 28 2月, 2017 1 次提交
  21. 31 1月, 2017 1 次提交
  22. 30 1月, 2017 1 次提交
  23. 20 1月, 2017 1 次提交
  24. 17 12月, 2016 1 次提交
  25. 30 11月, 2016 2 次提交
    • Z
      net: macb: ensure ordering write to re-enable RX smoothly · ffac0e96
      Zumeng Chen 提交于
      When a hardware issue happened as described by inline comments, the register
      write pattern looks like the following:
      
      <write ~MACB_BIT(RE)>
      + wmb();
      <write MACB_BIT(RE)>
      
      There might be a memory barrier between these two write operations, so add wmb
      to ensure an flip from 0 to 1 for NCR.
      Signed-off-by: NZumeng Chen <zumeng.chen@windriver.com>
      Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ffac0e96
    • C
      net: macb: fix the RX queue reset in macb_rx() · a0b44eea
      Cyrille Pitchen 提交于
      On macb only (not gem), when a RX queue corruption was detected from
      macb_rx(), the RX queue was reset: during this process the RX ring
      buffer descriptor was initialized by macb_init_rx_ring() but we forgot
      to also set bp->rx_tail to 0.
      
      Indeed, when processing the received frames, bp->rx_tail provides the
      macb driver with the index in the RX ring buffer of the next buffer to
      process. So when the whole ring buffer is reset we must also reset
      bp->rx_tail so the driver is synchronized again with the hardware.
      
      Since macb_init_rx_ring() is called from many locations, currently from
      macb_rx() and macb_init_rings(), we'd rather add the "bp->rx_tail = 0;"
      line inside macb_init_rx_ring() than add the very same line after each
      call of this function.
      
      Without this fix, the rx queue is not reset properly to recover from
      queue corruption and connection drop may occur.
      Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com>
      Fixes: 9ba723b0 ("net: macb: remove BUG_ON() and reset the queue to handle RX errors")
      Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a0b44eea
  26. 19 11月, 2016 1 次提交
  27. 17 11月, 2016 1 次提交