1. 20 Apr, 2017 7 commits
    • David S. Miller's avatar
      Merge branch 'dsa-LAN9303' · 0ef9059d
      David S. Miller authored
      Juergen Borleis says:
      
      ====================
      net: dsa: add SMSC/Microchip LAN9303 three port ethernet switch driver
      
      The LAN9303 is a three port 10/100 ethernet switch with integrated phys
      for the two external ethernet ports. The third port is an RMII/MII
      interface to a host master network interface (e.g. fixed link).
      
      While the LAN9303 device itself supports offload packet processing, this
      driver does not make use of it yet. This driver just configures the device
      to provide two separate network interfaces (which is the default state of
      a DSA device).
      
      Please note: the "MDIO managed mode" driver part isn't tested yet. I have
      used and tested the "I2C managed mode" only.
      
      Changes in v6:
      
      - fix support to use the driver as a module (core, i2c and mdio)
      - license info added in all parts of the driver (for module support)
      
      Changes in v5:
      
      - add missing include file to 'net/dsa/tag_lan9303.c'
      
      Changes in v4:
      
      - rebased on net-next, 'net/dsa/tag_lan9303.c' adapted to changed API
      
      Changes in v3:
      
      - 'ds_to_lan9303()' removed
      - special PHY reg MII_LAN911X_SPECIAL_CONTROL_STATUS mapping removed
      - compatible strings for I2C and MDIO are now different
      - MDIO-managed-mode devicetree binding added (still compile time tested only)
      
      Changes in v2:
      
      - code moved to 'drivers/net/dsa'
      - timeouts in completion wait loops
      - macros instead of various magic numbers
      - development code removed
      - devicetree property names changed
      - devicetree example adapted
      - tried to avoid to mix 'switching' and 'forwarding'...
      
      Comments are welcome.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0ef9059d
    • Juergen Beisert's avatar
      net: dsa: LAN9303: add MDIO managed mode support · dc700583
      Juergen Beisert authored
      When the LAN9303 device is in MDIO manged mode, all register accesses must
      be done via MDIO.
      
      Please note: this code is compile time tested only due to the absence of such
      configured hardware. It is based on a patch from Stefan Roese from 2014.
      Signed-off-by: default avatarJuergen Borleis <jbe@pengutronix.de>
      CC: devicetree@vger.kernel.org
      CC: robh+dt@kernel.org
      CC: mark.rutland@arm.com
      CC: sr@denx.de
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dc700583
    • Juergen Beisert's avatar
      net: dsa: LAN9303: add I2C managed mode support · be4e119f
      Juergen Beisert authored
      In this mode the switch device and the internal phys will be managed via
      I2C interface. The MDIO interface is still supported, but for the
      (emulated) CPU port only.
      Signed-off-by: default avatarJuergen Borleis <jbe@pengutronix.de>
      CC: devicetree@vger.kernel.org
      CC: robh+dt@kernel.org
      CC: mark.rutland@arm.com
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      be4e119f
    • Juergen Beisert's avatar
      net: dsa: add new DSA switch driver for the SMSC-LAN9303 · a1292595
      Juergen Beisert authored
      The SMSC/Microchip LAN9303 is an ethernet switch device with one CPU port
      and two external ethernet ports with built-in phys.
      
      This driver uses the DSA framework, but is currently only capable of
      separating the two external ports. There is no offload support yet.
      Signed-off-by: default avatarJuergen Borleis <jbe@pengutronix.de>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a1292595
    • Juergen Beisert's avatar
      net: dsa: add support for the SMSC-LAN9303 tagging format · e8fe177a
      Juergen Beisert authored
      To define the outgoing port and to discover the incoming port a regular
      VLAN tag is used by the LAN9303. But its VID meaning is 'special'.
      
      This tag handler/filter depends on some hardware features which must be
      enabled in the device to provide and make use of this special VLAN tag
      to control the destination and the source of an ethernet packet.
      Signed-off-by: default avatarJuergen Borleis <jbe@pengutronix.de>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e8fe177a
    • Greg Thelen's avatar
      net/mlx4: suppress 'may be used uninitialized' warning · 8dc7d11f
      Greg Thelen authored
      gcc 4.8.4 complains that mlx4_SW2HW_MPT_wrapper() uses an uninitialized
      'mpt' variable:
        drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'mlx4_SW2HW_MPT_wrapper':
        drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:2802:12: warning: 'mpt' may be used uninitialized in this function [-Wmaybe-uninitialized]
           mpt->mtt = mtt;
      
      I think this warning is a false complaint.  mpt is only used when
      mr_res_start_move_to() return zero, and in all such cases it initializes
      mpt.  But apparently gcc cannot see that.
      
      Initialize mpt to avoid the warning.
      Signed-off-by: default avatarGreg Thelen <gthelen@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8dc7d11f
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 7b9f6da1
      David S. Miller authored
      A function in kernel/bpf/syscall.c which got a bug fix in 'net'
      was moved to kernel/bpf/verifier.c in 'net-next'.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7b9f6da1
  2. 19 Apr, 2017 1 commit
    • Sergei Shtylyov's avatar
      sh_eth: unmap DMA buffers when freeing rings · 1debdc8f
      Sergei Shtylyov authored
      The DMA API debugging (when enabled) causes:
      
      WARNING: CPU: 0 PID: 1445 at lib/dma-debug.c:519 add_dma_entry+0xe0/0x12c
      DMA-API: exceeded 7 overlapping mappings of cacheline 0x01b2974d
      
      to be  printed after repeated initialization of the Ether device, e.g.
      suspend/resume or 'ifconfig' up/down. This is because DMA buffers mapped
      using dma_map_single() in sh_eth_ring_format() and sh_eth_start_xmit() are
      never unmapped. Resolve this problem by unmapping the buffers when freeing
      the descriptor  rings;  in order  to do it right, we'd have to add an extra
      parameter to sh_eth_txfree() (we rename this function to sh_eth_tx_free(),
      while at it).
      
      Based on the commit a47b70ea ("ravb: unmap descriptors when freeing
      rings").
      Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1debdc8f
  3. 18 Apr, 2017 32 commits