<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/net/dsa/dsa_loop.c, branch linux-4.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-11-10T16:46:51Z</updated>
<entry>
<title>net: dsa: Fix possible memory leaks in dsa_loop_init()</title>
<updated>2022-11-10T16:46:51Z</updated>
<author>
<name>Chen Zhongjin</name>
</author>
<published>2022-10-26T02:03:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d593e1ede655b74c42e4e4fe285ea64aee96fb5c'/>
<id>urn:sha1:d593e1ede655b74c42e4e4fe285ea64aee96fb5c</id>
<content type='text'>
[ Upstream commit 633efc8b3dc96f56f5a57f2a49764853a2fa3f50 ]

kmemleak reported memory leaks in dsa_loop_init():

kmemleak: 12 new suspected memory leaks

unreferenced object 0xffff8880138ce000 (size 2048):
  comm "modprobe", pid 390, jiffies 4295040478 (age 238.976s)
  backtrace:
    [&lt;000000006a94f1d5&gt;] kmalloc_trace+0x26/0x60
    [&lt;00000000a9c44622&gt;] phy_device_create+0x5d/0x970
    [&lt;00000000d0ee2afc&gt;] get_phy_device+0xf3/0x2b0
    [&lt;00000000dca0c71f&gt;] __fixed_phy_register.part.0+0x92/0x4e0
    [&lt;000000008a834798&gt;] fixed_phy_register+0x84/0xb0
    [&lt;0000000055223fcb&gt;] dsa_loop_init+0xa9/0x116 [dsa_loop]
    ...

There are two reasons for memleak in dsa_loop_init().

First, fixed_phy_register() create and register phy_device:

fixed_phy_register()
  get_phy_device()
    phy_device_create() # freed by phy_device_free()
  phy_device_register() # freed by phy_device_remove()

But fixed_phy_unregister() only calls phy_device_remove().
So the memory allocated in phy_device_create() is leaked.

Second, when mdio_driver_register() fail in dsa_loop_init(),
it just returns and there is no cleanup for phydevs.

Fix the problems by catching the error of mdio_driver_register()
in dsa_loop_init(), then calling both fixed_phy_unregister() and
phy_device_free() to release phydevs.
Also add a function for phydevs cleanup to avoid duplacate.

Fixes: 98cd1552ea27 ("net: dsa: Mock-up driver")
Signed-off-by: Chen Zhongjin &lt;chenzhongjin@huawei.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>net: dsa: loop: Add module soft dependency</title>
<updated>2020-05-20T06:18:37Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2020-05-09T23:45:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5cdcb17772892135344dfe1acc4864c8d44ff3d3'/>
<id>urn:sha1:5cdcb17772892135344dfe1acc4864c8d44ff3d3</id>
<content type='text'>
[ Upstream commit 3047211ca11bf77b3ecbce045c0aa544d934b945 ]

There is a soft dependency against dsa_loop_bdinfo.ko which sets up the
MDIO device registration, since there are no symbols referenced by
dsa_loop.ko, there is no automatic loading of dsa_loop_bdinfo.ko which
is needed.

Fixes: 98cd1552ea27 ("net: dsa: Mock-up driver")
Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
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: dsa: dsa_loop: Make dynamic debugging helpful</title>
<updated>2018-05-25T20:46:29Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2018-05-25T03:52:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e52cde71709348c0d67bf0f213b438fa4d6cf9a9'/>
<id>urn:sha1:e52cde71709348c0d67bf0f213b438fa4d6cf9a9</id>
<content type='text'>
Remove redundant debug prints from phy_read/write since we can trace those
calls through trace events. Enhance dynamic debug prints to print arguments
which helps figuring how what is going on at the driver level with higher level
configuration interfaces.

Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: dsa: loop: Hook PHY statistics</title>
<updated>2018-04-27T15:53:03Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2018-04-25T19:12:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=96cbddcd52e76d9052948e408b17bedc8aa1c11a'/>
<id>urn:sha1:96cbddcd52e76d9052948e408b17bedc8aa1c11a</id>
<content type='text'>
We just return the same statistics through ethtool_get_stats() and
ethtool_get_phy_stats() for simplicity since this is just a mock-up driver.

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: dsa: Pass stringset to ethtool operations</title>
<updated>2018-04-27T15:53:03Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2018-04-25T19:12:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=89f09048348936a9a8c5131c8538cc6ed26fd44c'/>
<id>urn:sha1:89f09048348936a9a8c5131c8538cc6ed26fd44c</id>
<content type='text'>
Up until now we largely assumed that we were interested in ETH_SS_STATS
type of strings for all ethtool operations, this is about to change with
the introduction of additional string sets, e.g: ETH_SS_PHY_STATS.
Update all functions to take an appropriate stringset argument and act
on it when it is different than ETH_SS_STATS for now.

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>dsa: Pass the port to get_sset_count()</title>
<updated>2018-03-04T18:34:18Z</updated>
<author>
<name>Andrew Lunn</name>
</author>
<published>2018-03-01T01:02:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=88c060549a4c555d59965801d1e811b71614c2b7'/>
<id>urn:sha1:88c060549a4c555d59965801d1e811b71614c2b7</id>
<content type='text'>
By passing the port, we allow different ports to have different
statistics. This is useful since some ports have SERDES interfaces
with their own statistic counters.

Signed-off-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Tested-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Reviewed-by: Vivien Didelot &lt;vivien.didelot@savoirfairelinux.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: dsa: remove trans argument from vlan ops</title>
<updated>2017-12-03T02:18:55Z</updated>
<author>
<name>Vivien Didelot</name>
</author>
<published>2017-11-30T16:23:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=80e023607982faa6245507c45acf93bb0feb0ded'/>
<id>urn:sha1:80e023607982faa6245507c45acf93bb0feb0ded</id>
<content type='text'>
The DSA switch VLAN ops pass the switchdev_trans structure down to the
drivers, but no one is using them and they aren't supposed to anyway.

Remove the trans argument from VLAN prepare and add operations.

At the same time, fix the following checkpatch warning:

    WARNING: line over 80 characters
    #74: FILE: drivers/net/dsa/dsa_loop.c:177:
    +				      const struct switchdev_obj_port_vlan *vlan)

Signed-off-by: Vivien Didelot &lt;vivien.didelot@savoirfairelinux.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: dsa: Pass a port to get_tag_protocol()</title>
<updated>2017-11-13T01:34:54Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2017-11-10T23:22:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5ed4e3eb021762fee584ce65620bc822131c7aa0'/>
<id>urn:sha1:5ed4e3eb021762fee584ce65620bc822131c7aa0</id>
<content type='text'>
A number of drivers want to check whether the configured CPU port is a
possible configuration for enabling tagging, pass down the CPU port
number so they verify that.

Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Reviewed-by: Vivien Didelot &lt;vivien.didelot@savoirfairelinux.com&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: dsa: dsa_loop: remove .set_addr</title>
<updated>2017-10-15T01:30:06Z</updated>
<author>
<name>Vivien Didelot</name>
</author>
<published>2017-10-13T18:18:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=93004a934bc19ea52b687d74482fd1bdd25e7b87'/>
<id>urn:sha1:93004a934bc19ea52b687d74482fd1bdd25e7b87</id>
<content type='text'>
The .set_addr function does nothing, remove the dsa_loop implementation
before getting rid of it completely in DSA.

Signed-off-by: Vivien Didelot &lt;vivien.didelot@savoirfairelinux.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>2017-09-06T03:03:35Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2017-09-06T03:03:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=18fb0b46d555dc42f52f69428dcd52f133877078'/>
<id>urn:sha1:18fb0b46d555dc42f52f69428dcd52f133877078</id>
<content type='text'>
</content>
</entry>
</feed>
