Skip to content
Snippets Groups Projects
  1. Nov 30, 2016
  2. Nov 26, 2016
  3. Nov 07, 2016
  4. Oct 18, 2016
    • Zach Brown's avatar
      net: phy: leds: add support for led triggers on phy link state change · 2e0bc452
      Zach Brown authored
      
      Create an option CONFIG_LED_TRIGGER_PHY (default n), which will create a
      set of led triggers for each instantiated PHY device. There is one LED
      trigger per link-speed, per-phy.
      The triggers are registered during phy_attach and unregistered during
      phy_detach.
      
      This allows for a user to configure their system to allow a set of LEDs
      not controlled by the phy to represent link state changes on the phy.
      LEDS controlled by the phy are unaffected.
      
      For example, we have a board where some of the leds in the
      RJ45 socket are controlled by the phy, but others are not. Using the
      triggers provided by this patch the leds not controlled by the phy can
      be configured to show the current speed of the ethernet connection. The
      leds controlled by the phy are unaffected.
      
      Signed-off-by: default avatarJosh Cartwright <josh.cartwright@ni.com>
      Signed-off-by: default avatarNathan Sullivan <nathan.sullivan@ni.com>
      Signed-off-by: default avatarZach Brown <zach.brown@ni.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2e0bc452
  5. Oct 17, 2016
  6. May 20, 2016
  7. May 16, 2016
  8. Apr 26, 2016
  9. Apr 16, 2016
  10. Feb 17, 2016
  11. Jan 15, 2016
    • Sjoerd Simons's avatar
      net: phy: turn carrier off on phy attach · 113c74d8
      Sjoerd Simons authored
      
      The operstate of a networking device initially IF_OPER_UNKNOWN aka
      "unknown", updated on carrier state changes (with carrier state being on
      by default). This means it will stay unknown unless the carrier state
      goes to off at some point, which is not the case if the phy is already
      up/connected at startup.
      
      Explicitly turn off the carrier on phy attach, leaving the phy state
      machine to turn the carrier on when it has done the initial negotiation.
      
      Signed-off-by: default avatarSjoerd Simons <sjoerd.simons@collabora.co.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      113c74d8
  12. Jan 12, 2016
  13. Jan 07, 2016
  14. Nov 03, 2015
    • Shaohui Xie's avatar
      net: phy: fix a bug in get_phy_c45_ids · 5f6c99e0
      Shaohui Xie authored
      
      When probing devices-in-package for a c45 phy, device zero is the last
      device to probe, however, if driver reads 0 from device zero,
      c45_ids->devices_in_package is set to '0', the loop condition of probing
      will be matched again, see codes below:
      
      for (i = 1;i < num_ids && c45_ids->devices_in_package == 0;i++)
      
      driver will run in a dead loop.
      
      This patch restructures the bug and confusing loop, it provides a helper
      function get_phy_c45_devs_in_pkg which to read devices-in-package registers
      of a MMD, and rewrites the loop with using the helper function.
      
      Signed-off-by: default avatarShaohui Xie <Shaohui.Xie@freescale.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5f6c99e0
  15. Oct 03, 2015
    • Simon Horman's avatar
      phylib: Add phy_set_max_speed helper · f3a6bd39
      Simon Horman authored
      
      Add a helper to allow ethernet drivers to limit the speed of a phy
      (that they are attached to).
      
      This mainly involves factoring out the business-end of
      of_set_phy_supported() and exporting a new symbol.
      
      This code seems to be open coded in several places, in several different
      variants.
      
      It is is envisaged that this will be used in situations where setting the
      "max-speed" property in DT is not appropriate, e.g. because the maximum
      speed is not a property of the phy hardware.
      
      Signed-off-by: default avatarSimon Horman <horms+renesas@verge.net.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f3a6bd39
  16. Sep 25, 2015
    • Russell King's avatar
      phy: add phy_device_remove() · 38737e49
      Russell King authored
      
      Add a phy_device_remove() function to complement phy_device_register(),
      which undoes the effects of phy_device_register() by removing the phy
      device from visibility, but not freeing it.
      
      This allows these details to be moved out of the mdio bus code into
      the phy code where this action belongs.
      
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      38737e49
    • Russell King's avatar
      phy: add proper phy struct device refcounting · 7322967b
      Russell King authored
      
      Take a refcount on the phy struct device when the phy device is attached
      to a network device, and drop it after it's detached.  This ensures that
      a refcount is held on the phy device while the device is being used by
      a network device, thereby preventing the phy_device from being
      unexpectedly kfree()'d by phy_device_release().
      
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7322967b
    • Russell King's avatar
      phy: fix mdiobus module safety · 3e3aaf64
      Russell King authored
      
      Re-implement the mdiobus module refcounting to ensure that we actually
      ensure that the mdiobus module code does not go away while we might call
      into it.
      
      The old scheme using bus->dev.driver was buggy, because bus->dev is a
      class device which never has a struct device_driver associated with it,
      and hence the associated code trying to obtain a refcount did nothing
      useful.
      
      Instead, take the approach that other subsystems do: pass the module
      when calling mdiobus_register(), and record that in the mii_bus struct.
      When we need to increment the module use count in the phy code, use
      this stored pointer.  When the phy is deteched, drop the module
      refcount, remembering that the phy device might go away at that point.
      
      This doesn't stop the mii_bus going away while there are in-use phys -
      it merely stops the underlying code vanishing.
      
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3e3aaf64
  17. Aug 28, 2015
  18. Aug 25, 2015
  19. Jun 29, 2015
  20. Jun 28, 2015
  21. Jan 27, 2015
  22. Aug 23, 2014
  23. Jul 29, 2014
    • Florian Fainelli's avatar
      net: phy: re-apply PHY fixups during phy_register_device · d92f5dec
      Florian Fainelli authored
      
      Commit 87aa9f9c ("net: phy: consolidate PHY reset in phy_init_hw()")
      moved the call to phy_scan_fixups() in phy_init_hw() after a software
      reset is performed.
      
      By the time phy_init_hw() is called in phy_device_register(), no driver
      has been bound to this PHY yet, so all the checks in phy_init_hw()
      against the PHY driver and the PHY driver's config_init function will
      return 0. We will therefore never call phy_scan_fixups() as we should.
      
      Fix this by calling phy_scan_fixups() and check for its return value to
      restore the intended functionality.
      
      This broke PHY drivers which do register an early PHY fixup callback to
      intercept the PHY probing and do things like changing the 32-bits unique
      PHY identifier when a pseudo-PHY address has been used, as well as
      board-specific PHY fixups that need to be applied during driver probe
      time.
      
      Reported-by: default avatarHauke Merthens <hauke-m@hauke-m.de>
      Reported-by: default avatarJonas Gorski <jogo@openwrt.org>
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d92f5dec
  24. Jul 25, 2014
  25. Jul 09, 2014
  26. May 22, 2014
    • Sascha Hauer's avatar
      net: phy: make of_set_phy_supported work with genphy driver · de906af1
      Sascha Hauer authored
      
      of_set_phy_supported allows overwiting hardware capabilities of
      a phy with values from the devicetree. of_set_phy_supported is
      called right after phy_device_register in the assumption that
      phy_probe is called from phy_device_register and the features
      of the phy are already initialized. For the genphy driver this
      is not true, here phy_probe is called later during phy_connect
      time. phy_probe will then overwrite all settings done from
      of_set_phy_supported
      Fix this by moving of_set_phy_supported to the core phy code
      and calling it from phy_probe.
      
      Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      de906af1
    • Sascha Hauer's avatar
      net: phy: genphy: Allow overwriting features · c242a472
      Sascha Hauer authored
      
      of_set_phy_supported allows overwiting hardware capabilities of
      a phy with values from the devicetree. This does not work with
      the genphy driver though because the genphys config_init function
      will overwrite all values adjusted by of_set_phy_supported. Fix
      this by initialising the genphy features in the phy_driver struct
      and in config_init just limit the features to the ones the hardware
      can actually support. The resulting features are a subset of the
      devicetree specified features and the hardware features.
      
      Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c242a472
Loading