1. 22 6月, 2017 1 次提交
  2. 14 6月, 2017 1 次提交
  3. 09 6月, 2017 1 次提交
  4. 05 6月, 2017 1 次提交
  5. 02 6月, 2017 1 次提交
  6. 01 6月, 2017 2 次提交
    • R
      net: fix auto-loading of Marvell DSA driver · 1b8f8694
      Russell King 提交于
      Auto-loading of the Marvell DSA driver has stopped working with recent
      kernels.  This seems to be due to the change of binding for DSA devices,
      moving them from the platform bus to the MDIO bus.
      
      In order for module auto-loading to work, we need to provide a MODALIAS
      string in the uevent file for the device.  However, the device core does
      not automatically provide this, and needs each bus_type to implement a
      uevent method to generate these strings.  The MDIO bus does not provide
      such a method, so no MODALIAS string is provided:
      
      .# cat /sys/bus/mdio_bus/devices/f1072004.mdio-mii\:04/uevent
      DRIVER=mv88e6085
      OF_NAME=switch
      OF_FULLNAME=/soc/internal-regs/mdio@72004/switch@4
      OF_COMPATIBLE_0=marvell,mv88e6085
      OF_COMPATIBLE_N=1
      
      In the case of OF-based devices, the solution is easy -
      of_device_uevent_modalias() does the work for us.  After this is done,
      the uevent file looks like this:
      
      .# cat /sys/bus/mdio_bus/devices/f1072004.mdio-mii\:04/uevent
      DRIVER=mv88e6085
      OF_NAME=switch
      OF_FULLNAME=/soc/internal-regs/mdio@72004/switch@4
      OF_COMPATIBLE_0=marvell,mv88e6085
      OF_COMPATIBLE_N=1
      MODALIAS=of:NswitchT<NULL>Cmarvell,mv88e6085
      
      which results in auto-loading of the Marvell DSA driver on Clearfog
      platforms.
      
      Fixes: c0405563 ("ARM: dts: armada-388-clearfog: Utilize new DSA binding")
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1b8f8694
    • R
      net: phy: fix marvell phy status reading · 898805e0
      Russell King 提交于
      The Marvell driver incorrectly provides phydev->lp_advertising as the
      logical and of the link partner's advert and our advert.  This is
      incorrect - this field is supposed to store the link parter's unmodified
      advertisment.
      
      This allows ethtool to report the correct link partner auto-negotiation
      status.
      
      Fixes: be937f1f ("Marvell PHY m88e1111 driver fix")
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      898805e0
  7. 25 5月, 2017 2 次提交
  8. 16 5月, 2017 1 次提交
  9. 12 5月, 2017 2 次提交
    • F
      net: phy: Call bus->reset() after releasing PHYs from reset · df0c8d91
      Florian Fainelli 提交于
      The API convention makes it that a given MDIO bus reset should be able
      to access PHY devices in its reset() callback and perform additional
      MDIO accesses in order to bring the bus and PHYs in a working state.
      
      Commit 69226896 ("mdio_bus: Issue GPIO RESET to PHYs.") broke that
      contract by first calling bus->reset() and then release all PHYs from
      reset using their shared GPIO line, so restore the expected
      functionality here.
      
      Fixes: 69226896 ("mdio_bus: Issue GPIO RESET to PHYs.")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      df0c8d91
    • J
      mdio: mux: Correct mdio_mux_init error path issues · b6016166
      Jon Mason 提交于
      There is a potential unnecessary refcount decrement on error path of
      put_device(&pb->mii_bus->dev), as it is possible to avoid the
      of_mdio_find_bus() call if mux_bus is specified by the calling function.
      
      The same put_device() is not called in the error path if the
      devm_kzalloc of pb fails.  This caused the variable used in the
      put_device() to be changed, as the pb pointer was obviously not set up.
      
      There is an unnecessary of_node_get() on child_bus_node if the
      of_mdiobus_register() is successful, as the
      for_each_available_child_of_node() automatically increments this.
      Thus the refcount on this node will always be +1 more than it should be.
      
      There is no of_node_put() on child_bus_node if the of_mdiobus_register()
      call fails.
      
      Finally, it is lacking devm_kfree() of pb in the error path.  While this
      might not be technically necessary, it was present in other parts of the
      function.  So, I am adding it where necessary to make it uniform.
      Signed-off-by: NJon Mason <jon.mason@broadcom.com>
      Fixes: f20e6657 ("mdio: mux: Enhanced MDIO mux framework for integrated multiplexers")
      Fixes: 0ca2997d ("netdev/of/phy: Add MDIO bus multiplexer support.")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b6016166
  10. 09 5月, 2017 1 次提交
  11. 01 5月, 2017 1 次提交
  12. 27 4月, 2017 2 次提交
  13. 25 4月, 2017 1 次提交
    • R
      mdio_bus: Issue GPIO RESET to PHYs. · 69226896
      Roger Quadros 提交于
      Some boards [1] leave the PHYs at an invalid state
      during system power-up or reset thus causing unreliability
      issues with the PHY which manifests as PHY not being detected
      or link not functional. To fix this, these PHYs need to be RESET
      via a GPIO connected to the PHY's RESET pin.
      
      Some boards have a single GPIO controlling the PHY RESET pin of all
      PHYs on the bus whereas some others have separate GPIOs controlling
      individual PHY RESETs.
      
      In both cases, the RESET de-assertion cannot be done in the PHY driver
      as the PHY will not probe till its reset is de-asserted.
      So do the RESET de-assertion in the MDIO bus driver.
      
      [1] - am572x-idk, am571x-idk, a437x-idk
      Signed-off-by: NRoger Quadros <rogerq@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      69226896
  14. 21 4月, 2017 1 次提交
  15. 18 4月, 2017 4 次提交
    • D
      net: phy: test the right variable in phy_write_mmd() · 1dbba4cb
      Dan Carpenter 提交于
      This is a copy and paste buglet.  We meant to test for ->write_mmd but
      we test for ->read_mmd.
      
      Fixes: 1ee6b9bc ("net: phy: make phy_(read|write)_mmd() generic MMD accessors")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1dbba4cb
    • G
      net: phy: micrel: fix crash when statistic requested for KSZ9031 phy · bfe72442
      Grygorii Strashko 提交于
      Now the command:
      	ethtool --phy-statistics eth0
      will cause system crash with meassage "Unable to handle kernel NULL pointer
      dereference at virtual address 00000010" from:
      
       (kszphy_get_stats) from [<c069f1d8>] (ethtool_get_phy_stats+0xd8/0x210)
       (ethtool_get_phy_stats) from [<c06a0738>] (dev_ethtool+0x5b8/0x228c)
       (dev_ethtool) from [<c06b5484>] (dev_ioctl+0x3fc/0x964)
       (dev_ioctl) from [<c0679f7c>] (sock_ioctl+0x170/0x2c0)
       (sock_ioctl) from [<c02419d4>] (do_vfs_ioctl+0xa8/0x95c)
       (do_vfs_ioctl) from [<c02422c4>] (SyS_ioctl+0x3c/0x64)
       (SyS_ioctl) from [<c0107d60>] (ret_fast_syscall+0x0/0x44)
      
      The reason: phy_driver structure for KSZ9031 phy has no .probe() callback
      defined. As result, struct phy_device *phydev->priv pointer will not be
      initializes (null).
      This issue will affect also following phys:
       KSZ8795, KSZ886X, KSZ8873MLL, KSZ9031, KSZ9021, KSZ8061, KS8737
      
      Fix it by:
      - adding .probe() = kszphy_probe() callback to KSZ9031, KSZ9021
      phys. The kszphy_probe() can be re-used as it doesn't do any phy specific
      settings.
      - removing statistic callbacks from other phys (KSZ8795, KSZ886X,
      KSZ8873MLL, KSZ8061, KS8737) as they doesn't have corresponding
      statistic counters.
      
      Fixes: 2b2427d0 ("phy: micrel: Add ethtool statistics counters")
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bfe72442
    • R
      net: phy: simplify phy_supported_speeds() · 786df9c2
      Russell King 提交于
      Simplify the loop in phy_supported_speeds().
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      786df9c2
    • R
      net: phy: improve phylib correctness for non-autoneg settings · d0613037
      Russell King 提交于
      phylib has some undesirable behaviour when forcing a link mode through
      ethtool.  phylib uses this code:
      
      	idx = phy_find_valid(phy_find_setting(phydev->speed, phydev->duplex),
      			features);
      
      to find an index in the settings table.  phy_find_setting() starts at
      index 0, and scans upwards looking for an exact speed and duplex match.
      When it doesn't find it, it returns MAX_NUM_SETTINGS - 1, which is
      10baseT-Half duplex.
      
      phy_find_valid() then scans from the point (and effectively only checks
      one entry) before bailing out, returning MAX_NUM_SETTINGS - 1.
      
      phy_sanitize_settings() then sets ->speed to SPEED_10 and ->duplex to
      DUPLEX_HALF whether or not 10baseT-Half is supported or not.  This goes
      against all the comments against these functions, and 10baseT-Half may
      not even be supported by the hardware.
      
      Rework these functions, introducing a new method of scanning the table.
      There are two modes of lookup that phylib wants: exact, and inexact.
      
      - in exact mode, we return either an exact match or failure
      - in inexact mode, we return an exact match if it exists, a match at
        the highest speed that is not greater than the requested speed
        (ignoring duplex), or failing that, the lowest supported speed, or
        failure.
      
      The biggest difference is that we always check whether the entry is
      supported before further consideration, so all unsupported entries are
      not considered as candidates.
      
      This results in arguably saner behaviour, better matches the comments,
      and is probably what users would expect.
      
      This becomes important as ethernet speeds increase, PHYs exist which do
      not support the 10Mbit speeds, and half-duplex is likely to become
      obsolete - it's already not even an option on 10Gbit and faster links.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d0613037
  16. 05 4月, 2017 1 次提交
  17. 02 4月, 2017 3 次提交
  18. 30 3月, 2017 1 次提交
    • F
      net: phy: Allow building mdio-boardinfo into the kernel · d0281a56
      Florian Fainelli 提交于
      mdio-boardinfo contains code that is helpful for platforms to register
      specific MDIO bus devices independent of how CONFIG_MDIO_DEVICE or
      CONFIG_PHYLIB will be selected (modular or built-in). In order to make
      that possible, let's do the following:
      
      - descend into drivers/net/phy/ unconditionally
      
      - make mdiobus_setup_mdiodev_from_board_info() take a callback argument
        which allows us not to expose the internal MDIO board info list and
        mutex, yet maintain the logic within the same file
      
      - relocate the code that creates a MDIO device into
        drivers/net/phy/mdio_bus.c
      
      - build mdio-boardinfo.o into the kernel as soon as MDIO_DEVICE is
        defined (y or m)
      
      Fixes: 90eff909 ("net: phy: Allow splitting MDIO bus/device support from PHYs")
      Fixes: 648ea013 ("net: phy: Allow pre-declaration of MDIO devices")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Tested-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d0281a56
  19. 29 3月, 2017 1 次提交
  20. 25 3月, 2017 3 次提交
  21. 24 3月, 2017 2 次提交
  22. 23 3月, 2017 6 次提交
  23. 16 3月, 2017 1 次提交