net: mvpp2: use {get, put}_cpu() instead of smp_processor_id()
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 10 Jun 2017 21:18:22 +0000 (23:18 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 10 Jun 2017 22:22:55 +0000 (18:22 -0400)
commita704bb5c052bbd6b77c6530a2e83cef42486e335
tree5125144548d0dd924c45426591900587d4bf4959
parent56b8aae959499508090b2d2db6961ed905f38164
net: mvpp2: use {get, put}_cpu() instead of smp_processor_id()

smp_processor_id() should not be used in migration-enabled contexts. We
originally thought it was OK in the specific situation of this driver,
but it was wrong, and calling smp_processor_id() in a migration-enabled
context prints a big fat warning when CONFIG_DEBUG_PREEMPT=y.

Therefore, this commit replaces the smp_processor_id() in
migration-enabled contexts by the appropriate get_cpu/put_cpu sections.

Reported-by: Marc Zyngier <marc.zyngier@arm.com>
Fixes: a786841df72e ("net: mvpp2: handle register mapping and access for PPv2.2")
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2.c