1. 09 2月, 2019 3 次提交
    • R
      net: marvell: mvpp2: only reprogram what is necessary on mac_config · d14e078f
      Russell King 提交于
      mac_config() can be called at any point, and the expected behaviour
      from MAC drivers is to only reprogram when necessary - and certainly
      avoid taking the link down on every call.
      
      Unfortunately, mvpp2 does exactly that - it takes the link down, and
      reprograms everything, and then releases the forced-link down.
      
      This is bad, it can cause the link to bounce:
      
      - SFP detects signal, disables LOS indication.
      - SFP code calls into phylink, calling phylink_sfp_link_up() which
        triggers a resolve.
      - phylink_resolve() calls phylink_get_mac_state() and finds the MAC
        reporting link up.
      - phylink wants to configure the pause mode on the MAC, so calls
        phylink_mac_config()
      - mvpp2 takes the link down temporarily, generating a MAC link down
        event followed by another MAC link event.
      - phylink calls mac_link_up() and then processes the MAC link down
        event.
      - phylink_resolve() gets called again, registers the link down, and
        calls mach_link_down() before re-running itself.
      - phylink_resolve() starts again at step 3 above.  This sequence
        repeats.
      
      GMAC versions prior to mvpp2 do not require the link to be taken down
      except when certain link properties (eg, switching between SGMII and
      1000base-X mode, or enabling/disabling in-band negotiation) are
      changed.  Implement this for mvpp2.
      Tested-by: NSven Auhagen <sven.auhagen@voleatech.de>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d14e078f
    • R
      net: marvell: mvpp2: fix stuck in-band SGMII negotiation · 316734fd
      Russell King 提交于
      It appears that the mvpp22 can get stuck with SGMII negotiation.  The
      symptoms are that in-band negotiation never completes and the partner
      (eg, PHY) never reports SGMII link up, or if it supports negotiation
      bypass, goes into negotiation bypass mode (which will happen when the
      PHY sees that the MAC is alive but gets no response.)
      
      Triggering the PHY end of the link to re-negotiate results in the
      bypass bit clearing on the PHY, and then re-setting - indicating that
      the problem is at the mvpp22 GMAC end.
      
      Asserting the GMAC reset and de-asserting it resolves the issue.
      Arrange to assert the GMAC reset at probe time, and deassert it only
      after we have configured the GMAC for the appropriate mode.  This
      resolves the issue.
      Tested-by: NSven Auhagen <sven.auhagen@voleatech.de>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      316734fd
    • R
      net: marvell: mvpp2: phylink compliance updates · 388ca27f
      Russell King 提交于
      Sven Auhagen reported issues with negotiation on a couple of his
      platforms using a mixture of SFP and PHYs in various different
      modes.  Debugging to root cause proved difficult, but essentially
      the problem comes down to the mvpp2 phylink implementation being
      slightly at odds with what is expected.
      
      phylink operates in three modes: phy, fixed-link, and in-band mode.
      
      In the first two modes, the expected behaviour from a MAC driver is
      that phylink resolves the operating mode and passes the mode to the
      MAC driver for it to program, including when the link should be
      brought up or taken down.  This is basically the same as the libphy
      approach.  This does not negate the requirement to advertise a correct
      control word for interface modes that have control words where that
      can be reasonably controlled.
      
      The second mode is in-band mode, where the MAC is expected to use the
      in-band control word to determine the operating mode.
      
      The mvneta driver implements the correct pattern required to support
      this: configure the port interface type separately from the in-band
      mode(s).  This is now specified in the phylink documentation patches.
      
      mvpp2 was programming in-band mode for SGMII and the 802.3z modes no
      what, and avoided forcing the link up in fixed/phy modes.  This caused
      a problem with some boards where the PHY is by default programmed to
      enter AN bypass mode, the PHY would report that the link was up, but
      the mvpp2 never completed the exchange of control word.
      
      Another issue that mvpp2 has is it sets SGMII AN format control word
      for both SGMII and 802.3z modes. The format of the control word is
      defined by MVPP2_GMAC_INBAND_AN_MASK, which should be set for SGMII
      and clear for 802.3z. Available Marvell documentation for earlier
      GMAC implementations does not make this clear, but this has been
      ascertained via extensive testing on earlier GMAC implementations,
      and then confirmed with a Macchiatobin Single Shot connected to a
      Clearfog: when MVPP2_GMAC_INBAND_AN_MASK is set, the clearfog does
      not receive the advertised pause mode settings.
      
      Lastly, there is no flow control in the in-band control word in Cisco
      SGMII, setting the flow control autonegotiation bit even with a PHY
      that has the Marvell extension to send this information does not result
      in the flow control being enabled at the MAC.  We need to do this
      manually using the information provided via phylink.
      
      Re-code mvpp2's mac_config() and mac_link_up() to follow this pattern.
      This allows Sven Auhagen's board and Macchiatobin to reliably bring
      the link up with the 88e1512 PHY with phylink operating in PHY mode
      with COMPHY built as a module but the rest of the networking built-in,
      and u-boot having brought up the interface.  in-band mode requires an
      additional patch to resolve another problem.
      Tested-by: NSven Auhagen <sven.auhagen@voleatech.de>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      388ca27f
  2. 08 2月, 2019 1 次提交
  3. 06 2月, 2019 2 次提交
    • R
      net: marvell: mvpp2: fix lack of link interrupts · bf2fa125
      Russell King 提交于
      Sven Auhagen reports that if he changes a SFP+ module for a SFP module
      on the Macchiatobin Single Shot, the link does not come back up.  For
      Sven, it is as easy as:
      
      - Insert a SFP+ module connected, and use ping6 to verify link is up.
      - Remove SFP+ module
      - Insert SFP 1000base-X module use ping6 to verify link is up: Link
        up event did not trigger and the link is down
      
      but that doesn't show the problem for me.  Locally, this has been
      reproduced by:
      
      - Boot with no modules.
      - Insert SFP+ module, confirm link is up.
      - Replace module with 25000base-X module.  Confirm link is up.
      - Set remote end down, link is reported as dropped at both ends.
      - Set remote end up, link is reported up at remote end, but not local
        end due to lack of link interrupt.
      
      Fix this by setting up both GMAC and XLG interrupts for port 0, but
      only unmasking the appropriate interrupt according to the current mode
      set in the mac_config() method.  However, only do the mask/unmask
      dance when we are really changing the link mode to avoid missing any
      link interrupts.
      Tested-by: NSven Auhagen <sven.auhagen@voleatech.de>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bf2fa125
    • R
      net: marvell: mvpp2: use phy_interface_mode_is_8023z() helper · 4a4cec72
      Russell King 提交于
      Use the phy_interface_mode_is_8023z() helper for detecting interface
      modes that use 802.3z serial encoding.  This is equivalent to testing
      for both 1000base-X and 2500base-X.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4a4cec72
  4. 02 2月, 2019 1 次提交
  5. 08 1月, 2019 2 次提交
  6. 05 1月, 2019 1 次提交
  7. 28 12月, 2018 1 次提交
  8. 20 12月, 2018 1 次提交
  9. 19 12月, 2018 1 次提交
  10. 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
  11. 12 12月, 2018 1 次提交
  12. 05 12月, 2018 2 次提交
  13. 04 12月, 2018 15 次提交
  14. 24 11月, 2018 5 次提交
  15. 20 11月, 2018 3 次提交