Skip to content
Permalink
Emmanuel-Grumb…
Switch branches/tags

Commits on Jun 16, 2021

  1. cfg80211: expose the rfkill device to the low level driver

    This will allow the low level driver to query the rfkill
    state.
    
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
    egrumbach authored and intel-lab-lkp committed Jun 16, 2021

Commits on May 14, 2021

  1. net: mdio: ipq8064: enlarge sleep after read/write operation

    With the use of the qca8k dsa driver, some problem arised related to
    port status detection. With a load on a specific port (for example a
    simple speed test), the driver starts to behave in a strange way and
    garbage data is produced. To address this, enlarge the sleep delay and
    address a bug for the reg offset 31 that require additional delay for
    this specific reg.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  2. net: mdio: ipq8064: add regmap config to disable REGCACHE

    mdio drivers should not use REGCHACHE. Also disable locking since it's
    handled by the mdio users and regmap is always accessed atomically.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  3. net: mdio: ipq8064: clean whitespaces in define

    Fix mixed whitespace and tab for define spacing.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  4. Merge branch 'qca8k-improvements'

    Ansuel Smith says:
    
    ====================
    Multiple improvement to qca8k stability
    
    Currently qca8337 switch are widely used on ipq8064 based router.
    On these particular router it was notice a very unstable switch with
    port not link detected as link with unknown speed, port dropping
    randomly and general unreliability. Lots of testing and comparison
    between this dsa driver and the original qsdk driver showed lack of some
    additional delay and values. A main difference arised from the original
    driver and the dsa one. The original driver didn't use MASTER regs to
    read phy status and the dedicated mdio driver worked correctly. Now that
    the dsa driver actually use these regs, it was found that these special
    read/write operation required mutual exclusion to normal
    qca8k_read/write operation. The add of mutex for these operation fixed
    the random port dropping and now only the actual linked port randomly
    dropped. Adding additional delay for set_page operation and fixing a bug
    in the mdio dedicated driver fixed also this problem. The current driver
    requires also more time to apply vlan switch. All of these changes and
    tweak permit a now very stable and reliable dsa driver and 0 port
    dropping. This series is currently tested by at least 5 user with
    different routers and all reports positive results and no problems.
    
    Changes v6:
    - Fix spelling mistake
    - Change ms to ns (confirmed by datasheet)
    Changes v5:
    - Removed mdio patch (sent separetly to try to reduce the series)
      I know it was asked to reduced this series since it big, but rework
      the new changes to skip and error check looks wrong. Since half of them
      are actually already reviewed I think it's better to keep this series as is.
    - Improve rgmii configurable patch
    - Move qca8k phy dedicated driver to at803x phy driver
    - Add support for dedicated internal mdio driver for qca8k
    Changes v4:
    - Use iopoll for busy_wait function
    - Better describe and split some confusing commits
    - Fix bad rgmii delay configurable patch
    - Drop phy generic patch to pass flags with phylink_connect_phy
    - Add dsa2 patch to declare mdio node in the switch node
    - Add dsa patch to permit dsa driver to declare custom get_phys_mii_mask
        Some background about the last 2 patch.
        The qca8k switch doesn't have a 1:1 map between port reg and phy reg.
        Currently it's used a function to convert port to the internal phy reg.
        I added some patch to fix this.
        - The dsa driver now check if the mdio node is present and use the of variant
          of the mdiobus_register
        - A custom phy_mii_mask is required as currently the mask is generated from
          the port reg, but in our case the mask would be different as it should be
          generated from the phy reg. To generalize this I added an extra function
          that driver can provide to pass custom phy_mii_mask.
    Changes v3:
    - Revert mdio writel changes (use regmap with REGCACHE disabled)
    - Split propagate error patch to 4 different patch
    Changes v2:
    - Implemented phy driver for internal PHYs
      I'm testing cable test functions as I found some documentation that
      actually declare regs about it. Problem is that it doesn't actually
      work. It seems that the value set are ignored by the phy.
    - Made the rgmii delay configurable
    - Reordered patch
    - Split mdio patches to more specific ones
    - Reworked mdio driver to use readl/writel instead of regmap
    - Reworked the entire driver to make it aware of any read/write error.
    - Added phy generic patch to pass flags with phylink_connect_phy
      function
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed May 14, 2021
  5. net: phy: add support for qca8k switch internal PHY in at803x

    Since the at803x share the same regs, it's assumed they are based on the
    same implementation. Make it part of the at803x PHY driver to skip
    having redudant code.
    Add initial support for qca8k internal PHYs. The internal PHYs requires
    special mmd and debug values to be set based on the switch revision
    passwd using the dev_flags. Supports output of idle, receive and eee_wake
    errors stats.
    Some debug values sets can't be translated as the documentation lacks any
    reference about them.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  6. net: phy: at803x: clean whitespace errors

    Clean any whitespace errors and fix not aligned define.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  7. net: dsa: qca8k: pass switch_revision info to phy dev_flags

    Define get_phy_flags to pass switch_Revision needed to tweak the
    internal PHY with debug values based on the revision.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  8. net: dsa: qca8k: improve internal mdio read/write bus access

    Improve the internal mdio read/write bus access by caching the value
    without accessing it for every read/write.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  9. devicetree: bindings: dsa: qca8k: Document internal mdio definition

    Document new way of declare mapping of internal PHY to port.
    The new implementation directly declare the PHY connected to the port
    by adding a node in the switch node. The driver detect this and register
    an internal mdiobus using the mapping defined in the mdio node.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Rob Herring <robh@kernel.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  10. net: dsa: qca8k: add support for internal phy and internal mdio

    Add support to setup_mdio_bus for internal phy declaration. Introduce a
    flag to use the legacy port phy mapping by default and use the direct
    mapping if a mdio node is detected in the switch node. Register a
    dedicated mdio internal mdio bus to address the different mapping
    between port and phy if the mdio node is detected.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  11. net: dsa: qca8k: enlarge mdio delay and timeout

    The witch require some extra delay after setting page or the next
    read/write can use still use the old page. Add a delay after the
    set_page function to address this as it's done in QSDK legacy driver.
    Some timeouts were notice with VLAN and phy function, enlarge the
    mdio busy wait timeout to fix these problems.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  12. net: dsa: qca8k: dsa: qca8k: protect MASTER busy_wait with mdio mutex

    MDIO_MASTER operation have a dedicated busy wait that is not protected
    by the mdio mutex. This can cause situation where the MASTER operation
    is done and a normal operation is executed between the MASTER read/write
    and the MASTER busy_wait. Rework the qca8k_mdio_read/write function to
    address this issue by binding the lock for the whole MASTER operation
    and not only the mdio read/write common operation.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  13. net: dsa: qca8k: clear MASTER_EN after phy read/write

    Clear MDIO_MASTER_EN bit from MDIO_MASTER_CTRL after read/write
    operation. The MDIO_MASTER_EN bit is not reset after read/write
    operation and the next operation can be wrongly interpreted by the
    switch as a mdio operation. This cause a production of wrong/garbage
    data from the switch and underfined bheavior. (random port drop,
    unplugged port flagged with link up, wrong port speed)
    Also on driver remove the MASTER_CTRL can be left set and cause the
    malfunction of any next driver using the mdio device.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  14. net: dsa: qca8k: make rgmii delay configurable

    The legacy qsdk code used a different delay instead of the max value.
    Qsdk use 1 ns for rx and 2 ns for tx. Make these values configurable
    using the standard rx/tx-internal-delay-ps ethernet binding and apply
    qsdk values by default. The connected gmac doesn't add any delay so no
    additional delay is added to tx/rx.
    On this switch the delay is actually in ns so value should be in the
    1000 order. Any value converted from ps to ns by dividing it by 1000
    as the switch max value for delay is 3ns.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  15. net: dsa: qca8k: add ethernet-ports fallback to setup_mdio_bus

    Dsa now also supports ethernet-ports. Add this new binding as a fallback
    if the ports node can't be found.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  16. net: dsa: qca8k: add support for switch rev

    qca8k internal phy driver require some special debug value to be set
    based on the switch revision. Rework the switch id read function to
    also read the chip revision.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  17. net: dsa: qca8k: add GLOBAL_FC settings needed for qca8327

    Switch qca8327 needs special settings for the GLOBAL_FC_THRES regs.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  18. net: dsa: qca8k: limit port5 delay to qca8337

    Limit port5 rx delay to qca8337. This is taken from the legacy QSDK code
    that limits the rx delay on port5 to only this particular switch version,
    on other switch only the tx and rx delay for port0 are needed.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  19. net: dsa: qca8k: add priority tweak to qca8337 switch

    The port 5 of the qca8337 have some problem in flood condition. The
    original legacy driver had some specific buffer and priority settings
    for the different port suggested by the QCA switch team. Add this
    missing settings to improve switch stability under load condition.
    The packet priority tweak is only needed for the qca8337 switch and
    other qca8k switch are not affected.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  20. devicetree: net: dsa: qca8k: Document new compatible qca8327

    Add support for qca8327 in the compatible list.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Acked-by: Rob Herring <robh@kernel.org>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  21. net: dsa: qca8k: add support for qca8327 switch

    qca8327 switch is a low tier version of the more recent qca8337.
    It does share the same regs used by the qca8k driver and can be
    supported with minimal change.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  22. net: dsa: qca8k: handle error from qca8k_busy_wait

    Propagate errors from qca8k_busy_wait instead of hardcoding return
    value.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  23. net: dsa: qca8k: handle error with qca8k_rmw operation

    qca8k_rmw can fail. Rework any user to handle error values and
    correctly return. Change qca8k_rmw to return the error code or 0 instead
    of the reg value. The reg returned by qca8k_rmw wasn't used anywhere,
    so this doesn't cause any functional change.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  24. net: dsa: qca8k: handle error with qca8k_write operation

    qca8k_write can fail. Rework any user to handle error values and
    correctly return.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  25. net: dsa: qca8k: handle error with qca8k_read operation

    qca8k_read can fail. Rework any user to handle error values and
    correctly return.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  26. net: dsa: qca8k: handle qca8k_set_page errors

    With a remote possibility, the set_page function can fail. Since this is
    a critical part of the write/read qca8k regs, propagate the error and
    terminate any read/write operation.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  27. net: dsa: qca8k: improve qca8k read/write/rmw bus access

    Put bus in local variable to improve faster access to the mdio bus.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  28. net: dsa: qca8k: use iopoll macro for qca8k_busy_wait

    Use iopoll macro instead of while loop.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  29. net: dsa: qca8k: change simple print to dev variant

    Change pr_err and pr_warn to dev variant.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed May 14, 2021
  30. tcp: add tracepoint for checksum errors

    Add a tracepoint for capturing TCP segments with
    a bad checksum. This makes it easy to identify
    sources of bad frames in the fleet (e.g. machines
    with faulty NICs).
    
    It should also help tools like IOvisor's tcpdrop.py
    which are used today to get detailed information
    about such packets.
    
    We don't have a socket in many cases so we must
    open code the address extraction based just on
    the skb.
    
    v2: add missing export for ipv6=m
    
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Jakub Kicinski authored and davem330 committed May 14, 2021
  31. Merge branch 'use-xdp-helpers'

    Matteo Croce says:
    
    ====================
    net: use XDP helpers
    
    The commit 43b5169 ("net, xdp: Introduce xdp_init_buff utility
    routine") and commit be9df4a ("net, xdp: Introduce xdp_prepare_buff
    utility routine") introduces two useful helpers to populate xdp_buff.
    Use it in drivers which still open codes that routines.
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed May 14, 2021
  32. vhost_net: use XDP helpers

    Make use of the xdp_{init,prepare}_buff() helpers instead of
    an open-coded version.
    
    Also, the field xdp->rxq was never set, so pass NULL to xdp_init_buff()
    to clear it.
    
    Signed-off-by: Matteo Croce <mcroce@microsoft.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    teknoraver authored and davem330 committed May 14, 2021
  33. igc: use XDP helpers

    Make use of the xdp_{init,prepare}_buff() helpers instead of
    an open-coded version.
    
    Signed-off-by: Matteo Croce <mcroce@microsoft.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    teknoraver authored and davem330 committed May 14, 2021
  34. stmmac: use XDP helpers

    Make use of the xdp_{init,prepare}_buff() helpers instead of
    an open-coded version.
    
    Signed-off-by: Matteo Croce <mcroce@microsoft.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    teknoraver authored and davem330 committed May 14, 2021
Older