<feed xmlns='http://www.w3.org/2005/Atom'>
<title>starfive-tech/u-boot.git/net/dsa-uclass.c, branch master</title>
<subtitle>StarFive Tech U-Boot for VisionFive (JH7110) boards (mirror)</subtitle>
<id>https://git.radix-linux.su/starfive-tech/u-boot.git/atom?h=master</id>
<link rel='self' href='https://git.radix-linux.su/starfive-tech/u-boot.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/u-boot.git/'/>
<updated>2021-09-28T15:50:57+00:00</updated>
<entry>
<title>net: dsa: ensure port names are NULL-terminated after DSA_PORT_NAME_LENGTH truncation</title>
<updated>2021-09-28T15:50:57+00:00</updated>
<author>
<name>Vladimir Oltean</name>
<email>vladimir.oltean@nxp.com</email>
</author>
<published>2021-09-27T11:22:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/u-boot.git/commit/?id=4fdc7e3530eb49dfe0aca79746b1cda30e94c591'/>
<id>urn:sha1:4fdc7e3530eb49dfe0aca79746b1cda30e94c591</id>
<content type='text'>
strncpy() simply bails out when copying a source string whose size
exceeds the destination string size, potentially leaving the destination
string unterminated.

One possible way to address is to pass DSA_PORT_NAME_LENGTH - 1 and a
previously zero-initialized destination string, but this is more
difficult to maintain.

The chosen alternative is to use strlcpy(), which properly limits the
copy len in the (srclen &gt;= size) case to "size - 1", and which is also
more efficient than the strncpy() byte-by-byte implementation by using
memcpy. The destination string returned by strlcpy() is always NULL
terminated.

Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Ramon Fried &lt;rfried.dev@gmail.com&gt;
</content>
</entry>
<entry>
<title>net: dsa: remove unused variables</title>
<updated>2021-09-28T15:50:56+00:00</updated>
<author>
<name>Vladimir Oltean</name>
<email>vladimir.oltean@nxp.com</email>
</author>
<published>2021-09-18T11:49:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/u-boot.git/commit/?id=5ecdf0a5a42ae3b2d04cdf0c2ad6314670839037'/>
<id>urn:sha1:5ecdf0a5a42ae3b2d04cdf0c2ad6314670839037</id>
<content type='text'>
"dev" and "dsa_pdata" are unused inside dsa_port_of_to_pdata.

"dsa_priv" is unused inside dsa_port_probe.

Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Ramon Fried &lt;rfried.dev@gmail.com&gt;
</content>
</entry>
<entry>
<title>net: dsa: pass CPU port fixed PHY to .port_disable</title>
<updated>2021-09-28T15:50:56+00:00</updated>
<author>
<name>Vladimir Oltean</name>
<email>vladimir.oltean@nxp.com</email>
</author>
<published>2021-09-18T11:49:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/u-boot.git/commit/?id=5cc283b781398a02c8a7c919cf4d5dbb5fa8add2'/>
<id>urn:sha1:5cc283b781398a02c8a7c919cf4d5dbb5fa8add2</id>
<content type='text'>
While adding the logic for DSA to register a fixed-link PHY for the CPU
port, I forgot to pass it to the .port_disable method too, just
.port_enable.

Bug had no impact for felix_switch.c, due to the phy argument not being
used, but ksz9477.c does use it =&gt; NULL pointer dereference.

Fixes: fc054d563bfb ("net: Introduce DSA class for Ethernet switches")
Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Ramon Fried &lt;rfried.dev@gmail.com&gt;
</content>
</entry>
<entry>
<title>net: dsa: introduce a .port_probe() method in struct dsa_ops</title>
<updated>2021-09-28T15:50:56+00:00</updated>
<author>
<name>Vladimir Oltean</name>
<email>vladimir.oltean@nxp.com</email>
</author>
<published>2021-08-24T12:00:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/u-boot.git/commit/?id=4b46e8388549bd0e52ec742c7e5ed71e0edc1b9f'/>
<id>urn:sha1:4b46e8388549bd0e52ec742c7e5ed71e0edc1b9f</id>
<content type='text'>
Some drivers might want to execute code for each port at probe time, as
opposed to executing code just-in-time for the port selected for
networking.

To cater to that use case, introduce a .port_probe() callback method
into the DSA switch operations which is called for each available port,
at the end of dsa_port_probe().

Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Ramon Fried &lt;rfried.dev@gmail.com&gt;
Tested-by: Michael Walle &lt;michael@walle.cc&gt;
</content>
</entry>
<entry>
<title>net: dsa: refactor the code to set the port MAC address into a dedicated function</title>
<updated>2021-09-28T15:50:55+00:00</updated>
<author>
<name>Vladimir Oltean</name>
<email>vladimir.oltean@nxp.com</email>
</author>
<published>2021-08-24T12:00:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/u-boot.git/commit/?id=5eee5ab91638c4482dd59ff511feefd3b15a2472'/>
<id>urn:sha1:5eee5ab91638c4482dd59ff511feefd3b15a2472</id>
<content type='text'>
This snippet of code has a bothering "if (...) return 0" in it which
assumes it is the last piece of code running in dsa_port_probe().

This makes it difficult to add further code at the end of dsa_port_probe()
which does not depend on MAC address stuff.

So move the code to a dedicated function which returns void and let the
code flow through.

Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Ramon Fried &lt;rfried.dev@gmail.com&gt;
Tested-by: Michael Walle &lt;michael@walle.cc&gt;
</content>
</entry>
<entry>
<title>net: dsa: use "err" instead of "ret" in dsa_port_probe</title>
<updated>2021-09-28T15:50:55+00:00</updated>
<author>
<name>Vladimir Oltean</name>
<email>vladimir.oltean@nxp.com</email>
</author>
<published>2021-08-24T12:00:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/u-boot.git/commit/?id=f4b712b840dd5fe0b984aadfe466c1886a31e906'/>
<id>urn:sha1:f4b712b840dd5fe0b984aadfe466c1886a31e906</id>
<content type='text'>
DM DSA uses "err" for error code values, so use this consistently.

Signed-off-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Ramon Fried &lt;rfried.dev@gmail.com&gt;
Tested-by: Michael Walle &lt;michael@walle.cc&gt;
</content>
</entry>
<entry>
<title>net: dsa: enable master promisc mode if available and needed</title>
<updated>2021-07-10T16:12:41+00:00</updated>
<author>
<name>Tim Harvey</name>
<email>tharvey@gateworks.com</email>
</author>
<published>2021-06-30T23:50:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/u-boot.git/commit/?id=431f9d72ffa76031808cb2ed9c90d1da3621c8de'/>
<id>urn:sha1:431f9d72ffa76031808cb2ed9c90d1da3621c8de</id>
<content type='text'>
If ports have their own unique MAC addrs and master has a set_promisc
function, call it so that packets will be received for ports.

Signed-off-by: Tim Harvey &lt;tharvey@gateworks.com&gt;
Reviewed-by: Ramon Fried &lt;rfried.dev@gmail.com&gt;
</content>
</entry>
<entry>
<title>net: dsa: remove master santiy check</title>
<updated>2021-03-05T04:55:42+00:00</updated>
<author>
<name>Michael Walle</name>
<email>michael@walle.cc</email>
</author>
<published>2021-02-24T16:40:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/u-boot.git/commit/?id=714555374f2ff889cecbde62938a17e9678a0f09'/>
<id>urn:sha1:714555374f2ff889cecbde62938a17e9678a0f09</id>
<content type='text'>
Because we probe the master ourselves (and fail if there is no master),
it is not possible that we don't have a master device.

There is one catch though: device removal. We don't support that. It
wasn't supported neither before this patch. Because the master device
was only set in .pre_probe(), if a device was removed master_dev was a
dangling pointer and transmitting a frame cause a panic. I don't see a
good solution without having some sort of notify machanism when a
udevice is removed.

Signed-off-by: Michael Walle &lt;michael@walle.cc&gt;
Reviewed-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Tested-by: Michael Walle &lt;michael@walle.cc&gt; [DSA unit tests]
Reviewed-by: Priyanka Jain &lt;priyanka.jain@nxp.com&gt;
</content>
</entry>
<entry>
<title>net: dsa: remove NULL check for priv and platform data</title>
<updated>2021-03-05T04:55:42+00:00</updated>
<author>
<name>Michael Walle</name>
<email>michael@walle.cc</email>
</author>
<published>2021-02-24T16:40:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/u-boot.git/commit/?id=108157c468eed8291c866415b8708eb2a8735dc4'/>
<id>urn:sha1:108157c468eed8291c866415b8708eb2a8735dc4</id>
<content type='text'>
Because the uclass has the "*_auto" properties set, the driver model
will take care of allocating the private structures for us and they
can't be NULL. Drop the checks.

Signed-off-by: Michael Walle &lt;michael@walle.cc&gt;
Reviewed-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Ramon Fried &lt;rfried.dev@gmail.com&gt;
Reviewed-by: Priyanka Jain &lt;priyanka.jain@nxp.com&gt;
</content>
</entry>
<entry>
<title>net: dsa: probe master device</title>
<updated>2021-03-05T04:55:42+00:00</updated>
<author>
<name>Michael Walle</name>
<email>michael@walle.cc</email>
</author>
<published>2021-02-24T16:40:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/u-boot.git/commit/?id=e5d7d119287ed1bc867e77225660c1ac9bb51072'/>
<id>urn:sha1:e5d7d119287ed1bc867e77225660c1ac9bb51072</id>
<content type='text'>
DSA needs to have the master device probed first for MAC inheritance.
Until now, it only works by chance because the only user (LS1028A SoC)
will probe the master device first. The probe order is given by the PCI
device ordering, thus it works because the master device has a "smaller"
BDF then the switch device.

Explicitly probe the master device in dsa_port_probe().

Fixes: fc054d563bfb ("net: Introduce DSA class for Ethernet switches")
Signed-off-by: Michael Walle &lt;michael@walle.cc&gt;
Reviewed-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Reviewed-by: Ramon Fried &lt;rfried.dev@gmail.com&gt;
Reviewed-by: Priyanka Jain &lt;priyanka.jain@nxp.com&gt;
</content>
</entry>
</feed>
