[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <PU1P153MB01694E53D6A6192A46EA3214BF370@PU1P153MB0169.APCP153.PROD.OUTLOOK.COM>
Date: Thu, 23 Aug 2018 20:30:47 +0000
From: Dexuan Cui <decui@...rosoft.com>
To: "'gregkh@...uxfoundation.org'" <gregkh@...uxfoundation.org>,
KY Srinivasan <kys@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>
CC: "'linux-kernel@...r.kernel.org'" <linux-kernel@...r.kernel.org>,
"'driverdev-devel@...uxdriverproject.org'"
<driverdev-devel@...uxdriverproject.org>,
"'olaf@...fle.de'" <olaf@...fle.de>,
"'apw@...onical.com'" <apw@...onical.com>,
"'jasowang@...hat.com'" <jasowang@...hat.com>,
vkuznets <vkuznets@...hat.com>,
"'marcelo.cerri@...onical.com'" <marcelo.cerri@...onical.com>
Subject: [PATCH] Drivers: hv: vmbus: Use raw_smp_processor_id() in
vmbus_connect()
With CONFIG_DEBUG_PREEMPT=y, I always see this warning:
BUG: using smp_processor_id() in preemptible [00000000]
Fix the false warning by using raw_smp_processor_id().
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
use raw_smp_processor_id() here.
Signed-off-by: Dexuan Cui <decui@...rosoft.com>
Cc: stable@...r.kernel.org
Cc: K. Y. Srinivasan <kys@...rosoft.com>
Cc: Haiyang Zhang <haiyangz@...rosoft.com>
Cc: Stephen Hemminger <sthemmin@...rosoft.com>
---
drivers/hv/connection.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index ced0418..c3b7040 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -119,8 +119,8 @@ static int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo,
*/
if (version >= VERSION_WIN8_1) {
msg->target_vcpu =
- hv_cpu_number_to_vp_number(smp_processor_id());
- vmbus_connection.connect_cpu = smp_processor_id();
+ hv_cpu_number_to_vp_number(raw_smp_processor_id());
+ vmbus_connection.connect_cpu = raw_smp_processor_id();
} else {
msg->target_vcpu = 0;
vmbus_connection.connect_cpu = 0;
--
2.7.4
Powered by blists - more mailing lists