1. 08 1月, 2016 4 次提交
  2. 03 11月, 2015 1 次提交
    • S
      net: phy: fix a bug in get_phy_c45_ids · 5f6c99e0
      Shaohui Xie 提交于
      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: NShaohui Xie <Shaohui.Xie@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5f6c99e0
  3. 03 10月, 2015 1 次提交
    • S
      phylib: Add phy_set_max_speed helper · f3a6bd39
      Simon Horman 提交于
      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: NSimon Horman <horms+renesas@verge.net.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f3a6bd39
  4. 25 9月, 2015 3 次提交
    • R
      phy: add phy_device_remove() · 38737e49
      Russell King 提交于
      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: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      38737e49
    • R
      phy: add proper phy struct device refcounting · 7322967b
      Russell King 提交于
      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: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7322967b
    • R
      phy: fix mdiobus module safety · 3e3aaf64
      Russell King 提交于
      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: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3e3aaf64
  5. 29 8月, 2015 2 次提交
  6. 26 8月, 2015 1 次提交
  7. 29 6月, 2015 2 次提交
  8. 27 1月, 2015 1 次提交
  9. 23 8月, 2014 1 次提交
  10. 30 7月, 2014 1 次提交
    • F
      net: phy: re-apply PHY fixups during phy_register_device · d92f5dec
      Florian Fainelli 提交于
      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: NHauke Merthens <hauke-m@hauke-m.de>
      Reported-by: NJonas Gorski <jogo@openwrt.org>
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d92f5dec
  11. 25 7月, 2014 1 次提交
  12. 09 7月, 2014 1 次提交
  13. 23 5月, 2014 2 次提交
    • S
      net: phy: make of_set_phy_supported work with genphy driver · de906af1
      Sascha Hauer 提交于
      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: NSascha Hauer <s.hauer@pengutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      de906af1
    • S
      net: phy: genphy: Allow overwriting features · c242a472
      Sascha Hauer 提交于
      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: NSascha Hauer <s.hauer@pengutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c242a472
  14. 16 5月, 2014 1 次提交
    • G
      net: phy: Don't call phy_resume if phy_init_hw failed · b394745d
      Guenter Roeck 提交于
      After the call to phy_init_hw failed in phy_attach_direct, phy_detach is called
      to detach the phy device from its network device. If the attached driver is a
      generic phy driver, this also detaches the driver. Subsequently phy_resume
      is called, which assumes without checking that a driver is attached to the
      device. This will result in a crash such as
      
      Unable to handle kernel paging request for data at address 0xffffffffffffff90
      Faulting instruction address: 0xc0000000003a0e18
      Oops: Kernel access of bad area, sig: 11 [#1]
      ...
      NIP [c0000000003a0e18] .phy_attach_direct+0x68/0x17c
      LR [c0000000003a0e6c] .phy_attach_direct+0xbc/0x17c
      Call Trace:
      [c0000003fc0475d0] [c0000000003a0e6c] .phy_attach_direct+0xbc/0x17c (unreliable)
      [c0000003fc047670] [c0000000003a0ff8] .phy_connect_direct+0x28/0x98
      [c0000003fc047700] [c0000000003f0074] .of_phy_connect+0x4c/0xa4
      
      Only call phy_resume if phy_init_hw was successful.
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b394745d
  15. 21 4月, 2014 1 次提交
  16. 15 3月, 2014 1 次提交
  17. 26 2月, 2014 1 次提交
  18. 18 2月, 2014 2 次提交
  19. 13 2月, 2014 3 次提交
  20. 05 2月, 2014 1 次提交
    • F
      net: phy: ensure Gigabit features are masked off if requested · 5273e3a5
      Florian Fainelli 提交于
      When a Gigabit PHY device is connected to a 10/100Mbits capable Ethernet
      MAC, the driver will restrict the phydev->supported modes to mask off
      Gigabit. If the Gigabit PHY comes out of reset with the Gigabit features
      set by default in MII_CTRL1000, it will keep advertising these feature,
      so by the time we call genphy_config_advert(), the condition on
      phydev->supported having the Gigabit features on is false, and we do not
      update MII_CTRL1000 with updated values, and we keep advertising Gigabit
      features, eventually configuring the PHY for Gigabit whilst the Ethernet
      MAC does not support that.
      
      This patches fixes the problem by ensuring that the Gigabit feature bits
      are always cleared in MII_CTRL1000, if the PHY happens to be a Gigabit
      PHY, and then, if Gigabit features are supported, setting those and
      updating MII_CTRL1000 accordingly.
      Reported-by: NMax Filippov <jcmvbkbc@gmail.com>
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Tested-by: NMax Filippov <jcmvbkbc@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5273e3a5
  21. 20 1月, 2014 1 次提交
  22. 14 1月, 2014 3 次提交
  23. 05 1月, 2014 5 次提交