1. 23 5月, 2014 1 次提交
    • 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
  2. 21 4月, 2014 1 次提交
  3. 15 3月, 2014 1 次提交
  4. 26 2月, 2014 1 次提交
  5. 18 2月, 2014 2 次提交
  6. 13 2月, 2014 3 次提交
  7. 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
  8. 20 1月, 2014 1 次提交
  9. 14 1月, 2014 3 次提交
  10. 05 1月, 2014 6 次提交
  11. 18 12月, 2013 3 次提交
  12. 10 12月, 2013 2 次提交
  13. 21 11月, 2013 1 次提交
  14. 28 5月, 2013 1 次提交
  15. 21 5月, 2013 2 次提交
    • F
      phy: add phy_mac_interrupt() to use with PHY_IGNORE_INTERRUPT · 5ea94e76
      Florian Fainelli 提交于
      There is currently no way for an Ethernet MAC driver servicing PHY link
      interrupts to notify this to the PHY state machine without defining its
      own state machine. Since most drivers are not so special, introduce a
      helper: phy_mac_interrupt() which can be called from a link up/down
      interrupt routine to update the PHY state machine. To avoid code
      duplication some refactoring has been done to expose the workqueue and
      its corresponding callback internally.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5ea94e76
    • F
      phy: fix the use of PHY_IGNORE_INTERRUPT · 2c7b4921
      Florian Fainelli 提交于
      When a PHY device is registered with the special IRQ value
      PHY_IGNORE_INTERRUPT (-2) it will not properly be handled by the PHY
      library:
      
      - it continues to poll its register, while we do not want this
        because such PHY link events or register changes are serviced by an
        Ethernet MAC
      - it will still try to configure PHY interrupts at the PHY level, such
        interrupts do not exist at the PHY but at the MAC level
      - the state machine only handles PHY_POLL, but should also handle
        PHY_IGNORE_INTERRUPT similarly
      
      This patch updates the PHY state machine and initialization paths to
      account for the specific PHY_IGNORE_INTERRUPT. Based on an earlier patch
      by Thomas Petazzoni, and reworked to add the missing bits. Add a helper
      phy_interrupt_is_valid() which specifically tests for a PHY interrupt
      not to be PHY_POLL or PHY_IGNORE_INTERRUPT and use it throughout the
      code.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2c7b4921
  16. 01 3月, 2013 1 次提交
    • P
      phy: Fix phy_device_free memory leak · b2a43191
      Petr Malat 提交于
      Fix memory leak in phy_device_free() for the case when phy_device*
      returned by phy_device_create() is not registered in the system.
      
      Bug description:
      phy_device_create() sets name of kobject using dev_set_name(), which
      allocates memory using kvasprintf(), but this memory isn't freed if
      the underlying device isn't registered properly, because kobject_cleanup()
      is not called in that case. This can happen (and actually is happening on
      our machines) if phy_device_register(), called by mdiobus_scan(), fails.
      
      Patch description:
      Embedded struct device is initialized in phy_device_create() and it
      counterpart phy_device_free() just drops one reference to the device,
      which leads to proper deinitialization including releasing the kobject
      name memory.
      Signed-off-by: NPetr Malat <oss@malat.biz>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b2a43191
  17. 15 1月, 2013 1 次提交
  18. 09 7月, 2012 1 次提交
  19. 28 6月, 2012 2 次提交
    • D
      phy: Fix warning in get_phy_device(). · 160c85f0
      David S. Miller 提交于
      drivers/net/phy/phy_device.c: In function ‘get_phy_device’:
      drivers/net/phy/phy_device.c:340:14: warning: ‘phy_id’ may be used uninitialized in this function [-Wmaybe-uninitialized]
      
      GCC can't see that when we return zero we always initialize
      phy_id and that's the only path where we use it.
      
      Initialize phy_id to zero to shut it up.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      160c85f0
    • D
      netdev/phy: Handle IEEE802.3 clause 45 Ethernet PHYs · ac28b9f8
      David Daney 提交于
      The IEEE802.3 clause 45 MDIO bus protocol allows for directly
      addressing PHY registers using a 21 bit address, and is used by many
      10G Ethernet PHYS.  Already existing is the ability of MDIO bus
      drivers to use clause 45, with the MII_ADDR_C45 flag.  Here we add
      struct phy_c45_device_ids to hold the device identifier registers
      present in clause 45. struct phy_device gets a couple of new fields:
      c45_ids to hold the identifiers and is_c45 to signal that it is clause
      45.
      
      get_phy_device() gets a new parameter is_c45 to indicate that the PHY
      device should use the clause 45 protocol, and its callers are adjusted
      to pass false.  The follow-on patch to of_mdio.c will pass true where
      appropriate.
      
      EXPORT phy_device_create() so that the follow-on patch to of_mdio.c
      can use it to create phy devices for PHYs, that have non-standard
      device identifier registers, based on the device tree bindings.
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ac28b9f8
  20. 12 6月, 2012 1 次提交
  21. 16 5月, 2012 1 次提交
  22. 25 1月, 2012 1 次提交
    • A
      Remove useless get_driver()/put_driver() calls · f3ff9247
      Alan Stern 提交于
      As part of the removal of get_driver()/put_driver(), this patch
      (as1512) gets rid of various useless and unnecessary calls in several
      drivers.  In some cases it may be desirable to pin the driver by
      calling try_module_get(), but that can be done later.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: "David S. Miller" <davem@davemloft.net>
      CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      CC: Michael Buesch <m@bues.ch>
      CC: Joerg Roedel <joerg.roedel@amd.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f3ff9247
  23. 22 11月, 2011 1 次提交
  24. 17 11月, 2011 1 次提交
  25. 01 10月, 2011 1 次提交