]> git.baikalelectronics.ru Git - kernel.git/commit
net: mvneta: The mvneta_percpu_elect function should be atomic
authorGregory CLEMENT <gregory.clement@free-electrons.com>
Thu, 4 Feb 2016 21:09:28 +0000 (22:09 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 13 Feb 2016 11:02:19 +0000 (06:02 -0500)
commitefbf6d3c24f574cab597d3348ec0e114bdf1b290
treed0e41c4db63efdd5abb6fa5888c60d11aac1abbb
parentc1d8a03d1fb986f7d96bf3b4b9d65e63b55ecfbf
net: mvneta: The mvneta_percpu_elect function should be atomic

Electing a CPU must be done in an atomic way: it should be done after or
before the removal/insertion of a CPU and this function is not reentrant.

During the loop of mvneta_percpu_elect we associates the queues to the
CPUs, if there is a topology change during this loop, then the mapping
between the CPUs and the queues could be wrong. During this loop the
interrupt mask is also updating for each CPUs, It should not be changed
in the same time by other part of the driver.

This patch adds spinlock to create the needed critical sections.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvneta.c