Drivers: hv: vmbus: Optimize vmbus_on_event
[linux-2.6-microblaze.git] / drivers / hv / connection.c
index eca7afd..9dc27e5 100644 (file)
@@ -431,34 +431,29 @@ struct vmbus_channel *relid2channel(u32 relid)
 void vmbus_on_event(unsigned long data)
 {
        struct vmbus_channel *channel = (void *) data;
-       unsigned long time_limit = jiffies + 2;
+       void (*callback_fn)(void *context);
 
        trace_vmbus_on_event(channel);
 
        hv_debug_delay_test(channel, INTERRUPT_DELAY);
-       do {
-               void (*callback_fn)(void *);
 
-               /* A channel once created is persistent even when
-                * there is no driver handling the device. An
-                * unloading driver sets the onchannel_callback to NULL.
-                */
-               callback_fn = READ_ONCE(channel->onchannel_callback);
-               if (unlikely(callback_fn == NULL))
-                       return;
-
-               (*callback_fn)(channel->channel_callback_context);
+       /* A channel once created is persistent even when
+        * there is no driver handling the device. An
+        * unloading driver sets the onchannel_callback to NULL.
+        */
+       callback_fn = READ_ONCE(channel->onchannel_callback);
+       if (unlikely(!callback_fn))
+               return;
 
-               if (channel->callback_mode != HV_CALL_BATCHED)
-                       return;
+       (*callback_fn)(channel->channel_callback_context);
 
-               if (likely(hv_end_read(&channel->inbound) == 0))
-                       return;
+       if (channel->callback_mode != HV_CALL_BATCHED)
+               return;
 
-               hv_begin_read(&channel->inbound);
-       } while (likely(time_before(jiffies, time_limit)));
+       if (likely(hv_end_read(&channel->inbound) == 0))
+               return;
 
-       /* The time limit (2 jiffies) has been reached */
+       hv_begin_read(&channel->inbound);
        tasklet_schedule(&channel->callback_event);
 }