1. 11 5月, 2019 1 次提交
    • P
      net: ethernet: fix similar warning reported by kbuild test robot · 2d2924af
      Petr Štetiar 提交于
      This patch fixes following (similar) warning reported by kbuild test robot:
      
       In function ‘memcpy’,
        inlined from ‘smsc75xx_init_mac_address’ at drivers/net/usb/smsc75xx.c:778:3,
        inlined from ‘smsc75xx_bind’ at drivers/net/usb/smsc75xx.c:1501:2:
        ./include/linux/string.h:355:9: warning: argument 2 null where non-null expected [-Wnonnull]
        return __builtin_memcpy(p, q, size);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
        drivers/net/usb/smsc75xx.c: In function ‘smsc75xx_bind’:
        ./include/linux/string.h:355:9: note: in a call to built-in function ‘__builtin_memcpy’
      
      I've replaced the offending memcpy with ether_addr_copy, because I'm
      100% sure, that of_get_mac_address can't return NULL as it returns valid
      pointer or ERR_PTR encoded value, nothing else.
      
      I'm hesitant to just change IS_ERR into IS_ERR_OR_NULL check, as this
      would make the warning disappear also, but it would be confusing to
      check for impossible return value just to make a compiler happy.
      
      I'm now changing all occurencies of memcpy to ether_addr_copy after the
      of_get_mac_address call, as it's very likely, that we're going to get
      similar reports from kbuild test robot in the future.
      
      Fixes: a51645f7 ("net: ethernet: support of_get_mac_address new ERR_PTR error")
      Reported-by: Nkbuild test robot <lkp@intel.com>
      Signed-off-by: NPetr Štetiar <ynezz@true.cz>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2d2924af
  2. 08 5月, 2019 1 次提交
  3. 25 4月, 2019 1 次提交
  4. 02 4月, 2019 1 次提交
    • F
      net: move skb->xmit_more hint to softnet data · 6b16f9ee
      Florian Westphal 提交于
      There are two reasons for this.
      
      First, the xmit_more flag conceptually doesn't fit into the skb, as
      xmit_more is not a property related to the skb.
      Its only a hint to the driver that the stack is about to transmit another
      packet immediately.
      
      Second, it was only done this way to not have to pass another argument
      to ndo_start_xmit().
      
      We can place xmit_more in the softnet data, next to the device recursion.
      The recursion counter is already written to on each transmit. The "more"
      indicator is placed right next to it.
      
      Drivers can use the netdev_xmit_more() helper instead of skb->xmit_more
      to check the "more packets coming" hint.
      
      skb->xmit_more is retained (but always 0) to not cause build breakage.
      
      This change takes care of the simple s/skb->xmit_more/netdev_xmit_more()/
      conversions.  Remaining drivers are converted in the next patches.
      Suggested-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6b16f9ee
  5. 29 3月, 2019 1 次提交
    • M
      net: mvneta: Add 2500BaseT support · eda3d1b0
      Maxime Chevallier 提交于
      Some PHYs will use the 2500BaseX PHY_INTERFACE_MODE when being linked
      with a partner using 2.5GBaseT.
      
      Since we can't autonegotiate this speed between the MAC and the PHY, we
      need to have the proper comphy support enabled, to make sure we can
      safely advertise 2.5G and 1G in BaseT and be able to switch between both
      corresponding PHY interface modes. This is now possible since comphy
      support was added to this driver.
      
      This commit adds the 2500BaseT mode to the list of supported modes when
      using 2500BaseX, and was tested on a setup with an Armada385 and a
      88E2010 PHY, both with and without the comphy node in the DT.
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eda3d1b0
  6. 02 3月, 2019 1 次提交
    • M
      net: marvell: neta: disable comphy when setting mode · 031b922b
      Marek Behún 提交于
      The comphy driver for Armada 3700 by Miquèl Raynal (which is currently
      in linux-next) does not actually set comphy mode when phy_set_mode_ext
      is called. The mode is set at next call of phy_power_on.
      
      Update the driver to semantics similar to mvpp2: helper
      mvneta_comphy_init sets comphy mode and powers it on.
      When mode is to be changed in mvneta_mac_config, first power the comphy
      off, then call mvneta_comphy_init (which sets the mode to new one).
      
      Only do this when new mode is different from old mode.
      
      This should also work for Armada 38x, since in that comphy driver
      methods power_on and power_off are unimplemented.
      Signed-off-by: NMarek Behún <marek.behun@nic.cz>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      031b922b
  7. 21 2月, 2019 1 次提交
    • R
      net: marvell: mvneta: fix DMA debug warning · a8fef9ba
      Russell King 提交于
      Booting 4.20 on SolidRun Clearfog issues this warning with DMA API
      debug enabled:
      
      WARNING: CPU: 0 PID: 555 at kernel/dma/debug.c:1230 check_sync+0x514/0x5bc
      mvneta f1070000.ethernet: DMA-API: device driver tries to sync DMA memory it has not allocated [device address=0x000000002dd7dc00] [size=240 bytes]
      Modules linked in: ahci mv88e6xxx dsa_core xhci_plat_hcd xhci_hcd devlink armada_thermal marvell_cesa des_generic ehci_orion phy_armada38x_comphy mcp3021 spi_orion evbug sfp mdio_i2c ip_tables x_tables
      CPU: 0 PID: 555 Comm: bridge-network- Not tainted 4.20.0+ #291
      Hardware name: Marvell Armada 380/385 (Device Tree)
      [<c0019638>] (unwind_backtrace) from [<c0014888>] (show_stack+0x10/0x14)
      [<c0014888>] (show_stack) from [<c07f54e0>] (dump_stack+0x9c/0xd4)
      [<c07f54e0>] (dump_stack) from [<c00312bc>] (__warn+0xf8/0x124)
      [<c00312bc>] (__warn) from [<c00313b0>] (warn_slowpath_fmt+0x38/0x48)
      [<c00313b0>] (warn_slowpath_fmt) from [<c00b0370>] (check_sync+0x514/0x5bc)
      [<c00b0370>] (check_sync) from [<c00b04f8>] (debug_dma_sync_single_range_for_cpu+0x6c/0x74)
      [<c00b04f8>] (debug_dma_sync_single_range_for_cpu) from [<c051bd14>] (mvneta_poll+0x298/0xf58)
      [<c051bd14>] (mvneta_poll) from [<c0656194>] (net_rx_action+0x128/0x424)
      [<c0656194>] (net_rx_action) from [<c000a230>] (__do_softirq+0xf0/0x540)
      [<c000a230>] (__do_softirq) from [<c00386e0>] (irq_exit+0x124/0x144)
      [<c00386e0>] (irq_exit) from [<c009b5e0>] (__handle_domain_irq+0x58/0xb0)
      [<c009b5e0>] (__handle_domain_irq) from [<c03a63c4>] (gic_handle_irq+0x48/0x98)
      [<c03a63c4>] (gic_handle_irq) from [<c0009a10>] (__irq_svc+0x70/0x98)
      ...
      
      This appears to be caused by mvneta_rx_hwbm() calling
      dma_sync_single_range_for_cpu() with the wrong struct device pointer,
      as the buffer manager device pointer is used to map and unmap the
      buffer.  Fix this.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a8fef9ba
  8. 08 2月, 2019 1 次提交
  9. 17 12月, 2018 1 次提交
    • M
      net: mvneta: fix operation for 64K PAGE_SIZE · e735fd55
      Marcin Wojtas 提交于
      Recent changes in the mvneta driver reworked allocation
      and handling of the ingress buffers to use entire pages.
      Apart from that in SW BM scenario the HW must be informed
      via PRXDQS about the biggest possible incoming buffer
      that can be propagated by RX descriptors.
      
      The BufferSize field was filled according to the MTU-dependent
      pkt_size value. Later change to PAGE_SIZE broke RX operation
      when usin 64K pages, as the field is simply too small.
      
      This patch conditionally limits the value passed to the BufferSize
      of the PRXDQS register, depending on the PAGE_SIZE used.
      On the occasion remove now unused frag_size field of the mvneta_port
      structure.
      
      Fixes: 562e2f46 ("net: mvneta: Improve the buffer allocation method for SWBM")
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e735fd55
  10. 24 11月, 2018 1 次提交
  11. 17 11月, 2018 1 次提交
  12. 10 11月, 2018 1 次提交
  13. 27 9月, 2018 1 次提交
    • M
      net: mvneta: Add support for 2500Mbps SGMII · da58a931
      Maxime Chevallier 提交于
      The mvneta controller can handle speeds up to 2500Mbps on the SGMII
      interface. This relies on serdes configuration, the lane must be
      configured at 3.125Gbps and we can't use in-band autoneg at that speed.
      
      The main issue when supporting that speed on this particular controller
      is that the link partner can send ethernet frames with a shortened
      preamble, which if not explicitly enabled in the controller will cause
      unexpected behaviours.
      
      This was tested on Armada 385, with the comphy configuration done in
      bootloader.
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      da58a931
  14. 25 9月, 2018 1 次提交
  15. 20 9月, 2018 3 次提交
  16. 03 9月, 2018 3 次提交
  17. 11 8月, 2018 1 次提交
  18. 29 7月, 2018 8 次提交
  19. 23 6月, 2018 1 次提交
    • A
      net: mvneta: fix the Rx desc DMA address in the Rx path · 271f7ff5
      Antoine Tenart 提交于
      When using s/w buffer management, buffers are allocated and DMA mapped.
      When doing so on an arm64 platform, an offset correction is applied on
      the DMA address, before storing it in an Rx descriptor. The issue is
      this DMA address is then used later in the Rx path without removing the
      offset correction. Thus the DMA address is wrong, which can led to
      various issues.
      
      This patch fixes this by removing the offset correction from the DMA
      address retrieved from the Rx descriptor before using it in the Rx path.
      
      Fixes: 8d5047cf ("net: mvneta: Convert to be 64 bits compatible")
      Signed-off-by: NAntoine Tenart <antoine.tenart@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      271f7ff5
  20. 02 4月, 2018 2 次提交
  21. 31 3月, 2018 2 次提交
  22. 30 3月, 2018 2 次提交
  23. 27 3月, 2018 1 次提交
  24. 03 1月, 2018 3 次提交