<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/dsa/dsa2.c, branch linux-4.13.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.13.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.13.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-11-18T10:30:37Z</updated>
<entry>
<title>net: dsa: check master device before put</title>
<updated>2017-11-18T10:30:37Z</updated>
<author>
<name>Vivien Didelot</name>
</author>
<published>2017-10-24T20:37:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8ae86594f23b5e42960cf43110fbec9805aa6302'/>
<id>urn:sha1:8ae86594f23b5e42960cf43110fbec9805aa6302</id>
<content type='text'>
[ Upstream commit 3eb8feeb1708c7dbfd2e97df92a2a407c116606e ]

In the case of pdata, the dsa_cpu_parse function calls dev_put() before
making sure it isn't NULL. Fix this.

Fixes: 71e0bbde0d88 ("net: dsa: Add support for platform data")
Signed-off-by: Vivien Didelot &lt;vivien.didelot@savoirfairelinux.com&gt;
Reviewed-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: dsa: Don't dereference dst-&gt;cpu_dp-&gt;netdev</title>
<updated>2017-08-29T04:19:43Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2017-08-29T00:10:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c7848399ec7612c2fa4dc0c2eeb9e0b89d00afef'/>
<id>urn:sha1:c7848399ec7612c2fa4dc0c2eeb9e0b89d00afef</id>
<content type='text'>
If we do not have a master network device attached dst-&gt;cpu_dp will be
NULL and accessing cpu_dp-&gt;netdev will create a trace similar to the one
below. The correct check is on dst-&gt;cpu_dp period.

[    1.004650] DSA: switch 0 0 parsed
[    1.008078] Unable to handle kernel NULL pointer dereference at
virtual address 00000010
[    1.016195] pgd = c0003000
[    1.018918] [00000010] *pgd=80000000004003, *pmd=00000000
[    1.024349] Internal error: Oops: 206 [#1] SMP ARM
[    1.029157] Modules linked in:
[    1.032228] CPU: 0 PID: 1 Comm: swapper/0 Not tainted
4.13.0-rc6-00071-g45b45afab9bd-dirty #7
[    1.040772] Hardware name: Broadcom STB (Flattened Device Tree)
[    1.046704] task: ee08f840 task.stack: ee090000
[    1.051258] PC is at dsa_register_switch+0x5e0/0x9dc
[    1.056234] LR is at dsa_register_switch+0x5d0/0x9dc
[    1.061211] pc : [&lt;c08fb28c&gt;]    lr : [&lt;c08fb27c&gt;]    psr: 60000213
[    1.067491] sp : ee091d88  ip : 00000000  fp : 0000000c
[    1.072728] r10: 00000000  r9 : 00000001  r8 : ee208010
[    1.077965] r7 : ee2b57b0  r6 : ee2b5780  r5 : 00000000  r4 :
ee208e0c
[    1.084506] r3 : 00000000  r2 : 00040d00  r1 : 2d1b2000  r0 :
00000016
[    1.091050] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM
Segment user
[    1.098199] Control: 32c5387d  Table: 00003000  DAC: fffffffd
[    1.103957] Process swapper/0 (pid: 1, stack limit = 0xee090210)

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Fixes: 6d3c8c0dd88a ("net: dsa: Remove master_netdev and use dst-&gt;cpu_dp-&gt;netdev")
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: Initialize ds-&gt;cpu_port_mask earlier</title>
<updated>2017-07-25T00:36:27Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2017-07-24T17:49:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9f9e772da2db279c8d8c9206d271b8009c9093f4'/>
<id>urn:sha1:9f9e772da2db279c8d8c9206d271b8009c9093f4</id>
<content type='text'>
The mt7530 driver has its dsa_switch_ops::get_tag_protocol function
check ds-&gt;cpu_port_mask to issue a warning in case the configured CPU
port is not capable of supporting tags.

After commit 14be36c2c96c ("net: dsa: Initialize all CPU and enabled
ports masks in dsa_ds_parse()") we slightly re-arranged the
initialization such that this was no longer working. Just make sure that
ds-&gt;cpu_port_mask is set prior to the first call to get_tag_protocol,
thus restoring the expected contract. In case of error, the CPU port bit
is cleared.

Fixes: 14be36c2c96c ("net: dsa: Initialize all CPU and enabled ports masks in dsa_ds_parse()")
Reported-by: Sean Wang &lt;sean.wang@mediatek.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: dsa: assign default CPU port to all ports</title>
<updated>2017-06-15T21:23:35Z</updated>
<author>
<name>Vivien Didelot</name>
</author>
<published>2017-06-15T19:06:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e4b7778769c25f773c514dcc99afcf7c74a9b3e4'/>
<id>urn:sha1:e4b7778769c25f773c514dcc99afcf7c74a9b3e4</id>
<content type='text'>
The current code only assigns the default cpu_dp to all user ports of
the switch to which the CPU port belongs. The user ports of the other
switches of the fabric thus don't have a default CPU port.

This patch fixes this by assigning the cpu_dp of all user ports of all
switches of the fabric when the tree is fully parsed.

Fixes: a29342e73911 ("net: dsa: Associate slave network device with CPU port")
Signed-off-by: Vivien Didelot &lt;vivien.didelot@savoirfairelinux.com&gt;
Reviewed-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: Associate slave network device with CPU port</title>
<updated>2017-06-13T20:35:03Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2017-06-13T20:27:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a29342e739115211615acc33616e547b2d3e0663'/>
<id>urn:sha1:a29342e739115211615acc33616e547b2d3e0663</id>
<content type='text'>
In preparation for supporting multiple CPU ports with DSA, have the
dsa_port structure know which CPU it is associated with. This will be
important in order to make sure the correct CPU is used for transmission
of the frames. If not for functional reasons, for performance (e.g: load
balancing) and forwarding decisions.

Reviewed-by: Vivien Didelot &lt;vivien.didelot@savoirfairelinux.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: dsa: Remove master_netdev and use dst-&gt;cpu_dp-&gt;netdev</title>
<updated>2017-06-13T20:35:02Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2017-06-13T20:27:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6d3c8c0dd88a5ffc7e3695997641e4b6d4c11065'/>
<id>urn:sha1:6d3c8c0dd88a5ffc7e3695997641e4b6d4c11065</id>
<content type='text'>
In preparation for supporting multiple CPU ports, remove
dst-&gt;master_netdev and ds-&gt;master_netdev and replace them with only one
instance of the common object we have for a port: struct
dsa_port::netdev. ds-&gt;master_netdev is currently write only and would be
helpful in the case where we have two switches, both with CPU ports, and
also connected within each other, which the multi-CPU port patch series
would address.

While at it, introduce a helper function used in net/dsa/slave.c to
immediately get a reference on the master network device called
dsa_master_netdev().

Reviewed-by: Vivien Didelot &lt;vivien.didelot@savoirfairelinux.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>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2017-06-07T02:20:08Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2017-06-07T02:20:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=216fe8f021e33c36e3b27c49c9f1951f6b037d7f'/>
<id>urn:sha1:216fe8f021e33c36e3b27c49c9f1951f6b037d7f</id>
<content type='text'>
Just some simple overlapping changes in marvell PHY driver
and the DSA core code.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: dsa: Fix stale cpu_switch reference after unbind then bind</title>
<updated>2017-06-05T02:55:17Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2017-06-03T05:05:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b07ac9894644202614ca87c69f3f45e424a82fef'/>
<id>urn:sha1:b07ac9894644202614ca87c69f3f45e424a82fef</id>
<content type='text'>
Commit 9520ed8fb841 ("net: dsa: use cpu_switch instead of ds[0]")
replaced the use of dst-&gt;ds[0] with dst-&gt;cpu_switch since that is
functionally equivalent, however, we can now run into an use after free
scenario after unbinding then rebinding the switch driver.

The use after free happens because we do correctly initialize
dst-&gt;cpu_switch the first time we probe in dsa_cpu_parse(), then we
unbind the driver: dsa_dst_unapply() is called, and we rebind again.
dst-&gt;cpu_switch now points to a freed "ds" structure, and so when we
finally dereference it in dsa_cpu_port_ethtool_setup(), we oops.

To fix this, simply set dst-&gt;cpu_switch to NULL in dsa_dst_unapply()
which guarantees that we always correctly re-assign dst-&gt;cpu_switch in
dsa_cpu_parse().

Fixes: 9520ed8fb841 ("net: dsa: use cpu_switch instead of ds[0]")
Signed-off-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: Initialize all CPU and enabled ports masks in dsa_ds_parse()</title>
<updated>2017-06-05T00:05:15Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2017-06-02T19:31:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=14be36c2c96cd18cfa036f230b57ea78d82a303f'/>
<id>urn:sha1:14be36c2c96cd18cfa036f230b57ea78d82a303f</id>
<content type='text'>
There was no reason for duplicating the code that initializes
ds-&gt;enabled_port_mask in both dsa_parse_ports_dn() and
dsa_parse_ports(), instead move this to dsa_ds_parse() which is early
enough before ops-&gt;setup() has run.

While at it, we can now make dsa_is_cpu_port() check ds-&gt;cpu_port_mask
which is a step towards being multi-CPU port capable.

Signed-off-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: Consistently use dsa_port for dsa_*_port_{apply, unapply}</title>
<updated>2017-06-05T00:05:15Z</updated>
<author>
<name>Florian Fainelli</name>
</author>
<published>2017-06-02T19:31:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e41c1b5030e279c6626d3d052c3ca5ce5e2508df'/>
<id>urn:sha1:e41c1b5030e279c6626d3d052c3ca5ce5e2508df</id>
<content type='text'>
We have all the information we need in dsa_port, so use it instead of
repeating the same arguments over and over again.

Suggested-by: Vivien Didelot &lt;vivien.didelot@savoirfairelinux.com&gt;
Signed-off-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>
</feed>
