<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/net/phy/phy.c, branch v4.5</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-01-21T18:48:51Z</updated>
<entry>
<title>net: phy: Fix phy_mac_interrupt()</title>
<updated>2016-01-21T18:48:51Z</updated>
<author>
<name>Florian Fainelli</name>
<email>f.fainelli@gmail.com</email>
</author>
<published>2016-01-19T03:33:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=deccd16f91f930af8e91ffbbfc839d0ad8da999d'/>
<id>urn:sha1:deccd16f91f930af8e91ffbbfc839d0ad8da999d</id>
<content type='text'>
Commit 5ea94e7686a3 ("phy: add phy_mac_interrupt()") to use with
PHY_IGNORE_INTERRUPT added a cancel_work_sync() into phy_mac_interrupt()
which is allowed to sleep, whereas phy_mac_interrupt() is expected to be
callable from interrupt context.

Now that we have fixed how the PHY state machine treats
PHY_IGNORE_INTERRUPT with respect to state changes, we can just set the
new link state, and queue the PHY state machine for execution so it is
going to read the new link state.

For that to work properly, we need to update phy_change() not to try to
invoke any interrupt callbacks if we have configured the PHY device for
PHY_IGNORE_INTERRUPT, because that PHY device and its driver are not
required to implement those.

Fixes: 5ea94e7686a3 ("phy: add phy_mac_interrupt() to use with PHY_IGNORE_INTERRUPT")
Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: phy: Avoid polling PHY with PHY_IGNORE_INTERRUPTS</title>
<updated>2016-01-21T18:48:51Z</updated>
<author>
<name>Florian Fainelli</name>
<email>f.fainelli@gmail.com</email>
</author>
<published>2016-01-19T03:33:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d5c3d84657db57bd23ecd58b97f1c99dd42a7b80'/>
<id>urn:sha1:d5c3d84657db57bd23ecd58b97f1c99dd42a7b80</id>
<content type='text'>
Commit 2c7b49212a86 ("phy: fix the use of PHY_IGNORE_INTERRUPT") changed
a hunk in phy_state_machine() in the PHY_RUNNING case which was not
needed. The change essentially makes the PHY library treat PHY devices
with PHY_IGNORE_INTERRUPT to keep polling for the PHY device, even
though the intent is not to do it.

Fix this by reverting that specific hunk, which makes the PHY state
machine wait for state changes, and stay in the PHY_RUNNING state for as
long as needed.

Fixes: 2c7b49212a86 ("phy: fix the use of PHY_IGNORE_INTERRUPT")
Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>phy: Add an mdio_device structure</title>
<updated>2016-01-07T19:31:26Z</updated>
<author>
<name>Andrew Lunn</name>
<email>andrew@lunn.ch</email>
</author>
<published>2016-01-06T19:11:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e5a03bfd873c29eb786655ef2e95e53ed242b404'/>
<id>urn:sha1:e5a03bfd873c29eb786655ef2e95e53ed242b404</id>
<content type='text'>
Not all devices attached to an MDIO bus are phys. So add an
mdio_device structure to represent the generic parts of an mdio
device, and place this structure into the phy_device.

Signed-off-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>phy: phy_{read|write}_mmd_indirect: get addr from phydev</title>
<updated>2016-01-07T19:31:25Z</updated>
<author>
<name>Andrew Lunn</name>
<email>andrew@lunn.ch</email>
</author>
<published>2016-01-06T19:11:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=053e7e169229adebbc27fc176c5369398e9f5eba'/>
<id>urn:sha1:053e7e169229adebbc27fc176c5369398e9f5eba</id>
<content type='text'>
The address of the device can be determined from the phydev structure,
rather than passing it as a parameter.

Signed-off-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Reviewed-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>phy: Add phydev_err() and phydev_dbg() macros</title>
<updated>2016-01-07T19:31:24Z</updated>
<author>
<name>Andrew Lunn</name>
<email>andrew@lunn.ch</email>
</author>
<published>2016-01-06T19:11:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=72ba48be3ec8e70937ad97d4420ef7144617c64b'/>
<id>urn:sha1:72ba48be3ec8e70937ad97d4420ef7144617c64b</id>
<content type='text'>
In preparation for moving some of the phy_device structure members,
add macros for printing errors and debug information.

Signed-off-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Reviewed-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: phy: reset only targeted phy</title>
<updated>2015-12-03T20:26:13Z</updated>
<author>
<name>Jérôme Pouiller</name>
<email>jezz@sysmic.org</email>
</author>
<published>2015-12-03T09:02:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cf18b7788fe1bf99e9c2ab580b065bf2d3cb1a34'/>
<id>urn:sha1:cf18b7788fe1bf99e9c2ab580b065bf2d3cb1a34</id>
<content type='text'>
It is possible to address another chip on same MDIO bus. The case is
correctly handled for media advertising. It is taken into account
only if mii_data-&gt;phy_id == phydev-&gt;addr. However, this condition
was missing for reset case.

Signed-off-by: Jérôme Pouiller &lt;jezz@sysmic.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: phy: Use interrupts when available in NOLINK state</title>
<updated>2015-11-17T20:25:44Z</updated>
<author>
<name>Andrew Lunn</name>
<email>andrew@lunn.ch</email>
</author>
<published>2015-11-16T22:36:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=321beec5047af83db90c88114b7e664b156f49fe'/>
<id>urn:sha1:321beec5047af83db90c88114b7e664b156f49fe</id>
<content type='text'>
The NOLINK state will poll the phy once a second to see if the link
has come up. If the phy has an interrupt line, this polling can be
skipped, since the phy should interrupt when the link returns.

Signed-off-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>phylib: simplify NULL checks</title>
<updated>2015-08-28T21:15:25Z</updated>
<author>
<name>Sergei Shtylyov</name>
<email>sergei.shtylyov@cogentembedded.com</email>
</author>
<published>2015-08-28T18:35:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ef899c0778a39063816e19d749a688c06a6ac78e'/>
<id>urn:sha1:ef899c0778a39063816e19d749a688c06a6ac78e</id>
<content type='text'>
Fix scripts/checkpatch.pl's messages like:

CHECK: Comparison to NULL could be written "!phydrv-&gt;read_mmd_indirect"

BTW, it doesn't detect the reversed comparisons (which I've fixed as well).

Signed-off-by: Sergei Shtylyov &lt;sergei.shtylyov@cogentembedded.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2015-08-28T04:45:31Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2015-08-28T04:45:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0d36938bb82a7775c21ce0a7429f08ba13d025b6'/>
<id>urn:sha1:0d36938bb82a7775c21ce0a7429f08ba13d025b6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>net: phy: add locking to phy_read_mmd_indirect()/phy_write_mmd_indirect()</title>
<updated>2015-08-25T23:30:46Z</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2015-08-25T08:49:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=05a7f582be961824d62a7f4a817f3783148b5f8a'/>
<id>urn:sha1:05a7f582be961824d62a7f4a817f3783148b5f8a</id>
<content type='text'>
The phy layer is missing locking for the above two functions - it
has been observed that two threads (userspace and the phy worker
thread) can race, entering the bus -&gt;write or -&gt;read functions
simultaneously.

This causes the FEC driver to initialise a completion while another
thread is waiting on it or while the interrupt is calling complete()
on it, which causes spinlock unlock-without-lock, spinlock lockups,
and completion timeouts.

Fixes: a59a4d192 ("phy: add the EEE support and the way to access to the MMD registers.")
Fixes: 0c1d77dfb ("net: libphy: Add phy specific function to access mmd phy registers")
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Acked-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
