]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit1fed20cb768f009c07cd9e5d9e3cc34110180277
tree5125144548d0dd924c45426591900587d4bf4959
parentb6d16d1be49315d48bb5c0526a5b29e3b6b6347e
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: 79f0be443d5b ("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