History

Merge tag 'char-misc-3.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver fixes from Greg KH: "Here are two hyperv driver fixes, and one i8k driver fix for 3.16" * tag 'char-misc-3.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: i8k: Fix non-SMP operation Drivers: hv: util: Fix a bug in the KVP code Drivers: hv: vmbus: Fix a bug in the channel callback dispatch code

Linus Torvalds committed 12 years ago

Commit 56a50f22 parents 303f8ad 6d827fb4 files · +24 −7Browse files

Unified · Split

4 files
  1. drivers/char/i8k.c +3 −1
  2. drivers/hv/connection.c +6 −2
  3. drivers/hv/hv_kvp.c +14 −3
  4. drivers/hv/hv_util.c +1 −1
drivers/char/i8k.c+3−1
@@ -138,7 +138,9 @@ static int i8k_smm(struct smm_regs *regs) · 137 unmodified lines
138138 if (!alloc_cpumask_var(&old_mask, GFP_KERNEL))
139139 return -ENOMEM;
140140 cpumask_copy(old_mask, &current->cpus_allowed);
141− set_cpus_allowed_ptr(current, cpumask_of(0));
141+ rc = set_cpus_allowed_ptr(current, cpumask_of(0));
142+ if (rc)
143+ goto out;
142144 if (smp_processor_id() != 0) {
143145 rc = -EBUSY;
144146 goto out;
drivers/hv/connection.c+6−2
@@ -339,9 +339,13 @@ static void process_chn_event(u32 relid) · 338 unmodified lines
339339 */
340340
341341 do {
342− hv_begin_read(&channel->inbound);
342+ if (read_state)
343+ hv_begin_read(&channel->inbound);
343344 channel->onchannel_callback(arg);
344− bytes_to_read = hv_end_read(&channel->inbound);
345+ if (read_state)
346+ bytes_to_read = hv_end_read(&channel->inbound);
347+ else
348+ bytes_to_read = 0;
345349 } while (read_state && (bytes_to_read != 0));
346350 } else {
347351 pr_err("no channel callback for relid - %u\n", relid);
drivers/hv/hv_kvp.c+14−3
@@ -127,6 +127,17 @@ kvp_work_func(struct work_struct *dummy) · 126 unmodified lines
127127 kvp_respond_to_host(NULL, HV_E_FAIL);
128128 }
129129
130+static void poll_channel(struct vmbus_channel *channel)
131+{
132+ if (channel->target_cpu != smp_processor_id())
133+ smp_call_function_single(channel->target_cpu,
134+ hv_kvp_onchannelcallback,
135+ channel, true);
136+ else
137+ hv_kvp_onchannelcallback(channel);
138+}
139+
140+
130141 static int kvp_handle_handshake(struct hv_kvp_msg *msg)
131142 {
132143 int ret = 1;
@@ -155,7 +166,7 @@ static int kvp_handle_handshake(struct hv_kvp_msg *msg) · 22 unmodified lines
155166 kvp_register(dm_reg_value);
156167 kvp_transaction.active = false;
157168 if (kvp_transaction.kvp_context)
158− hv_kvp_onchannelcallback(kvp_transaction.kvp_context);
169+ poll_channel(kvp_transaction.kvp_context);
159170 }
160171 return ret;
161172 }
@@ -568,7 +579,7 @@ response_done: · 406 unmodified lines
568579
569580 vmbus_sendpacket(channel, recv_buffer, buf_len, req_id,
570581 VM_PKT_DATA_INBAND, 0);
571−
582+ poll_channel(channel);
572583 }
573584
574585 /*
@@ -603,7 +614,7 @@ void hv_kvp_onchannelcallback(void *context) · 28 unmodified lines
603614 return;
604615 }
605616
606− vmbus_recvpacket(channel, recv_buffer, PAGE_SIZE * 2, &recvlen,
617+ vmbus_recvpacket(channel, recv_buffer, PAGE_SIZE * 4, &recvlen,
607618 &requestid);
608619
609620 if (recvlen > 0) {
drivers/hv/hv_util.c+1−1
@@ -319,7 +319,7 @@ static int util_probe(struct hv_device *dev, · 318 unmodified lines
319319 (struct hv_util_service *)dev_id->driver_data;
320320 int ret;
321321
322− srv->recv_buffer = kmalloc(PAGE_SIZE * 2, GFP_KERNEL);
322+ srv->recv_buffer = kmalloc(PAGE_SIZE * 4, GFP_KERNEL);
323323 if (!srv->recv_buffer)
324324 return -ENOMEM;
325325 if (srv->util_init) {