mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-02 03:52:33 +00:00
char/misc driver fixes for 3.16-rc5
Here are 2 hyperv driver fixes, and one i8k driver fix for 3.16. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlPBnhEACgkQMUfUDdst+ym1YgCeKnkaFN0dxOzQ8rNEukts/drQ twgAni68L9zTp5/g+DWulfom493C6Q8N =EkjQ -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
56a50f20ea
4 changed files with 24 additions and 7 deletions
|
@ -138,7 +138,9 @@ static int i8k_smm(struct smm_regs *regs)
|
||||||
if (!alloc_cpumask_var(&old_mask, GFP_KERNEL))
|
if (!alloc_cpumask_var(&old_mask, GFP_KERNEL))
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
cpumask_copy(old_mask, ¤t->cpus_allowed);
|
cpumask_copy(old_mask, ¤t->cpus_allowed);
|
||||||
set_cpus_allowed_ptr(current, cpumask_of(0));
|
rc = set_cpus_allowed_ptr(current, cpumask_of(0));
|
||||||
|
if (rc)
|
||||||
|
goto out;
|
||||||
if (smp_processor_id() != 0) {
|
if (smp_processor_id() != 0) {
|
||||||
rc = -EBUSY;
|
rc = -EBUSY;
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -339,9 +339,13 @@ static void process_chn_event(u32 relid)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
do {
|
do {
|
||||||
hv_begin_read(&channel->inbound);
|
if (read_state)
|
||||||
|
hv_begin_read(&channel->inbound);
|
||||||
channel->onchannel_callback(arg);
|
channel->onchannel_callback(arg);
|
||||||
bytes_to_read = hv_end_read(&channel->inbound);
|
if (read_state)
|
||||||
|
bytes_to_read = hv_end_read(&channel->inbound);
|
||||||
|
else
|
||||||
|
bytes_to_read = 0;
|
||||||
} while (read_state && (bytes_to_read != 0));
|
} while (read_state && (bytes_to_read != 0));
|
||||||
} else {
|
} else {
|
||||||
pr_err("no channel callback for relid - %u\n", relid);
|
pr_err("no channel callback for relid - %u\n", relid);
|
||||||
|
|
|
@ -127,6 +127,17 @@ kvp_work_func(struct work_struct *dummy)
|
||||||
kvp_respond_to_host(NULL, HV_E_FAIL);
|
kvp_respond_to_host(NULL, HV_E_FAIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void poll_channel(struct vmbus_channel *channel)
|
||||||
|
{
|
||||||
|
if (channel->target_cpu != smp_processor_id())
|
||||||
|
smp_call_function_single(channel->target_cpu,
|
||||||
|
hv_kvp_onchannelcallback,
|
||||||
|
channel, true);
|
||||||
|
else
|
||||||
|
hv_kvp_onchannelcallback(channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int kvp_handle_handshake(struct hv_kvp_msg *msg)
|
static int kvp_handle_handshake(struct hv_kvp_msg *msg)
|
||||||
{
|
{
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
|
@ -155,7 +166,7 @@ static int kvp_handle_handshake(struct hv_kvp_msg *msg)
|
||||||
kvp_register(dm_reg_value);
|
kvp_register(dm_reg_value);
|
||||||
kvp_transaction.active = false;
|
kvp_transaction.active = false;
|
||||||
if (kvp_transaction.kvp_context)
|
if (kvp_transaction.kvp_context)
|
||||||
hv_kvp_onchannelcallback(kvp_transaction.kvp_context);
|
poll_channel(kvp_transaction.kvp_context);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -568,7 +579,7 @@ response_done:
|
||||||
|
|
||||||
vmbus_sendpacket(channel, recv_buffer, buf_len, req_id,
|
vmbus_sendpacket(channel, recv_buffer, buf_len, req_id,
|
||||||
VM_PKT_DATA_INBAND, 0);
|
VM_PKT_DATA_INBAND, 0);
|
||||||
|
poll_channel(channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -603,7 +614,7 @@ void hv_kvp_onchannelcallback(void *context)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
vmbus_recvpacket(channel, recv_buffer, PAGE_SIZE * 2, &recvlen,
|
vmbus_recvpacket(channel, recv_buffer, PAGE_SIZE * 4, &recvlen,
|
||||||
&requestid);
|
&requestid);
|
||||||
|
|
||||||
if (recvlen > 0) {
|
if (recvlen > 0) {
|
||||||
|
|
|
@ -319,7 +319,7 @@ static int util_probe(struct hv_device *dev,
|
||||||
(struct hv_util_service *)dev_id->driver_data;
|
(struct hv_util_service *)dev_id->driver_data;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
srv->recv_buffer = kmalloc(PAGE_SIZE * 2, GFP_KERNEL);
|
srv->recv_buffer = kmalloc(PAGE_SIZE * 4, GFP_KERNEL);
|
||||||
if (!srv->recv_buffer)
|
if (!srv->recv_buffer)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
if (srv->util_init) {
|
if (srv->util_init) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue