1. 02 5月, 2016 3 次提交
    • M
      mdio_bus: Fix MDIO bus scanning in __mdiobus_register() · 70e927b9
      Marek Vasut 提交于
      Since commit b74766a0 ("phylib: don't return NULL
      from get_phy_device()") in linux-next, phy_get_device() will return
      ERR_PTR(-ENODEV) instead of NULL if the PHY device ID is all ones.
      
      This causes problem with stmmac driver and likely some other drivers
      which call mdiobus_register(). I triggered this bug on SoCFPGA MCVEVK
      board with linux-next 20160427 and 20160428. In case of the stmmac, if
      there is no PHY node specified in the DT for the stmmac block, the stmmac
      driver ( drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c function
      stmmac_mdio_register() ) will call mdiobus_register() , which will
      register the MDIO bus and probe for the PHY.
      
      The mdiobus_register() resp. __mdiobus_register() iterates over all of
      the addresses on the MDIO bus and calls mdiobus_scan() for each of them,
      which invokes get_phy_device(). Before the aforementioned patch, the
      mdiobus_scan() would return NULL if no PHY was found on a given address
      and mdiobus_register() would continue and try the next PHY address. Now,
      mdiobus_scan() returns ERR_PTR(-ENODEV), which is caught by the
      'if (IS_ERR(phydev))' condition and the loop exits immediately if the
      PHY address does not contain PHY.
      
      Repair this by explicitly checking for the ERR_PTR(-ENODEV) and if this
      error comes around, continue with the next PHY address.
      Signed-off-by: NMarek Vasut <marex@denx.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      70e927b9
    • J
      tipc: set 'active' state correctly for first established link · def22c47
      Jon Paul Maloy 提交于
      When we are displaying statistics for the first link established between
      two peers, it will always be presented as STANDBY although it in reality
      is ACTIVE.
      
      This happens because we forget to set the 'active' flag in the link
      instance at the moment it is established. Although this is a bug, it only
      has impact on the presentation view of the link, not on its actual
      functionality.
      Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      def22c47
    • F
      of: of_mdio: Check if MDIO bus controller is available · a77f4f70
      Florian Fainelli 提交于
      Add a check whether the 'struct device_node' pointer passed to
      of_mdiobus_register() is an available (aka enabled) node in the Device
      Tree.
      
      Rationale for doing this are cases where an Ethernet MAC provides a MDIO
      bus controller and node, and an additional Ethernet MAC might be
      connecting its PHY/switches to that first MDIO bus controller, while
      still embedding one internally which is therefore marked as "disabled".
      
      Instead of sprinkling checks like these in callers of
      of_mdiobus_register(), do this in a central location.
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a77f4f70
  2. 30 4月, 2016 36 次提交
  3. 29 4月, 2016 1 次提交