1. 19 1月, 2010 1 次提交
    • A
      phylib: Move workqueue initialization to a proper place · 4f9c85a1
      Anton Vorontsov 提交于
      commit 541cd3ee ("phylib: Fix deadlock
      on resume") caused TI DaVinci EMAC ethernet driver to oops upon resume:
      
       PM: resume of devices complete after 237.098 msecs
       Restarting tasks ... done.
       kernel BUG at kernel/workqueue.c:354!
       Unable to handle kernel NULL pointer dereference at virtual address 00000000
       [...]
       Backtrace:
       [<c002c598>] (__bug+0x0/0x2c) from [<c0052a54>] (queue_delayed_work_on+0x74/0xf8)
       [<c00529e0>] (queue_delayed_work_on+0x0/0xf8) from [<c0052b30>] (queue_delayed_work+0x2c/0x30)
      
      The oops pops up because TI DaVinci EMAC driver detaches PHY on
      suspend and attaches it back on resume. Attaching makes phylib call
      phy_start_machine() that initializes a workqueue. On the other hand,
      PHY's resume routine will call phy_start_machine() again, and that
      will cause the oops since we just destroyed the already scheduled
      workqueue.
      
      This patch fixes the issue by moving workqueue initialization to
      phy_device_create().
      
      p.s. We don't see this oops with ucc_geth and gianfar drivers because
      they perform a fine-grained suspend, i.e. they just stop the PHYs
      without detaching.
      Reported-by: NSekhar Nori <nsekhar@ti.com>
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Tested-by: NSekhar Nori <nsekhar@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4f9c85a1
  2. 31 12月, 2009 1 次提交
  3. 15 7月, 2009 1 次提交
  4. 17 6月, 2009 1 次提交
  5. 27 4月, 2009 2 次提交
  6. 15 1月, 2009 1 次提交
    • A
      phylib: Fix Freescale TBI PHY detection · f0d44ae3
      Anton Vorontsov 提交于
      Freescale on-chip TBI PHYs reports PHY ID as 0x0, but as of
      
      commit 3ee82383
      Author: Giulio Benetti <giulio.benetti@micronovasrl.com>
      Date:   Thu Nov 13 21:53:13 2008 +0000
      
          phy: fix phy address bug
      
          PHYID returns 0xffff and not 0xffffffff when not found and in some
          case(at91sam9263) 0x0. Maybe this patch could be useful.
      
      phy_device.c treats PHY ID == 0x0 as bogus IDs, and that results in
      gianfar driver failure to see the TBI PHYs. This code snippet triggers:
      
      	if (!priv->tbiphy) {
      		printk(KERN_WARNING "SGMII mode requires that the device "
      				"tree specify a tbi-handle\n");
      		return;
      	}
      
      Although tbi-handle is specified in the device tree.
      
      Btw, technically PHY ID == 0x0 is a valid ID (if we ever see a PHY
      manufactured by Xerox :-).
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Acked-by: NAndy Fleming <afleming@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f0d44ae3
  7. 26 12月, 2008 1 次提交
  8. 17 12月, 2008 1 次提交
  9. 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
  10. 21 11月, 2008 1 次提交
  11. 20 11月, 2008 1 次提交
    • T
      phylib: Fix auto-negotiation restart avoidance · de339c2a
      Trent Piepho 提交于
      A previous patch, 51e2a384, made
      genphy_config_aneg() not restart aneg by calling genphy_restart_aneg() if
      the advertisement hadn't changed.
      
      But, genphy_restart_aneg() doesn't just restart aneg, it may also *enable*
      aneg or un-isolate the PHY from the MII (those functions are controlled by
      the same register).  The code to avoid calling genphy_restart_aneg() didn't
      consider this.
      
      So, modify genphy_config_aneg() to also check if the PHY needs to have aneg
      enabled or be un-isolated before deciding not to restart aneg.
      
      This caused a problem with certain Davicom PHYs, as that driver isolates
      the PHY (why?) before calling genphy_config_aneg() and expects the PHY to
      be un-isolated by that function.
      Signed-off-by: NTrent Piepho <tpiepho@freescale.com>
      Reported-by: NScott Wood <scottwood@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      de339c2a
  12. 16 11月, 2008 1 次提交
  13. 11 11月, 2008 1 次提交
  14. 17 10月, 2008 1 次提交
  15. 14 10月, 2008 1 次提交
  16. 09 10月, 2008 1 次提交
    • T
      PHY: Avoid unnecessary aneg restarts · 51e2a384
      Trent Piepho 提交于
      The PHY's aneg is configured and restarted whenever the link is brought up,
      e.g. when DHCP is started after the kernel has booted.  This can take the
      link down for several seconds while auto-negotiation is redone.
      
      If the advertised features haven't changed, then it shouldn't be necessary
      to bring down the link and start auto-negotiation over again.
      
      genphy_config_advert() is enhanced to return 0 when the advertised features
      haven't been changed and >0 when they have been.
      
      genphy_config_aneg() then uses this information to not call
      genphy_restart_aneg() if there has been no change.
      Signed-off-by: NTrent Piepho <tpiepho@freescale.com>
      Acked-by: NAndy Fleming <afleming@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      51e2a384
  17. 23 5月, 2008 1 次提交
  18. 29 4月, 2008 1 次提交
  19. 25 4月, 2008 1 次提交
  20. 18 4月, 2008 1 次提交
  21. 03 2月, 2008 1 次提交
  22. 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
  23. 06 11月, 2007 1 次提交
  24. 11 10月, 2007 1 次提交
    • M
      PHYLIB: Spinlock fixes for softirqs · 9ff8c68b
      Maciej W. Rozycki 提交于
      Use spin_lock_bh()/spin_unlock_bh() for the phydev lock throughout as it
      is used in phy_timer() that is called as a softirq and all the other
      operations may happen in the user context.
      
      There has been a change recently that did such a conversion for some of the
      operations on the lock, but some have been left intact.  Many of them,
      perhaps all, may be called in the user context and I was able to trigger
      recursive spinlock acquisition indeed, so I think for the sake of long-term
      maintenance it is best to convert them all, even if unnecessarily for one
      or two -- better safe than sorry.
      
      Perhaps one in phy_timer() could actually be skipped as only called as a
      softirq -- I can send an update if that sounds like a good idea.
      
      Checked with checkpatch.pl and at the runtime.
      Signed-off-by: NMaciej W. Rozycki <macro@linux-mips.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      9ff8c68b
  25. 13 9月, 2007 1 次提交
  26. 25 8月, 2007 1 次提交
  27. 28 4月, 2007 2 次提交
  28. 15 2月, 2007 1 次提交
    • T
      [PATCH] remove many unneeded #includes of sched.h · cd354f1a
      Tim Schmielau 提交于
      After Al Viro (finally) succeeded in removing the sched.h #include in module.h
      recently, it makes sense again to remove other superfluous sched.h includes.
      There are quite a lot of files which include it but don't actually need
      anything defined in there.  Presumably these includes were once needed for
      macros that used to live in sched.h, but moved to other header files in the
      course of cleaning it up.
      
      To ease the pain, this time I did not fiddle with any header files and only
      removed #includes from .c-files, which tend to cause less trouble.
      
      Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
      arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
      allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
      configs in arch/arm/configs on arm.  I also checked that no new warnings were
      introduced by the patch (actually, some warnings are removed that were emitted
      by unnecessarily included header files).
      Signed-off-by: NTim Schmielau <tim@physik3.uni-rostock.de>
      Acked-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cd354f1a
  29. 10 2月, 2007 1 次提交
    • R
      phy devices: use same arg types · 1a168934
      Randy Dunlap 提交于
      sparse complains about differing types from prototype to
      definition, so change the u32 to phy_interface_t:
      
      drivers/net/phy/phy_device.c:140:19: error: symbol 'phy_connect' redeclared with different type (originally declared at include/linux/phy.h:362) - incompatible argument 5 (different signedness)
      drivers/net/phy/phy_device.c:190:19: error: symbol 'phy_attach' redeclared with different type (originally declared at include/linux/phy.h:360) - incompatible argument 4 (different signedness)
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      1a168934
  30. 14 12月, 2006 1 次提交
  31. 02 12月, 2006 2 次提交
    • A
      [PATCH] PHY: Add support for configuring the PHY connection interface · e8a2b6a4
      Andy Fleming 提交于
      Most PHYs connect to an ethernet controller over a GMII or MII
      interface.  However, a growing number are connected over
      different interfaces, such as RGMII or SGMII.
      
      The ethernet driver will tell the PHY what type of connection it
      is by setting it manually, or passing it in through phy_connect
      (or phy_attach).
      
      Changes include:
      * Updates to documentation
      * Updates to PHY Lib consumers
      * Changes to PHY Lib to add interface support
      * Some minor changes to whitespace in phy.h
      * gianfar driver now detects interface and passes appropriate
        value to PHY Lib
      Signed-off-by: NAndrew Fleming <afleming@freescale.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      e8a2b6a4
    • A
      [PATCH] Fixed a number of bugs in the PHY Layer · 6b655529
      Andy Fleming 提交于
      * genphy_update_link is now exported
      * Added a fix from ncase@xes-inc.com which changes forcing so it
        only updates the link.  Otherwise, it never tries the lower
        values, since it is always overwriting the speed/duplex values
        with the current ones, rather than the intended ones.
      * Fixed a bug where bringing up a PHY with no link caused it to
        timeout, and enter forcing mode.  Once in forcing mode,
        plugging in the link didn't autonegotiate.  Now the AN state
        detects the lack of link, and enters the NO_LINK state.  AN
        only times out if the link is up and AN fails
      * Cleaned up the PHY_AN case, reducing one level of indentation
        for the timeout code.
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6b655529
  32. 01 10月, 2006 1 次提交
  33. 26 9月, 2006 1 次提交
    • E
      [PATCH] Signedness issue in drivers/net/phy/phy_device.c · 84c22d79
      Eric Sesterhenn 提交于
      While checking gcc 4.1 -Wextra warnings, I stumbled across the following
      two warnings:
      
      drivers/net/phy/phy_device.c:528: warning: comparison of unsigned expression < 0 is always false
      drivers/net/phy/phy_device.c:546: warning: comparison of unsigned expression < 0 is always false
      
      Since phy_read() returns an integer and can return negative values, it seems
      to me the best way to get proper error handling working again is to make val
      an int.  Currently it is an u32, so the < 0 check always fails.
      Signed-off-by: NEric Sesterhenn <snakebyte@gmx.de>
      Cc: Jeff Garzik <jeff@garzik.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      84c22d79
  34. 20 8月, 2006 1 次提交
  35. 01 7月, 2006 1 次提交
  36. 24 12月, 2005 1 次提交
    • O
      [PATCH] missing license for libphy.ko · afcceaa3
      Olaf Hering 提交于
      Andy,
      
      libphy has no license tag. Something like the attached (untested!) patch
      is needed. Hopefully such a change finds its way into 2.6.15.
      
      filename: /lib/modules/2.6.15-rc5-3-ppc64/kernel/drivers/net/phy/libphy.ko
      vermagic:       2.6.15-rc5-3-ppc64 SMP gcc-4.1
      depends:
      srcversion:     ACC921B5E82701BE1E6F603
      
       drivers/net/phy/phy_device.c |    4 ++++
       1 files changed, 4 insertions(+)
      Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
      afcceaa3
  37. 06 11月, 2005 1 次提交