]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Drivers: hv: vmbus: Use get/put_cpu() in vmbus_connect()
authorDexuan Cui <decui@microsoft.com>
Mon, 17 Sep 2018 04:14:54 +0000 (04:14 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Oct 2018 06:56:08 +0000 (08:56 +0200)
commit54949880202494a0f443ad046d1a8d6a72d6835b
treed17ee375ead8a37697cd742d2cf5c2a6b2d463af
parent116337deb270a9cd8838adb55b7b09a95a6a565d
Drivers: hv: vmbus: Use get/put_cpu() in vmbus_connect()

commit 41e270f6898e7502be9fd6920ee0a108ca259d36 upstream.

With CONFIG_DEBUG_PREEMPT=y, I always see this warning:
BUG: using smp_processor_id() in preemptible [00000000]

Fix the false warning by using get/put_cpu().

Here vmbus_connect() sends a message to the host and waits for the
host's response. The host will deliver the response message and an
interrupt on CPU msg->target_vcpu, and later the interrupt handler
will wake up vmbus_connect(). vmbus_connect() doesn't really have
to run on the same cpu as CPU msg->target_vcpu, so it's safe to
call put_cpu() just here.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
Cc: stable@vger.kernel.org
Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/connection.c