1. 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
  2. 15 3月, 2014 1 次提交
  3. 26 2月, 2014 1 次提交
  4. 18 2月, 2014 2 次提交
  5. 13 2月, 2014 3 次提交
  6. 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
  7. 20 1月, 2014 1 次提交
  8. 14 1月, 2014 3 次提交
  9. 05 1月, 2014 6 次提交
  10. 18 12月, 2013 3 次提交
  11. 10 12月, 2013 2 次提交
  12. 21 11月, 2013 1 次提交
  13. 28 5月, 2013 1 次提交
  14. 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
  15. 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
  16. 15 1月, 2013 1 次提交
  17. 09 7月, 2012 1 次提交
  18. 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
  19. 12 6月, 2012 1 次提交
  20. 16 5月, 2012 1 次提交
  21. 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
  22. 22 11月, 2011 1 次提交
  23. 17 11月, 2011 1 次提交
  24. 01 10月, 2011 1 次提交
  25. 31 3月, 2011 1 次提交