<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/net/phy/phy_device.c, branch v4.4</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.4</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-11-03T18:41:45Z</updated>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2015-11-03T18:41:45Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2015-11-03T18:41:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=73186df8d7fa574345f0ad626ebe89649f8308a5'/>
<id>urn:sha1:73186df8d7fa574345f0ad626ebe89649f8308a5</id>
<content type='text'>
Minor overlapping changes in net/ipv4/ipmr.c, in 'net' we were
fixing the "BH-ness" of the counter bumps whilst in 'net-next'
the functions were modified to take an explicit 'net' parameter.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: phy: fix a bug in get_phy_c45_ids</title>
<updated>2015-11-03T04:45:20Z</updated>
<author>
<name>Shaohui Xie</name>
<email>Shaohui.Xie@freescale.com</email>
</author>
<published>2015-11-03T04:27:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5f6c99e0ab805d8ec9eda105822912d49aa1d409'/>
<id>urn:sha1:5f6c99e0ab805d8ec9eda105822912d49aa1d409</id>
<content type='text'>
When probing devices-in-package for a c45 phy, device zero is the last
device to probe, however, if driver reads 0 from device zero,
c45_ids-&gt;devices_in_package is set to '0', the loop condition of probing
will be matched again, see codes below:

for (i = 1;i &lt; num_ids &amp;&amp; c45_ids-&gt;devices_in_package == 0;i++)

driver will run in a dead loop.

This patch restructures the bug and confusing loop, it provides a helper
function get_phy_c45_devs_in_pkg which to read devices-in-package registers
of a MMD, and rewrites the loop with using the helper function.

Signed-off-by: Shaohui Xie &lt;Shaohui.Xie@freescale.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>phylib: Add phy_set_max_speed helper</title>
<updated>2015-10-03T12:05:18Z</updated>
<author>
<name>Simon Horman</name>
<email>horms+renesas@verge.net.au</email>
</author>
<published>2015-09-30T06:15:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f3a6bd393c2c5d0e6b16624ba99a1c5fa07bdb0b'/>
<id>urn:sha1:f3a6bd393c2c5d0e6b16624ba99a1c5fa07bdb0b</id>
<content type='text'>
Add a helper to allow ethernet drivers to limit the speed of a phy
(that they are attached to).

This mainly involves factoring out the business-end of
of_set_phy_supported() and exporting a new symbol.

This code seems to be open coded in several places, in several different
variants.

It is is envisaged that this will be used in situations where setting the
"max-speed" property in DT is not appropriate, e.g. because the maximum
speed is not a property of the phy hardware.

Signed-off-by: Simon Horman &lt;horms+renesas@verge.net.au&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>phy: add phy_device_remove()</title>
<updated>2015-09-25T06:04:53Z</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2015-09-24T19:36:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=38737e490d4ea91660d3cec83ef88c4e6d360ae4'/>
<id>urn:sha1:38737e490d4ea91660d3cec83ef88c4e6d360ae4</id>
<content type='text'>
Add a phy_device_remove() function to complement phy_device_register(),
which undoes the effects of phy_device_register() by removing the phy
device from visibility, but not freeing it.

This allows these details to be moved out of the mdio bus code into
the phy code where this action belongs.

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>phy: add proper phy struct device refcounting</title>
<updated>2015-09-25T06:04:52Z</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2015-09-24T19:36:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7322967bc1bd97ac9c49ecea19e5a1f681ca27ee'/>
<id>urn:sha1:7322967bc1bd97ac9c49ecea19e5a1f681ca27ee</id>
<content type='text'>
Take a refcount on the phy struct device when the phy device is attached
to a network device, and drop it after it's detached.  This ensures that
a refcount is held on the phy device while the device is being used by
a network device, thereby preventing the phy_device from being
unexpectedly kfree()'d by phy_device_release().

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>phy: fix mdiobus module safety</title>
<updated>2015-09-25T06:04:52Z</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2015-09-24T19:36:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3e3aaf649416988ca8be4ad2c52dc24d8be7b46e'/>
<id>urn:sha1:3e3aaf649416988ca8be4ad2c52dc24d8be7b46e</id>
<content type='text'>
Re-implement the mdiobus module refcounting to ensure that we actually
ensure that the mdiobus module code does not go away while we might call
into it.

The old scheme using bus-&gt;dev.driver was buggy, because bus-&gt;dev is a
class device which never has a struct device_driver associated with it,
and hence the associated code trying to obtain a refcount did nothing
useful.

Instead, take the approach that other subsystems do: pass the module
when calling mdiobus_register(), and record that in the mii_bus struct.
When we need to increment the module use count in the phy code, use
this stored pointer.  When the phy is deteched, drop the module
refcount, remembering that the phy device might go away at that point.

This doesn't stop the mii_bus going away while there are in-use phys -
it merely stops the underlying code vanishing.

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&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>phylib: simplify bogus phy_device_create() result</title>
<updated>2015-08-28T21:15:24Z</updated>
<author>
<name>Sergei Shtylyov</name>
<email>sergei.shtylyov@cogentembedded.com</email>
</author>
<published>2015-08-28T18:34:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d3765f08d6f32f17ac898ec1f19957b322d4157f'/>
<id>urn:sha1:d3765f08d6f32f17ac898ec1f19957b322d4157f</id>
<content type='text'>
Get rid of the bogus string of type casts where ERR_PTR() is enough.

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>phylib: Make PHYs children of their MDIO bus, not the bus' parent.</title>
<updated>2015-08-25T18:30:23Z</updated>
<author>
<name>David Daney</name>
<email>david.daney@cavium.com</email>
</author>
<published>2015-08-21T23:16:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8b63ec1837fa4c1ea604b278d201454eb3b85066'/>
<id>urn:sha1:8b63ec1837fa4c1ea604b278d201454eb3b85066</id>
<content type='text'>
commit 18ee49ddb0d2 ("phylib: rename mii_bus::dev to mii_bus::parent")
changed the parent of PHY devices from the bus to the bus parent.

Then, commit 4dea547fef1b ("phylib: rework to prepare for OF
registration of PHYs") moved the code into phy_device.c

At this point, it is somewhat unclear why the change was seen as
necessary.  But, when we look at the device model tree in
/sys/devices, it is clearly incorrect.  The PHYs should be children of
their MDIO bus.

Change the PHY's parent device to be the MDIO bus device.

Cc: Lennert Buytenhek &lt;buytenh@wantstofly.org&gt;
Cc: Grant Likely &lt;grant.likely@secretlab.ca&gt;
Signed-off-by: David Daney &lt;david.daney@cavium.com&gt;
Acked-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: tune get_phy_c45_ids to support more c45 phy</title>
<updated>2015-06-29T00:05:58Z</updated>
<author>
<name>Shengzhou Liu</name>
<email>Shengzhou.Liu@freescale.com</email>
</author>
<published>2015-06-26T09:58:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=da1da284d7b271c77007e6dd6fa1fff54eaa7492'/>
<id>urn:sha1:da1da284d7b271c77007e6dd6fa1fff54eaa7492</id>
<content type='text'>
As some C45 10G PHYs(e.g. Cortina CS4315/CS4340 PHY) have
zero Devices In package, current driver can't get correct
devices_in_package value by non-zero Devices In package.
so let's probe more with zero Devices In package to support
more C45 PHYs.

Signed-off-by: Shengzhou Liu &lt;Shengzhou.Liu@freescale.com&gt;
Reviewed-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
