<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/drivers/net/phy/mdio_bus.c, branch dev-4.4</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-4.4</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-4.4'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2015-10-23T12:57:43+00:00</updated>
<entry>
<title>net: phy: Add nested variants of mdiobus read/write</title>
<updated>2015-10-23T12:57:43+00:00</updated>
<author>
<name>Neil Armstrong</name>
<email>narmstrong@baylibre.com</email>
</author>
<published>2015-10-22T08:37:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=21dd19fed3c3eb42a3877600f4a97a774323e562'/>
<id>urn:sha1:21dd19fed3c3eb42a3877600f4a97a774323e562</id>
<content type='text'>
Since nested variants of mdiobus_read/write are used in multiple
drivers, add nested variants in the mdiobus core.

Suggested-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: Neil Armstrong &lt;narmstrong@baylibre.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: update docbook comment for __mdiobus_register()</title>
<updated>2015-09-26T04:37:19+00:00</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2015-09-25T10:56:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=59f069789c98678710ed30a4be0daa3546ec82c7'/>
<id>urn:sha1:59f069789c98678710ed30a4be0daa3546ec82c7</id>
<content type='text'>
Update the docbook comment for __mdiobus_register() to include the new
module owner argument.  This resolves a warning found by the 0-day
builder.

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 phy_device_remove()</title>
<updated>2015-09-25T06:04:53+00:00</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2015-09-24T19:36:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/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: fix mdiobus module safety</title>
<updated>2015-09-25T06:04:52+00:00</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2015-09-24T19:36:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/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>phy: fix of_mdio_find_bus() device refcount leak</title>
<updated>2015-09-25T06:04:52+00:00</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2015-09-24T19:35:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=a136442131443d929d2d8d243157824de4dfbae8'/>
<id>urn:sha1:a136442131443d929d2d8d243157824de4dfbae8</id>
<content type='text'>
of_mdio_find_bus() leaks a struct device refcount, caused by using
class_find_device() and not realising that the device reference has
its refcount incremented:

 * Note, you will need to drop the reference with put_device() after use.
...
        while ((dev = class_dev_iter_next(&amp;iter))) {
                if (match(dev, data)) {
                        get_device(dev);
                        break;
                }

Update the comment, and arrange for the phy code to drop this refcount
when disposing of a reference to it.

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: fix device deletion order in mdiobus_unregister()</title>
<updated>2015-09-01T22:02:36+00:00</updated>
<author>
<name>Mark Salter</name>
<email>msalter@redhat.com</email>
</author>
<published>2015-09-01T13:36:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=b6c6aedcbcbacd7b0cb4b64ed5ac835bc1c60a03'/>
<id>urn:sha1:b6c6aedcbcbacd7b0cb4b64ed5ac835bc1c60a03</id>
<content type='text'>
commit 8b63ec1837fa ("phylib: Make PHYs children of their MDIO bus, not
the bus' parent.") uncovered a problem in mdiobus_unregister() which
leads to this warning when I reboot an APM Mustang (arm64) platform:

  WARNING: CPU: 7 PID: 4239 at fs/sysfs/group.c:224 sysfs_remove_group+0xa0/0xa4()
  sysfs group fffffe0000e07a10 not found for kobject 'xgene-mii-eth0:03'
  ...
  CPU: 7 PID: 4239 Comm: reboot Tainted: G            E   4.2.0-0.18.el7.test15.aarch64 #1
  Hardware name: AppliedMicro Mustang/Mustang, BIOS 1.1.0 Aug 26 2015
  Call Trace:
  [&lt;fffffe000009739c&gt;] dump_backtrace+0x0/0x170
  [&lt;fffffe000009752c&gt;] show_stack+0x20/0x2c
  [&lt;fffffe00007436f0&gt;] dump_stack+0x78/0x9c
  [&lt;fffffe00000c2cb4&gt;] warn_slowpath_common+0xa0/0xd8
  [&lt;fffffe00000c2d60&gt;] warn_slowpath_fmt+0x74/0x88
  [&lt;fffffe0000293d3c&gt;] sysfs_remove_group+0x9c/0xa4
  [&lt;fffffe00004a8bac&gt;] dpm_sysfs_remove+0x5c/0x70
  [&lt;fffffe000049b388&gt;] device_del+0x44/0x208
  [&lt;fffffe000049b578&gt;] device_unregister+0x2c/0x7c
  [&lt;fffffe000050dc68&gt;] mdiobus_unregister+0x48/0x94
  [&lt;fffffe000052afd0&gt;] xgene_enet_mdio_remove+0x28/0x44
  [&lt;fffffe000052d3f0&gt;] xgene_enet_remove+0xd0/0xd8
  [&lt;fffffe000052d424&gt;] xgene_enet_shutdown+0x2c/0x3c
  [&lt;fffffe00004a204c&gt;] platform_drv_shutdown+0x24/0x40
  [&lt;fffffe000049d4f4&gt;] device_shutdown+0xf0/0x1b4
  [&lt;fffffe00000e31ec&gt;] kernel_restart_prepare+0x40/0x4c
  [&lt;fffffe00000e32f8&gt;] kernel_restart+0x1c/0x80
  [&lt;fffffe00000e3670&gt;] SyS_reboot+0x17c/0x250

The problem is that mdiobus_unregister() deletes the bus device before
unregistering the phy devices on the bus. This wasn't a problem before
because the phys were not children of the bus:

  /sys/devices/platform/APMC0D05:00/net/eth0/xgene-mii-eth0:03
  /sys/devices/platform/APMC0D05:00/net/eth0/xgene-mii-eth0

But now that they are:

  /sys/devices/platform/APMC0D05:00/net/eth0/xgene-mii-eth0/xgene-mii-eth0:03

when mdiobus_unregister deletes the bus device, the phy subdirs are
removed from sysfs also. So when the phys are unregistered afterward,
we get the warning. This patch changes the order so that phys are
unregistered before the bus device is deleted.

Fixes: 8b63ec1837fa ("phylib: Make PHYs children of their MDIO bus, not the bus' parent.")
Signed-off-by: Mark Salter &lt;msalter@redhat.com&gt;
Reviewed-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Tested-by: Mark Langsdorf &lt;mlangsdo@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/mdio: fix mdio_bus_match for c45 PHY</title>
<updated>2015-07-21T07:16:37+00:00</updated>
<author>
<name>Shaohui Xie</name>
<email>Shaohui.Xie@freescale.com</email>
</author>
<published>2015-07-17T10:07:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=e0536cd910d5bc98300d7830f1d9317df9ab8afa'/>
<id>urn:sha1:e0536cd910d5bc98300d7830f1d9317df9ab8afa</id>
<content type='text'>
We store c45 PHY's id information in c45_ids, so it should be used to
check the matching between PHY driver and PHY device for c45 PHY.

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>net: phy: avoid suspending twice a PHY</title>
<updated>2015-01-27T08:16:51+00:00</updated>
<author>
<name>Florian Fainelli</name>
<email>f.fainelli@gmail.com</email>
</author>
<published>2015-01-27T06:05:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=803dd9c77ac3a08958535f2a1ad5890104e2c235'/>
<id>urn:sha1:803dd9c77ac3a08958535f2a1ad5890104e2c235</id>
<content type='text'>
As part of a call to ndo_close() a netdevice driver may call
phy_disconnect() -&gt; phy_detach() -&gt; phy_suspend(), such that the PHY is
suspsended at this point and a netdevice driver may clock gate the
backing peripheral providing MDIO bus accessses as well.

Update mdio_bus_phy_may_suspend() to return whether a PHY is allowed to
be suspended and conversely resumed if and only if it was not previously
suspended before while it is currently in detached (netdev pointer is
NULL) state.

This fixes bus errors seen during S2/S3 suspend/resume cycles for
netdevice drivers such as GENET which clock gates the entire Ethernet
MAC, including the MDIO bus block.

Acked-by: Fugang Duan &lt;B38611@freescale.com&gt;
Tested-by: Fugang Duan &lt;B38611@freescale.com&gt;
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: utilize phy_suspend and phy_resume</title>
<updated>2015-01-27T08:16:51+00:00</updated>
<author>
<name>Florian Fainelli</name>
<email>f.fainelli@gmail.com</email>
</author>
<published>2015-01-27T06:05:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=9272efa2036f3f06625effc3a709416044578a92'/>
<id>urn:sha1:9272efa2036f3f06625effc3a709416044578a92</id>
<content type='text'>
phy_suspend and phy_resume are an abstraction on top of the PHY device
driver suspend and resume callbacks, utilize those since they are the
proper interface to suspending and resuming a PHY device.

Acked-by: Fugang Duan &lt;B38611@freescale.com&gt;
Tested-by: Fugang Duan &lt;B38611@freescale.com&gt;
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: properly report internal PHYs through sysfs</title>
<updated>2014-08-30T03:17:53+00:00</updated>
<author>
<name>Florian Fainelli</name>
<email>f.fainelli@gmail.com</email>
</author>
<published>2014-08-27T18:44:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=574746ddeca959cba407d6b556f96cb580fca8af'/>
<id>urn:sha1:574746ddeca959cba407d6b556f96cb580fca8af</id>
<content type='text'>
Internal PHYs may not have a valid PHY interface defined, which will
show up in sysfs as "". Add an explicit check of internal PHYs to report
their interface correctly.

Fixes: 3d055d8d1c24 ("net: phy: expose PHY device interface mode")
Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
