<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/net/ethernet/rdc, branch linux-4.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-01-07T11:07:29Z</updated>
<entry>
<title>r6040: Fix kmemleak in probe and remove</title>
<updated>2023-01-07T11:07:29Z</updated>
<author>
<name>Li Zetao</name>
</author>
<published>2022-12-13T12:56:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a04707f4596952049da05756c27398c34d9a1d36'/>
<id>urn:sha1:a04707f4596952049da05756c27398c34d9a1d36</id>
<content type='text'>
[ Upstream commit 7e43039a49c2da45edc1d9d7c9ede4003ab45a5f ]

There is a memory leaks reported by kmemleak:

  unreferenced object 0xffff888116111000 (size 2048):
    comm "modprobe", pid 817, jiffies 4294759745 (age 76.502s)
    hex dump (first 32 bytes):
      00 c4 0a 04 81 88 ff ff 08 10 11 16 81 88 ff ff  ................
      08 10 11 16 81 88 ff ff 00 00 00 00 00 00 00 00  ................
    backtrace:
      [&lt;ffffffff815bcd82&gt;] kmalloc_trace+0x22/0x60
      [&lt;ffffffff827e20ee&gt;] phy_device_create+0x4e/0x90
      [&lt;ffffffff827e6072&gt;] get_phy_device+0xd2/0x220
      [&lt;ffffffff827e7844&gt;] mdiobus_scan+0xa4/0x2e0
      [&lt;ffffffff827e8be2&gt;] __mdiobus_register+0x482/0x8b0
      [&lt;ffffffffa01f5d24&gt;] r6040_init_one+0x714/0xd2c [r6040]
      ...

The problem occurs in probe process as follows:
  r6040_init_one:
    mdiobus_register
      mdiobus_scan    &lt;- alloc and register phy_device,
                         the reference count of phy_device is 3
    r6040_mii_probe
      phy_connect     &lt;- connect to the first phy_device,
                         so the reference count of the first
                         phy_device is 4, others are 3
    register_netdev   &lt;- fault inject succeeded, goto error handling path

    // error handling path
    err_out_mdio_unregister:
      mdiobus_unregister(lp-&gt;mii_bus);
    err_out_mdio:
      mdiobus_free(lp-&gt;mii_bus);    &lt;- the reference count of the first
                                       phy_device is 1, it is not released
                                       and other phy_devices are released
  // similarly, the remove process also has the same problem

The root cause is traced to the phy_device is not disconnected when
removes one r6040 device in r6040_remove_one() or on error handling path
after r6040_mii probed successfully. In r6040_mii_probe(), a net ethernet
device is connected to the first PHY device of mii_bus, in order to
notify the connected driver when the link status changes, which is the
default behavior of the PHY infrastructure to handle everything.
Therefore the phy_device should be disconnected when removes one r6040
device or on error handling path.

Fix it by adding phy_disconnect() when removes one r6040 device or on
error handling path after r6040_mii probed successfully.

Fixes: 3831861b4ad8 ("r6040: implement phylib")
Signed-off-by: Li Zetao &lt;lizetao1@huawei.com&gt;
Reviewed-by: Leon Romanovsky &lt;leonro@nvidia.com&gt;
Link: https://lore.kernel.org/r/20221213125614.927754-1-lizetao1@huawei.com
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>r6040: Restore MDIO clock frequency after MAC reset</title>
<updated>2021-09-22T09:43:09Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2021-09-09T17:33:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=88f3259b6828ad0b911b8cc7de659c1d454baf2b'/>
<id>urn:sha1:88f3259b6828ad0b911b8cc7de659c1d454baf2b</id>
<content type='text'>
commit e3f0cc1a945fcefec0c7c9d9dfd028a51daa1846 upstream.

A number of users have reported that they were not able to get the PHY
to successfully link up, especially after commit c36757eb9dee ("net:
phy: consider AN_RESTART status when reading link status") where we
stopped reading just BMSR, but we also read BMCR to determine the link
status.

Andrius at NetBSD did a wonderful job at debugging the problem
and found out that the MDIO bus clock frequency would be incorrectly set
back to its default value which would prevent the MDIO bus controller
from reading PHY registers properly. Back when we only read BMSR, if we
read all 1s, we could falsely indicate a link status, though in general
there is a cable plugged in, so this went unnoticed. After a second read
of BMCR was added, a wrong read will lead to the inability to determine
a link UP condition which is when it started to be visibly broken, even
if it was long before that.

The fix consists in restoring the value of the MD_CSR register that was
set prior to the MAC reset.

Link: http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=53494
Fixes: 90f750a81a29 ("r6040: consolidate MAC reset to its own function")
Reported-by: Andrius V &lt;vezhlys@gmail.com&gt;
Reported-by: Darek Strugacz &lt;darek.strugacz@op.pl&gt;
Tested-by: Darek Strugacz &lt;darek.strugacz@op.pl&gt;
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: r6040: add in missing white space in error message text</title>
<updated>2016-09-19T02:22:16Z</updated>
<author>
<name>Colin Ian King</name>
</author>
<published>2016-09-16T09:43:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=22da73492541736eff5f6a6634c732e36c52a133'/>
<id>urn:sha1:22da73492541736eff5f6a6634c732e36c52a133</id>
<content type='text'>
A couple of dev_err messages span two lines and the literal
string is missing a white space between words. Add the white
space and join the two lines into one.

Signed-off-by: Colin Ian King &lt;colin.king@canonical.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: r6040: Bump version and date</title>
<updated>2016-07-05T07:10:30Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2016-07-04T21:36:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9da280413a2a7e03b38c880cf3e7e0c16dd7371b'/>
<id>urn:sha1:9da280413a2a7e03b38c880cf3e7e0c16dd7371b</id>
<content type='text'>
Bump version to 0.28 and date to 4th of July 2016.

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: r6040: Update my email</title>
<updated>2016-07-05T07:10:29Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2016-07-04T21:36:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=35566e9687af6cce72eee8466dd7173780fdd671'/>
<id>urn:sha1:35566e9687af6cce72eee8466dd7173780fdd671</id>
<content type='text'>
Update my email address in the driver and MAINTAINERS file.

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: r6040: Utilize napi_complete_done()</title>
<updated>2016-07-05T07:10:29Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2016-07-04T21:36:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0305efff117ddc6671f5eaf4e4fefd7418116224'/>
<id>urn:sha1:0305efff117ddc6671f5eaf4e4fefd7418116224</id>
<content type='text'>
We maintain how much work we did in NAPI context, so provide that with
napi_complete_done().

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: r6040: Utilize __napi_schedule_irqoff</title>
<updated>2016-07-05T07:10:29Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2016-07-04T21:36:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ffb5bce0bfd7f196dcfb3263596202cef7b4b92c'/>
<id>urn:sha1:ffb5bce0bfd7f196dcfb3263596202cef7b4b92c</id>
<content type='text'>
We are already in hard IRQ context, so we can use
__napi_schedule_irqoff() to save a few operations.

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: r6040: Check for skb-&gt;xmit_more</title>
<updated>2016-07-05T07:10:29Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2016-07-04T21:36:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9507ffc2acf04c9b1aa02e346225d268c07d79f0'/>
<id>urn:sha1:9507ffc2acf04c9b1aa02e346225d268c07d79f0</id>
<content type='text'>
Kick the transmission only if this is the last SKB to transmit or the
queue is not already stopped.

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: r6040: Reclaim transmitted buffers in NAPI</title>
<updated>2016-07-05T07:10:29Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2016-07-04T21:36:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=58e6b056b0daa8f0287061cff2989e9d5e9a9b7c'/>
<id>urn:sha1:58e6b056b0daa8f0287061cff2989e9d5e9a9b7c</id>
<content type='text'>
Instead of taking one interrupt per packet transmitted, re-use the same
NAPI context to free transmitted buffers. Since we are no longer in hard
IRQ context replace dev_kfree_skb_irq() by dev_kfree_skb().

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: r6040: Utilize skb_put_padto()</title>
<updated>2016-07-05T07:10:29Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2016-07-04T21:36:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a546e557d9404834159b0599a4383ff4cd3321bf'/>
<id>urn:sha1:a546e557d9404834159b0599a4383ff4cd3321bf</id>
<content type='text'>
Pad the SKB to the minimum length of ETH_ZLEN by using skb_put_padto()
and take this operation out of the critical section since there is no
need to check any HW resources before doing that.

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>
