1. 31 1月, 2014 1 次提交
  2. 05 1月, 2014 2 次提交
  3. 18 12月, 2013 1 次提交
  4. 30 10月, 2013 1 次提交
  5. 07 2月, 2013 1 次提交
  6. 10 11月, 2012 1 次提交
  7. 10 10月, 2012 1 次提交
  8. 28 6月, 2012 2 次提交
    • D
      netdev/phy/of: Add more methods for binding PHY devices to drivers. · a30e2c18
      David Daney 提交于
      Allow PHY drivers to supply their own device matching function
      (match_phy_device()), or to be matched OF compatible properties.
      
      PHYs following IEEE802.3 clause 45 have more than one device
      identifier constants, which breaks the default device matching code.
      Other 10G PHYs don't follow the standard manufacturer/device
      identifier register layout standards, but they do use the standard
      MDIO bus protocols for register access.  Both of these require
      adjustments to the PHY driver to device matching code.
      
      If the there is an of_node associated with such a PHY, we can match it
      to its driver using the "compatible" properties, just as we do with
      certain platform devices.  If the "compatible" property match fails,
      first check if there is a driver supplied matching function, and if
      not fall back to the existing identifier matching rules.
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a30e2c18
    • 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
  9. 12 6月, 2012 1 次提交
  10. 09 6月, 2012 1 次提交
  11. 12 5月, 2012 1 次提交
  12. 08 5月, 2012 1 次提交
    • D
      netdev/of/phy: New function: of_mdio_find_bus(). · 25106022
      David Daney 提交于
      Add of_mdio_find_bus() which allows an mii_bus to be located given its
      associated the device tree node.
      
      This is needed by the follow-on patch to add a driver for MDIO bus
      multiplexers.
      
      The of_mdiobus_register() function is modified so that the device tree
      node is recorded in the mii_bus.  Then we can find it again by
      iterating over all mdio_bus_class devices.
      
      Because the OF device tree has now become an integral part of the
      kernel, this can live in mdio_bus.c (which contains the needed
      mdio_bus_class structure) instead of of_mdio.c.
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      25106022
  13. 23 1月, 2012 1 次提交
  14. 13 1月, 2012 1 次提交
  15. 15 9月, 2010 1 次提交
  16. 17 3月, 2010 1 次提交
    • J
      NET: Support clause 45 MDIO commands at the MDIO bus level · abf35df2
      Jason Gunthorpe 提交于
      IEEE 802.3ae clause 45 specifies a somewhat modified MDIO protocol
      for use by 10GIGE phys. The main change is a 21 bit address split into
      a 5 bit device ID and a 16 bit register offset. The definition is designed
      so that normal and extended devices can run on the same MDIO bus.
      
      Extend mdio-bitbang to do the new protocol. At the MDIO bus level the
      protocol is requested by or'ing MII_ADDR_C45 into the register offset.
      
      Make phy_read/phy_write/etc pass a full 32 bit register offset.
      
      This does not attempt to make the phy layer support C45 style PHYs, just
      to provide the MDIO bus support.
      
      Tested against a Broadcom 10GE phy with ID 0x206034, and several
      Broadcom 10/100/1000 Phys in normal mode.
      Signed-off-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      abf35df2
  17. 31 12月, 2009 2 次提交
    • A
      phylib: Properly reinitialize PHYs after hibernation · 2f5cb434
      Anton Vorontsov 提交于
      Since hibernation assumes power loss, we should fully reinitialize
      PHYs (including platform fixups), as if PHYs were just attached.
      
      This patch factors phy_init_hw() out of phy_attach_direct(), then
      converts mdio_bus to dev_pm_ops and adds an appropriate restore()
      callback.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2f5cb434
    • A
      phylib: Fix deadlock on resume · 541cd3ee
      Anton Vorontsov 提交于
      Sometimes kernel hangs on resume with the following trace:
      
       ucc_geth e0102000.ucc: resume
       INFO: task bash:1764 blocked for more than 120 seconds.
       "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
       bash          D 0fecf43c     0  1764   1763 0x00000000
       Call Trace:
       [cf9a7c10] [c0012868] ret_from_except+0x0/0x14 (unreliable)
       --- Exception: cf9a7ce0 at __switch_to+0x4c/0x6c
           LR = 0xcf9a7cc0
       [cf9a7cd0] [c0008c14] __switch_to+0x4c/0x6c (unreliable)
       [cf9a7ce0] [c028bcfc] schedule+0x158/0x260
       [cf9a7d10] [c028c720] __mutex_lock_slowpath+0x80/0xd8
       [cf9a7d40] [c01cf388] phy_stop+0x20/0x70
       [cf9a7d50] [c01d514c] ugeth_resume+0x6c/0x13c
       [...]
      
      Here is why.
      
      On suspend:
      
      - PM core starts suspending devices, ucc_geth_suspend gets called;
      
      - ucc_geth calls phy_stop() on suspend. Note that phy_stop() is
        mostly asynchronous so it doesn't block ucc_geth's suspend routine,
        it just sets PHY_HALTED state and disables PHY's interrupts;
      
      - Suddenly the state machine gets scheduled, it grabs the phydev->lock
        mutex and tries to process the PHY_HALTED state, so it calls
        phydev->adjust_link(phydev->attached_dev). In ucc_geth case
        adjust_link() calls msleep(), which reschedules the code flow back to
        PM core, which now finishes suspend and so we end up sleeping with
        phydev->lock mutex held.
      
      On resume:
      
      - PM core starts resuming devices (notice that nobody rescheduled
        the state machine yet, so the mutex is still held), the core calls
        ucc_geth's resume routine;
      
      - ucc_geth_resume restarts the PHY with phy_stop()/phy_start()
        sequence, and the phy_*() calls are trying to grab the phydev->lock
        mutex. Here comes the deadlock.
      
      This patch fixes the issue by stopping the state machine on suspend
      and starting it again on resume.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      541cd3ee
  18. 27 4月, 2009 1 次提交
  19. 27 2月, 2009 1 次提交
  20. 01 2月, 2009 1 次提交
  21. 23 1月, 2009 1 次提交
    • A
      phylib: Fix oops in suspend/resume paths · 6f051069
      Anton Vorontsov 提交于
      Suspend/resume routines check for phydrv != NULL, but that is
      wrong because "phydrv" comes from container_of(drv). If drv is NULL,
      then container_of(drv) will return non-NULL result, and the checks
      won't work.
      
      The Freescale TBI PHYs are driver-less, so "drv" is NULL, and that
      leads to the following oops:
      
      Unable to handle kernel paging request for data at address 0xffffffe4
      Faulting instruction address: 0xc0215554
      Oops: Kernel access of bad area, sig: 11 [#1]
      [...]
      NIP [c0215554] mdio_bus_suspend+0x34/0x70
      LR [c01cc508] suspend_device+0x258/0x2bc
      Call Trace:
      [cfad3da0] [cfad3db8] 0xcfad3db8 (unreliable)
      [cfad3db0] [c01cc508] suspend_device+0x258/0x2bc
      [cfad3dd0] [c01cc62c] dpm_suspend+0xc0/0x140
      [cfad3e20] [c01cc6f4] device_suspend+0x48/0x5c
      [cfad3e40] [c0068dd8] suspend_devices_and_enter+0x8c/0x148
      [cfad3e60] [c00690f8] enter_state+0x100/0x118
      [cfad3e80] [c00691c0] state_store+0xb0/0xe4
      [cfad3ea0] [c018c938] kobj_attr_store+0x24/0x3c
      [cfad3eb0] [c00ea9a8] flush_write_buffer+0x58/0x7c
      [cfad3ed0] [c00eadf0] sysfs_write_file+0x58/0xa0
      [cfad3ef0] [c009e810] vfs_write+0xb4/0x16c
      [cfad3f10] [c009ed40] sys_write+0x4c/0x90
      [cfad3f40] [c0014954] ret_from_syscall+0x0/0x38
      [...]
      
      This patch fixes the issue, plus removes unneeded parentheses
      and fixes indentation level in mdio_bus_suspend().
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6f051069
  22. 26 12月, 2008 1 次提交
  23. 17 12月, 2008 1 次提交
    • K
      net: kernel BUG at drivers/net/phy/mdio_bus.c:165! · e8e5752d
      Krzysztof Halasa 提交于
      kernel BUG at drivers/net/phy/mdio_bus.c:165!
      Unable to handle kernel NULL pointer dereference at virtual address 00000000
      
      How?
      
      mdiobus_alloc() sets bus->state = MDIOBUS_ALLOCATED.
      
      mdiobus_register() sets bus->state = MDIOBUS_REGISTERED but then can
         fail (mdiobus_scan()) returning an error to the caller.
      
      The caller aborts correctly with mdiobus_free() which does:
              if (bus->state == MDIOBUS_ALLOCATED) {
                      kfree(bus);
                      return;
              }
      
              BUG_ON(bus->state != MDIOBUS_UNREGISTERED);
      Signed-off-by: NKrzysztof Halasa <khc@pm.waw.pl>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e8e5752d
  24. 29 11月, 2008 1 次提交
    • G
      phy: power management support · 0f0ca340
      Giuseppe Cavallaro 提交于
      This patch adds the power management support into the physical
      abstraction layer.
      
      Suspend and resume functions respectively turns on/off the bit 11
      into the PHY Basic mode control register.
      Generic PHY device starts supporting PM.
      
      In order to support the wake-on LAN and avoid to put in power down
      the PHY device, the MDIO is aware of what the Ethernet device wants to do.
      
      Voluntary, no CONFIG_PM defines were added into the sources.
      Also generic suspend/resume functions are exported to allow
      other drivers use them (such as genphy_config_aneg etc.).
      
      Within the phy_driver_register function, we need to remove the
      memset. It overrides the device driver owner and it is not good.
      Signed-off-by: NGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0f0ca340
  25. 15 11月, 2008 1 次提交
  26. 11 11月, 2008 1 次提交
  27. 14 10月, 2008 1 次提交
  28. 09 10月, 2008 4 次提交
  29. 19 9月, 2008 1 次提交
  30. 25 4月, 2008 1 次提交
  31. 24 2月, 2008 1 次提交
  32. 03 2月, 2008 1 次提交
  33. 05 12月, 2007 1 次提交
    • A
      PHY: Add the phy_device_release device method. · 6f4a7f41
      Anton Vorontsov 提交于
      Lately I've got this nice badness on mdio bus removal:
      
      Device 'e0103120:06' does not have a release() function, it is broken and must be fixed.
      ------------[ cut here ]------------
      Badness at drivers/base/core.c:107
      NIP: c015c1a8 LR: c015c1a8 CTR: c0157488
      REGS: c34bdcf0 TRAP: 0700   Not tainted  (2.6.23-rc5-g9ebadfbb-dirty)
      MSR: 00029032 <EE,ME,IR,DR>  CR: 24088422  XER: 00000000
      ...
      [c34bdda0] [c015c1a8] device_release+0x78/0x80 (unreliable)
      [c34bddb0] [c01354cc] kobject_cleanup+0x80/0xbc
      [c34bddd0] [c01365f0] kref_put+0x54/0x6c
      [c34bdde0] [c013543c] kobject_put+0x24/0x34
      [c34bddf0] [c015c384] put_device+0x1c/0x2c
      [c34bde00] [c0180e84] mdiobus_unregister+0x2c/0x58
      ...
      
      Though actually there is nothing broken, it just device
      subsystem core expects another "pattern" of resource managment.
      
      This patch implement phy device's release function, thus
      we're getting rid of this badness.
      
      Also small hidden bug fixed, hope none other introduced. ;-)
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Acked-by: NAndy Fleming <afleming@freescale.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6f4a7f41
  34. 29 6月, 2007 1 次提交
    • K
      phy: Fix phy_id for Vitesse 824x PHY · 5f708dd9
      Kumar Gala 提交于
      The phy_id specified for the Vitesse 824x PHY would never match because
      it was expecting bits to be set that would be masked by the phy_id_mask.
      Fix the phy_id so it will match properly, and changed the mdio_bus_match
      to mask both the driver and devices phy_id with the mask so we dont have
      this issue in the future.
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      5f708dd9