<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/net/phy/phy.c, branch ipvs/droutbytes</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=ipvs%2Fdroutbytes</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=ipvs%2Fdroutbytes'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2008-05-06T16:01:41Z</updated>
<entry>
<title>phylib: Fix some sparse warnings</title>
<updated>2008-05-06T16:01:41Z</updated>
<author>
<name>Andy Fleming</name>
<email>afleming@freescale.com</email>
</author>
<published>2008-05-02T18:00:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9b9a8bfc8dfbe09dc57f274e32e8b06151abbad7'/>
<id>urn:sha1:9b9a8bfc8dfbe09dc57f274e32e8b06151abbad7</id>
<content type='text'>
Declared some things static, declared some things in the header.

Signed-off-by: Andy Fleming &lt;afleming@freescale.com&gt;
Signed-off-by: Jeff Garzik &lt;jgarzik@redhat.com&gt;
</content>
</entry>
<entry>
<title>phylib: Add support for board-level PHY fixups</title>
<updated>2008-04-25T06:08:52Z</updated>
<author>
<name>Andy Fleming</name>
<email>afleming@freescale.com</email>
</author>
<published>2008-04-18T22:29:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f62220d3a9ccb879c3f90f845ae57b724b7bbb62'/>
<id>urn:sha1:f62220d3a9ccb879c3f90f845ae57b724b7bbb62</id>
<content type='text'>
Sometimes the specific interaction between the platform and the PHY
requires special handling.  For instance, to change where the PHY's
clock input is, or to add a delay to account for latency issues in the
data path.  We add a mechanism for registering a callback with the PHY
Lib to be called on matching PHYs when they are brought up, or reset.

Signed-off-by: Andy Fleming &lt;afleming@freescale.com&gt;
Signed-off-by: Jeff Garzik &lt;jgarzik@redhat.com&gt;
</content>
</entry>
<entry>
<title>PHYLIB: Locking fixes for PHY I/O potentially sleeping</title>
<updated>2008-02-03T12:28:41Z</updated>
<author>
<name>Nate Case</name>
<email>ncase@xes-inc.com</email>
</author>
<published>2008-01-29T16:05:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=35b5f6b1a82b5c586e0b24c711dc6ba944e88ef1'/>
<id>urn:sha1:35b5f6b1a82b5c586e0b24c711dc6ba944e88ef1</id>
<content type='text'>
PHY read/write functions can potentially sleep (e.g., a PHY accessed
via I2C).  The following changes were made to account for this:

    * Change spin locks to mutex locks
    * Add a BUG_ON() to phy_read() phy_write() to warn against
      calling them from an interrupt context.
    * Use work queue for PHY state machine handling since
      it can potentially sleep
    * Change phydev lock from spinlock to mutex

Signed-off-by: Nate Case &lt;ncase@xes-inc.com&gt;
Acked-by: Andy Fleming &lt;afleming@freescale.com&gt;
Signed-off-by: Jeff Garzik &lt;jeff@garzik.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Stop phy code from returning success to unknown ioctls.</title>
<updated>2007-12-01T21:35:51Z</updated>
<author>
<name>David Woodhouse</name>
<email>dwmw2@infradead.org</email>
</author>
<published>2007-11-28T19:56:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=dda93b486a25009456fca6b9c925ab4d7c6b6d6a'/>
<id>urn:sha1:dda93b486a25009456fca6b9c925ab4d7c6b6d6a</id>
<content type='text'>
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:&lt;too big&gt;
          Power Management:off

Signed-off-by: David Woodhouse &lt;dwmw2@infradead.org&gt;
Signed-off-by: Jeff Garzik &lt;jeff@garzik.org&gt;
</content>
</entry>
<entry>
<title>PHYLIB: fix an interrupt loop potential when halting</title>
<updated>2007-10-10T23:53:55Z</updated>
<author>
<name>Maciej W. Rozycki</name>
<email>macro@linux-mips.org</email>
</author>
<published>2007-09-29T05:42:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6daf65310374d24d888201b7a6eba90b44008b7b'/>
<id>urn:sha1:6daf65310374d24d888201b7a6eba90b44008b7b</id>
<content type='text'>
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: Maciej W. Rozycki &lt;macro@linux-mips.org&gt;
Cc: Andy Fleming &lt;afleming@freescale.com&gt;
Cc: Jeff Garzik &lt;jgarzik@pobox.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jeff Garzik &lt;jeff@garzik.org&gt;
</content>
</entry>
<entry>
<title>PHYLIB: IRQ event workqueue handling fixes</title>
<updated>2007-10-10T23:53:55Z</updated>
<author>
<name>Maciej W. Rozycki</name>
<email>macro@linux-mips.org</email>
</author>
<published>2007-09-29T05:42:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0ac49527318bc388a881152d60f49d7951606024'/>
<id>urn:sha1:0ac49527318bc388a881152d60f49d7951606024</id>
<content type='text'>
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: Maciej W. Rozycki &lt;macro@linux-mips.org&gt;
Cc: Andy Fleming &lt;afleming@freescale.com&gt;
Cc: Jeff Garzik &lt;jgarzik@pobox.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jeff Garzik &lt;jeff@garzik.org&gt;
</content>
</entry>
<entry>
<title>PHYLIB: Spinlock fixes for softirqs</title>
<updated>2007-10-10T23:53:54Z</updated>
<author>
<name>Maciej W. Rozycki</name>
<email>macro@linux-mips.org</email>
</author>
<published>2007-09-29T05:42:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9ff8c68b3c722f732c7a13d6631b149cca8c7091'/>
<id>urn:sha1:9ff8c68b3c722f732c7a13d6631b149cca8c7091</id>
<content type='text'>
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: Maciej W. Rozycki &lt;macro@linux-mips.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jeff Garzik &lt;jeff@garzik.org&gt;
</content>
</entry>
<entry>
<title>drivers/net/: all drivers/net/ cleanup with ARRAY_SIZE</title>
<updated>2007-10-10T23:51:15Z</updated>
<author>
<name>Denis Cheng</name>
<email>crquan@gmail.com</email>
</author>
<published>2007-09-02T10:30:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ff8ac60948ba819b89e9c87083e8050fc2f89999'/>
<id>urn:sha1:ff8ac60948ba819b89e9c87083e8050fc2f89999</id>
<content type='text'>
Signed-off-by: Denis Cheng &lt;crquan@gmail.com&gt;
Signed-off-by: Jeff Garzik &lt;jeff@garzik.org&gt;
</content>
</entry>
<entry>
<title>phy: export phy_mii_ioctl</title>
<updated>2007-09-20T06:35:50Z</updated>
<author>
<name>Domen Puncer</name>
<email>domen@coderock.org</email>
</author>
<published>2007-09-17T20:21:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=680e9fe9d69ea86e81c859932bfd751be91cc0e0'/>
<id>urn:sha1:680e9fe9d69ea86e81c859932bfd751be91cc0e0</id>
<content type='text'>
Export phy_mii_ioctl, so network drivers can use it when built
as modules too.

Signed-off-by: Domen Puncer &lt;domen@coderock.org&gt;
Signed-off-by: Jeff Garzik &lt;jeff@garzik.org&gt;
</content>
</entry>
<entry>
<title>Fix a lock problem in generic phy code</title>
<updated>2007-09-13T04:12:43Z</updated>
<author>
<name>Hans-Jürgen Koch</name>
<email>hjk@linutronix.de</email>
</author>
<published>2007-08-31T12:30:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=026d7917e592f91063861e002adf1c806d7756ae'/>
<id>urn:sha1:026d7917e592f91063861e002adf1c806d7756ae</id>
<content type='text'>
Lock debugging finds a problem in phy.c and phy_device.c,
this patch fixes it. Tested on an AT91SAM9263-EK board,
kernel 2.6.23-rc4.

Signed-off-by: Hans J. Koch &lt;hjk@linutronix.de&gt;
Signed-off-by: Jeff Garzik &lt;jeff@garzik.org&gt;
</content>
</entry>
</feed>
