1. 28 5月, 2013 1 次提交
  2. 28 3月, 2013 1 次提交
  3. 12 3月, 2013 1 次提交
  4. 23 8月, 2012 1 次提交
    • A
      mdio: translation of MMD EEE registers to/from ethtool settings · b32607dd
      Allan, Bruce W 提交于
      The helper functions which translate IEEE MDIO Manageable Device (MMD)
      Energy-Efficient Ethernet (EEE) registers 3.20, 7.60 and 7.61 to and from
      the comparable ethtool supported/advertised settings will be needed by
      drivers other than those in PHYLIB (e.g. e1000e in a follow-on patch).
      
      In the same fashion as similar translation functions in linux/mii.h, move
      these functions from the PHYLIB core to the linux/mdio.h header file so the
      code will not have to be duplicated in each driver needing MMD-to-ethtool
      (and vice-versa) translations.  The function and some variable names have
      been renamed to be more descriptive.
      
      Not tested on the only hardware that currently calls the related functions,
      stmmac, because I don't have access to any.  Has been compile tested and
      the translations have been tested on a locally modified version of e1000e.
      Signed-off-by: NBruce Allan <bruce.w.allan@intel.com>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b32607dd
  5. 01 7月, 2012 1 次提交
    • G
      phy: add the EEE support and the way to access to the MMD registers. · a59a4d19
      Giuseppe CAVALLARO 提交于
      This patch adds the support for the Energy-Efficient Ethernet (EEE)
      to the Physical Abstraction Layer.
      To support the EEE we have to access to the MMD registers 3.20 and
      7.60/61. So two new functions have been added to read/write the MMD
      registers (clause 45).
      
      An Ethernet driver (I tested the stmmac) can invoke the phy_init_eee to properly
      check if the EEE is supported by the PHYs and it can also set the clock
      stop enable bit in the 3.0 register.
      The phy_get_eee_err can be used for reporting the number of time where
      the PHY failed to complete its normal wake sequence.
      
      In the end, this patch also adds the EEE ethtool support implementing:
       o phy_ethtool_set_eee
       o phy_ethtool_get_eee
      
      v1: initial patch
      v2: fixed some errors especially on naming convention
      v3: renamed again the mmd read/write functions thank to Ben's feedback
      v4: moved file to phy.c and added the ethtool support.
      v5: fixed phy_adv_to_eee, phy_eee_to_supported, phy_eee_to_adv return
          values according to ethtool API (thanks to Ben's feedback).
          Renamed some macros to avoid too long names.
      v6: fixed kernel-doc comments to be properly parsed.
          Fixed the phy_init_eee function: we need to check which link mode
          was autonegotiated and then the corresponding bits in 7.60 and 7.61
          registers.
      v7: reviewed the way to get the negotiated settings.
      v8: fixed a problem in the phy_init_eee return value erroneously added
          when included the phy_read_status call.
      v9: do not remove the MDIO_AN_EEE_ADV_100TX and MDIO_AN_EEE_ADV_1000T
          and fixed the eee_{cap,lp,adv} declaration as "int" instead of u16.
      Signed-off-by: NGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Reviewed-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a59a4d19
  6. 12 6月, 2012 1 次提交
  7. 27 7月, 2011 1 次提交
  8. 30 4月, 2011 2 次提交
  9. 15 3月, 2011 1 次提交
  10. 29 11月, 2010 1 次提交
  11. 25 10月, 2010 1 次提交
  12. 10 8月, 2010 1 次提交
  13. 19 7月, 2010 2 次提交
  14. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  15. 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
  16. 04 12月, 2009 1 次提交
  17. 04 9月, 2009 1 次提交
  18. 03 7月, 2009 1 次提交
  19. 16 4月, 2009 1 次提交
  20. 14 4月, 2009 1 次提交
    • A
      phylib: Allow early-out in phy_change · a8729eb3
      Anatolij Gustschin 提交于
      Marvell 88E1121R Dual PHY device can be hardware-configured
      to use shared interrupt pin for both PHY ports. For such
      PHY configurations using shared PHY interrupt phy_interrupt()
      handler will also schedule a work for PHY port which didn't
      cause an interrupt.
      
      This patch adds a possibility for PHY drivers to provide
      did_interrupt() function which reports if the PHY (or a PHY
      port in a multi-PHY device) generated an interrupt. This
      function is called in phy_change() as phy_change() shouldn't
      proceed if it is invoked for a PHY which didn't cause an
      interrupt. So check for interrupt originator in phy_change()
      to allow early-out.
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a8729eb3
  21. 03 4月, 2009 1 次提交
  22. 14 3月, 2009 1 次提交
  23. 11 11月, 2008 1 次提交
  24. 09 10月, 2008 3 次提交
  25. 07 5月, 2008 1 次提交
  26. 25 4月, 2008 1 次提交
  27. 03 2月, 2008 1 次提交
  28. 02 12月, 2007 1 次提交
    • D
      Stop phy code from returning success to unknown ioctls. · dda93b48
      David Woodhouse 提交于
      This kind of sucks, and prevents the Fedora installer from using the
      device for network installs...
      
      [root@efika phy]# iwconfig eth0
      Warning: Driver for device eth0 has been compiled with an ancient version
      of Wireless Extension, while this program support version 11 and later.
      Some things may be broken...
      
      eth0        ESSID:off/any  Nickname:""
                NWID:0  Channel:0  Access Point: 00:00:BF:81:14:E0
                Bit Rate:-1.08206e+06 kb/s   Sensitivity=0/0
                RTS thr:off   Fragment thr:off
                Encryption key:<too big>
                Power Management:off
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      dda93b48
  29. 11 10月, 2007 4 次提交
    • M
      PHYLIB: fix an interrupt loop potential when halting · 6daf6531
      Maciej W. Rozycki 提交于
      Ensure the PHY_HALTED state is not entered with the IRQ asserted as it
      could lead to an interrupt loop.
      
      There is a small window in phy_stop(), where the state of the PHY machine
      indicates it has been halted, but its interrupt output might still be
      unmasked.  If an interrupt goes active right at this moment it will loop as
      the phy_interrupt() handler exits immediately with IRQ_NONE if the halted
      state is seen.  It is unsafe to extend the phydev spinlock to cover
      phy_interrupt().  It is safe to swap the order of the actions though as all
      the competing places to unmask the interrupt output of the PHY, which are
      phy_change() and phy_timer() are already covered with the lock as is the
      sequence in question.
      Signed-off-by: NMaciej W. Rozycki <macro@linux-mips.org>
      Cc: Andy Fleming <afleming@freescale.com>
      Cc: Jeff Garzik <jgarzik@pobox.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6daf6531
    • M
      PHYLIB: IRQ event workqueue handling fixes · 0ac49527
      Maciej W. Rozycki 提交于
      Keep track of disable_irq_nosync() invocations and call enable_irq() the
      right number of times if work has been cancelled that would include them.
      
      Now that the call to flush_work_keventd() (problematic because of
      rtnl_mutex being held) has been replaced by cancel_work_sync() another
      issue has arisen and been left unresolved.  As the MDIO bus cannot be
      accessed from the interrupt context the PHY interrupt handler uses
      disable_irq_nosync() to prevent from looping and schedules some work to be
      done as a softirq, which, apart from handling the state change of the
      originating PHY, is responsible for reenabling the interrupt.  Now if the
      interrupt line is shared by another device and a call to the softirq
      handler has been cancelled, that call to enable_irq() never happens and the
      other device cannot use its interrupt anymore as its stuck disabled.
      
      I decided to use a counter rather than a flag because there may be more
      than one call to phy_change() cancelled in the queue -- a real one and a
      fake one triggered by free_irq() if DEBUG_SHIRQ is used, if nothing else.
      Therefore because of its nesting property enable_irq() has to be called the
      right number of times to match the number disable_irq_nosync() was called
      and restore the original state.  This DEBUG_SHIRQ feature is also the
      reason why free_irq() has to be called before cancel_work_sync().
      
      While at it I updated the comment about phy_stop_interrupts() being called
      from `keventd' -- this is no longer relevant as the use of
      cancel_work_sync() makes such an approach unnecessary.  OTOH a similar
      comment referring to flush_scheduled_work() in phy_stop() still applies as
      using cancel_work_sync() there would be dangerous.
      
      Checked with checkpatch.pl and at the run time (with and without
      DEBUG_SHIRQ).
      Signed-off-by: NMaciej W. Rozycki <macro@linux-mips.org>
      Cc: Andy Fleming <afleming@freescale.com>
      Cc: Jeff Garzik <jgarzik@pobox.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      0ac49527
    • 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
    • D
      drivers/net/: all drivers/net/ cleanup with ARRAY_SIZE · ff8ac609
      Denis Cheng 提交于
      Signed-off-by: NDenis Cheng <crquan@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      ff8ac609
  30. 20 9月, 2007 1 次提交
  31. 13 9月, 2007 1 次提交
  32. 08 8月, 2007 1 次提交
  33. 10 5月, 2007 1 次提交