<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/net/phy, branch v5.4.171</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.4.171</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.4.171'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2022-01-11T14:23:32Z</updated>
<entry>
<title>net: phy: micrel: set soft_reset callback to genphy_soft_reset for KSZ8081</title>
<updated>2022-01-11T14:23:32Z</updated>
<author>
<name>Christian Melki</name>
<email>christian.melki@t2data.com</email>
</author>
<published>2021-02-24T20:55:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=10f2c336929df70c0d7e89930afbd746cbe8d5f0'/>
<id>urn:sha1:10f2c336929df70c0d7e89930afbd746cbe8d5f0</id>
<content type='text'>
commit 764d31cacfe48440745c4bbb55a62ac9471c9f19 upstream.

Following a similar reinstate for the KSZ9031.

Older kernels would use the genphy_soft_reset if the PHY did not implement
a .soft_reset.

Bluntly removing that default may expose a lot of situations where various
PHYs/board implementations won't recover on various changes.
Like with this implementation during a 4.9.x to 5.4.x LTS transition.
I think it's a good thing to remove unwanted soft resets but wonder if it
did open a can of worms?

Atleast this fixes one iMX6 FEC/RMII/8081 combo.

Fixes: 6e2d85ec0559 ("net: phy: Stop with excessive soft reset")
Signed-off-by: Christian Melki &lt;christian.melki@t2data.com&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Link: https://lore.kernel.org/r/20210224205536.9349-1-christian.melki@t2data.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Wadim Egorov &lt;w.egorov@phytec.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mdio: aspeed: Fix "Link is Down" issue</title>
<updated>2021-12-01T08:23:29Z</updated>
<author>
<name>Dylan Hung</name>
<email>dylan_hung@aspeedtech.com</email>
</author>
<published>2021-11-25T02:44:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=57c7d46e8b1d4a8f511b3e03ca5861b8520b219a'/>
<id>urn:sha1:57c7d46e8b1d4a8f511b3e03ca5861b8520b219a</id>
<content type='text'>
commit 9dbe33cf371bd70330858370bdbc35c7668f00c3 upstream.

The issue happened randomly in runtime.  The message "Link is Down" is
popped but soon it recovered to "Link is Up".

The "Link is Down" results from the incorrect read data for reading the
PHY register via MDIO bus.  The correct sequence for reading the data
shall be:
1. fire the command
2. wait for command done (this step was missing)
3. wait for data idle
4. read data from data register

Cc: stable@vger.kernel.org
Fixes: f160e99462c6 ("net: phy: Add mdio-aspeed")
Reviewed-by: Joel Stanley &lt;joel@jms.id.au&gt;
Signed-off-by: Dylan Hung &lt;dylan_hung@aspeedtech.com&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Reviewed-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Link: https://lore.kernel.org/r/20211125024432.15809-1-dylan_hung@aspeedtech.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>net: phylink: avoid mvneta warning when setting pause parameters</title>
<updated>2021-11-17T08:48:40Z</updated>
<author>
<name>Russell King (Oracle)</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2021-10-28T14:55:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9be9cb2a2be4f720a64c8c887934f11c8f4a1253'/>
<id>urn:sha1:9be9cb2a2be4f720a64c8c887934f11c8f4a1253</id>
<content type='text'>
[ Upstream commit fd8d9731bcdfb22d28e45bce789bcb211c868c78 ]

mvneta does not support asymetric pause modes, and it flags this by the
lack of AsymPause in the supported field. When setting pause modes, we
check that pause-&gt;rx_pause == pause-&gt;tx_pause, but only when pause
autoneg is enabled. When pause autoneg is disabled, we still allow
pause-&gt;rx_pause != pause-&gt;tx_pause, which is incorrect when the MAC
does not support asymetric pause, and causes mvneta to issue a warning.

Fix this by removing the test for pause-&gt;autoneg, so we always check
that pause-&gt;rx_pause == pause-&gt;tx_pause for network devices that do not
support AsymPause.

Fixes: 9525ae83959b ("phylink: add phylink infrastructure")
Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>phy: micrel: ksz8041nl: do not use power down mode</title>
<updated>2021-11-17T08:48:38Z</updated>
<author>
<name>Stefan Agner</name>
<email>stefan@agner.ch</email>
</author>
<published>2021-10-19T19:16:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=67ba6c8e715f652f73cd6011288184d0ef8d85c4'/>
<id>urn:sha1:67ba6c8e715f652f73cd6011288184d0ef8d85c4</id>
<content type='text'>
[ Upstream commit 2641b62d2fab52648e34cdc6994b2eacde2d27c1 ]

Some Micrel KSZ8041NL PHY chips exhibit continuous RX errors after using
the power down mode bit (0.11). If the PHY is taken out of power down
mode in a certain temperature range, the PHY enters a weird state which
leads to continuously reporting RX errors. In that state, the MAC is not
able to receive or send any Ethernet frames and the activity LED is
constantly blinking. Since Linux is using the suspend callback when the
interface is taken down, ending up in that state can easily happen
during a normal startup.

Micrel confirmed the issue in errata DS80000700A [*], caused by abnormal
clock recovery when using power down mode. Even the latest revision (A4,
Revision ID 0x1513) seems to suffer that problem, and according to the
errata is not going to be fixed.

Remove the suspend/resume callback to avoid using the power down mode
completely.

[*] https://ww1.microchip.com/downloads/en/DeviceDoc/80000700A.pdf

Fixes: 1a5465f5d6a2 ("phy/micrel: Add suspend/resume support to Micrel PHYs")
Signed-off-by: Stefan Agner &lt;stefan@agner.ch&gt;
Acked-by: Marcel Ziswiler &lt;marcel.ziswiler@toradex.com&gt;
Signed-off-by: Francesco Dolcini &lt;francesco.dolcini@toradex.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>phy: phy_start_aneg: Add an unlocked version</title>
<updated>2021-11-02T18:46:14Z</updated>
<author>
<name>Andrew Lunn</name>
<email>andrew@lunn.ch</email>
</author>
<published>2021-10-24T19:48:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5395650d154c84eb5e0a38bdad2b4dc86e5e9684'/>
<id>urn:sha1:5395650d154c84eb5e0a38bdad2b4dc86e5e9684</id>
<content type='text'>
commit 707293a56f95f8e7e0cfae008010c7933fb68973 upstream.

Split phy_start_aneg into a wrapper which takes the PHY lock, and a
helper doing the real work. This will be needed when
phy_ethtook_ksettings_set takes the lock.

Fixes: 2d55173e71b0 ("phy: add generic function to support ksetting support")
Signed-off-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>phy: phy_ethtool_ksettings_get: Lock the phy for consistency</title>
<updated>2021-11-02T18:46:14Z</updated>
<author>
<name>Andrew Lunn</name>
<email>andrew@lunn.ch</email>
</author>
<published>2021-10-24T19:48:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c85b696270db3bf5c57fc0eb30548cfafc00bc3a'/>
<id>urn:sha1:c85b696270db3bf5c57fc0eb30548cfafc00bc3a</id>
<content type='text'>
commit c10a485c3de5ccbf1fff65a382cebcb2730c6b06 upstream.

The PHY structure should be locked while copying information out if
it, otherwise there is no guarantee of self consistency. Without the
lock the PHY state machine could be updating the structure.

Fixes: 2d55173e71b0 ("phy: add generic function to support ksetting support")
Signed-off-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "net: mdiobus: Fix memory leak in __mdiobus_register"</title>
<updated>2021-11-02T18:46:12Z</updated>
<author>
<name>Pavel Skripkin</name>
<email>paskripkin@gmail.com</email>
</author>
<published>2021-09-30T17:49:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6a18d155d5b35ad50c8fac2be091212487ae58ec'/>
<id>urn:sha1:6a18d155d5b35ad50c8fac2be091212487ae58ec</id>
<content type='text'>
commit 10eff1f5788b6ffac212c254e2f3666219576889 upstream.

This reverts commit ab609f25d19858513919369ff3d9a63c02cd9e2e.

This patch is correct in the sense that we _should_ call device_put() in
case of device_register() failure, but the problem in this code is more
vast.

We need to set bus-&gt;state to UNMDIOBUS_REGISTERED before calling
device_register() to correctly release the device in mdiobus_free().
This patch prevents us from doing it, since in case of device_register()
failure put_device() will be called 2 times and it will cause UAF or
something else.

Also, Reported-by: tag in revered commit was wrong, since syzbot
reported different leak in same function.

Link: https://lore.kernel.org/netdev/20210928092657.GI2048@kadam/
Acked-by: Yanfei Xu &lt;yanfei.xu@windriver.com&gt;
Signed-off-by: Pavel Skripkin &lt;paskripkin@gmail.com&gt;
Link: https://lore.kernel.org/r/f12fb1faa4eccf0f355788225335eb4309ff2599.1633024062.git.paskripkin@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>net: mdiobus: Fix memory leak in __mdiobus_register</title>
<updated>2021-10-27T07:54:29Z</updated>
<author>
<name>Yanfei Xu</name>
<email>yanfei.xu@windriver.com</email>
</author>
<published>2021-09-26T04:53:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b0feaa8376f52357bf2fd020d0c471713a859728'/>
<id>urn:sha1:b0feaa8376f52357bf2fd020d0c471713a859728</id>
<content type='text'>
commit ab609f25d19858513919369ff3d9a63c02cd9e2e upstream.

Once device_register() failed, we should call put_device() to
decrement reference count for cleanup. Or it will cause memory
leak.

BUG: memory leak
unreferenced object 0xffff888114032e00 (size 256):
  comm "kworker/1:3", pid 2960, jiffies 4294943572 (age 15.920s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 08 2e 03 14 81 88 ff ff  ................
    08 2e 03 14 81 88 ff ff 90 76 65 82 ff ff ff ff  .........ve.....
  backtrace:
    [&lt;ffffffff8265cfab&gt;] kmalloc include/linux/slab.h:591 [inline]
    [&lt;ffffffff8265cfab&gt;] kzalloc include/linux/slab.h:721 [inline]
    [&lt;ffffffff8265cfab&gt;] device_private_init drivers/base/core.c:3203 [inline]
    [&lt;ffffffff8265cfab&gt;] device_add+0x89b/0xdf0 drivers/base/core.c:3253
    [&lt;ffffffff828dd643&gt;] __mdiobus_register+0xc3/0x450 drivers/net/phy/mdio_bus.c:537
    [&lt;ffffffff828cb835&gt;] __devm_mdiobus_register+0x75/0xf0 drivers/net/phy/mdio_devres.c:87
    [&lt;ffffffff82b92a00&gt;] ax88772_init_mdio drivers/net/usb/asix_devices.c:676 [inline]
    [&lt;ffffffff82b92a00&gt;] ax88772_bind+0x330/0x480 drivers/net/usb/asix_devices.c:786
    [&lt;ffffffff82baa33f&gt;] usbnet_probe+0x3ff/0xdf0 drivers/net/usb/usbnet.c:1745
    [&lt;ffffffff82c36e17&gt;] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396
    [&lt;ffffffff82661d17&gt;] call_driver_probe drivers/base/dd.c:517 [inline]
    [&lt;ffffffff82661d17&gt;] really_probe.part.0+0xe7/0x380 drivers/base/dd.c:596
    [&lt;ffffffff826620bc&gt;] really_probe drivers/base/dd.c:558 [inline]
    [&lt;ffffffff826620bc&gt;] __driver_probe_device+0x10c/0x1e0 drivers/base/dd.c:751
    [&lt;ffffffff826621ba&gt;] driver_probe_device+0x2a/0x120 drivers/base/dd.c:781
    [&lt;ffffffff82662a26&gt;] __device_attach_driver+0xf6/0x140 drivers/base/dd.c:898
    [&lt;ffffffff8265eca7&gt;] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:427
    [&lt;ffffffff826625a2&gt;] __device_attach+0x122/0x260 drivers/base/dd.c:969
    [&lt;ffffffff82660916&gt;] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:487
    [&lt;ffffffff8265cd0b&gt;] device_add+0x5fb/0xdf0 drivers/base/core.c:3359
    [&lt;ffffffff82c343b9&gt;] usb_set_configuration+0x9d9/0xb90 drivers/usb/core/message.c:2170
    [&lt;ffffffff82c4473c&gt;] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238

BUG: memory leak
unreferenced object 0xffff888116f06900 (size 32):
  comm "kworker/0:2", pid 2670, jiffies 4294944448 (age 7.160s)
  hex dump (first 32 bytes):
    75 73 62 2d 30 30 31 3a 30 30 33 00 00 00 00 00  usb-001:003.....
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff81484516&gt;] kstrdup+0x36/0x70 mm/util.c:60
    [&lt;ffffffff814845a3&gt;] kstrdup_const+0x53/0x80 mm/util.c:83
    [&lt;ffffffff82296ba2&gt;] kvasprintf_const+0xc2/0x110 lib/kasprintf.c:48
    [&lt;ffffffff82358d4b&gt;] kobject_set_name_vargs+0x3b/0xe0 lib/kobject.c:289
    [&lt;ffffffff826575f3&gt;] dev_set_name+0x63/0x90 drivers/base/core.c:3147
    [&lt;ffffffff828dd63b&gt;] __mdiobus_register+0xbb/0x450 drivers/net/phy/mdio_bus.c:535
    [&lt;ffffffff828cb835&gt;] __devm_mdiobus_register+0x75/0xf0 drivers/net/phy/mdio_devres.c:87
    [&lt;ffffffff82b92a00&gt;] ax88772_init_mdio drivers/net/usb/asix_devices.c:676 [inline]
    [&lt;ffffffff82b92a00&gt;] ax88772_bind+0x330/0x480 drivers/net/usb/asix_devices.c:786
    [&lt;ffffffff82baa33f&gt;] usbnet_probe+0x3ff/0xdf0 drivers/net/usb/usbnet.c:1745
    [&lt;ffffffff82c36e17&gt;] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396
    [&lt;ffffffff82661d17&gt;] call_driver_probe drivers/base/dd.c:517 [inline]
    [&lt;ffffffff82661d17&gt;] really_probe.part.0+0xe7/0x380 drivers/base/dd.c:596
    [&lt;ffffffff826620bc&gt;] really_probe drivers/base/dd.c:558 [inline]
    [&lt;ffffffff826620bc&gt;] __driver_probe_device+0x10c/0x1e0 drivers/base/dd.c:751
    [&lt;ffffffff826621ba&gt;] driver_probe_device+0x2a/0x120 drivers/base/dd.c:781
    [&lt;ffffffff82662a26&gt;] __device_attach_driver+0xf6/0x140 drivers/base/dd.c:898
    [&lt;ffffffff8265eca7&gt;] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:427
    [&lt;ffffffff826625a2&gt;] __device_attach+0x122/0x260 drivers/base/dd.c:969

Reported-by: syzbot+398e7dc692ddbbb4cfec@syzkaller.appspotmail.com
Signed-off-by: Yanfei Xu &lt;yanfei.xu@windriver.com&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>net: phy: bcm7xxx: Fixed indirect MMD operations</title>
<updated>2021-10-17T08:42:33Z</updated>
<author>
<name>Florian Fainelli</name>
<email>f.fainelli@gmail.com</email>
</author>
<published>2021-09-28T20:32:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=de4a28b718bb9f8574d50d3882d7bf861d13d3c2'/>
<id>urn:sha1:de4a28b718bb9f8574d50d3882d7bf861d13d3c2</id>
<content type='text'>
commit d88fd1b546ff19c8040cfaea76bf16aed1c5a0bb upstream.

When EEE support was added to the 28nm EPHY it was assumed that it would
be able to support the standard clause 45 over clause 22 register access
method. It turns out that the PHY does not support that, which is the
very reason for using the indirect shadow mode 2 bank 3 access method.

Implement {read,write}_mmd to allow the standard PHY library routines
pertaining to EEE querying and configuration to work correctly on these
PHYs. This forces us to implement a __phy_set_clr_bits() function that
does not grab the MDIO bus lock since the PHY driver's {read,write}_mmd
functions are always called with that lock held.

Fixes: 83ee102a6998 ("net: phy: bcm7xxx: add support for 28nm EPHY")
Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>net: sfp: Fix typo in state machine debug string</title>
<updated>2021-10-13T08:08:19Z</updated>
<author>
<name>Sean Anderson</name>
<email>sean.anderson@seco.com</email>
</author>
<published>2021-10-04T21:50:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=fd73c2e64b435fd43f87e6a7a899f925f637a541'/>
<id>urn:sha1:fd73c2e64b435fd43f87e6a7a899f925f637a541</id>
<content type='text'>
[ Upstream commit 25a9da6641f1f66006e93ddbefee13a437efa8c0 ]

The string should be "tx_disable" to match the state enum.

Fixes: 4005a7cb4f55 ("net: phy: sftp: print debug message with text, not numbers")
Signed-off-by: Sean Anderson &lt;sean.anderson@seco.com&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
