Merge tag 'v3.10.107' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / hv / hv_util.c
index 1d4cbd8e8261ef3f46f71005315a39f4d6d2c680..5f69c839d72745e1a968299195490c280d073dcd 100644 (file)
@@ -49,6 +49,12 @@ static struct hv_util_service util_kvp = {
        .util_deinit = hv_kvp_deinit,
 };
 
+static struct hv_util_service util_vss = {
+       .util_cb = hv_vss_onchannelcallback,
+       .util_init = hv_vss_init,
+       .util_deinit = hv_vss_deinit,
+};
+
 static void perform_shutdown(struct work_struct *dummy)
 {
        orderly_poweroff(true);
@@ -238,10 +244,14 @@ static void heartbeat_onchannelcallback(void *context)
        struct heartbeat_msg_data *heartbeat_msg;
        u8 *hbeat_txf_buf = util_heartbeat.recv_buffer;
 
-       vmbus_recvpacket(channel, hbeat_txf_buf,
-                        PAGE_SIZE, &recvlen, &requestid);
+       while (1) {
+
+               vmbus_recvpacket(channel, hbeat_txf_buf,
+                                PAGE_SIZE, &recvlen, &requestid);
+
+               if (!recvlen)
+                       break;
 
-       if (recvlen > 0) {
                icmsghdrp = (struct icmsg_hdr *)&hbeat_txf_buf[
                                sizeof(struct vmbuspipe_hdr)];
 
@@ -273,7 +283,7 @@ static int util_probe(struct hv_device *dev,
                (struct hv_util_service *)dev_id->driver_data;
        int ret;
 
-       srv->recv_buffer = kmalloc(PAGE_SIZE * 2, GFP_KERNEL);
+       srv->recv_buffer = kmalloc(PAGE_SIZE * 4, GFP_KERNEL);
        if (!srv->recv_buffer)
                return -ENOMEM;
        if (srv->util_init) {
@@ -339,6 +349,10 @@ static const struct hv_vmbus_device_id id_table[] = {
        { HV_KVP_GUID,
          .driver_data = (unsigned long)&util_kvp
        },
+       /* VSS GUID */
+       { HV_VSS_GUID,
+         .driver_data = (unsigned long)&util_vss
+       },
        { },
 };