Commit 64b796e2 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull char/misc driver fixes from Greg KH:
 "Here's some tiny char and misc driver fixes that resolve some reported
  errors for 4.3-rc3.

  All of these have been in linux-next with no problems for a while"

* tag 'char-misc-4.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  extcon: Fix attached value returned by is_extcon_changed
  Drivers: hv: vmbus: fix init_vp_index() for reloading hv_netvsc
  mei: fix debugfs files leak on error path
  thunderbolt: Allow loading of module on recent Apple MacBooks with thunderbolt 2 controller
parents 518a7cb6 50314035
...@@ -159,7 +159,7 @@ static int find_cable_index_by_name(struct extcon_dev *edev, const char *name) ...@@ -159,7 +159,7 @@ static int find_cable_index_by_name(struct extcon_dev *edev, const char *name)
static bool is_extcon_changed(u32 prev, u32 new, int idx, bool *attached) static bool is_extcon_changed(u32 prev, u32 new, int idx, bool *attached)
{ {
if (((prev >> idx) & 0x1) != ((new >> idx) & 0x1)) { if (((prev >> idx) & 0x1) != ((new >> idx) & 0x1)) {
*attached = new ? true : false; *attached = ((new >> idx) & 0x1) ? true : false;
return true; return true;
} }
......
...@@ -204,6 +204,8 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid) ...@@ -204,6 +204,8 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid)
spin_lock_irqsave(&vmbus_connection.channel_lock, flags); spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
list_del(&channel->listentry); list_del(&channel->listentry);
spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags); spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
primary_channel = channel;
} else { } else {
primary_channel = channel->primary_channel; primary_channel = channel->primary_channel;
spin_lock_irqsave(&primary_channel->lock, flags); spin_lock_irqsave(&primary_channel->lock, flags);
...@@ -211,6 +213,14 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid) ...@@ -211,6 +213,14 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid)
primary_channel->num_sc--; primary_channel->num_sc--;
spin_unlock_irqrestore(&primary_channel->lock, flags); spin_unlock_irqrestore(&primary_channel->lock, flags);
} }
/*
* We need to free the bit for init_vp_index() to work in the case
* of sub-channel, when we reload drivers like hv_netvsc.
*/
cpumask_clear_cpu(channel->target_cpu,
&primary_channel->alloced_cpus_in_node);
free_channel(channel); free_channel(channel);
} }
...@@ -458,6 +468,13 @@ static void init_vp_index(struct vmbus_channel *channel, const uuid_le *type_gui ...@@ -458,6 +468,13 @@ static void init_vp_index(struct vmbus_channel *channel, const uuid_le *type_gui
continue; continue;
} }
/*
* NOTE: in the case of sub-channel, we clear the sub-channel
* related bit(s) in primary->alloced_cpus_in_node in
* hv_process_channel_removal(), so when we reload drivers
* like hv_netvsc in SMP guest, here we're able to re-allocate
* bit from primary->alloced_cpus_in_node.
*/
if (!cpumask_test_cpu(cur_cpu, if (!cpumask_test_cpu(cur_cpu,
&primary->alloced_cpus_in_node)) { &primary->alloced_cpus_in_node)) {
cpumask_set_cpu(cur_cpu, cpumask_set_cpu(cur_cpu,
......
...@@ -204,6 +204,8 @@ int mei_dbgfs_register(struct mei_device *dev, const char *name) ...@@ -204,6 +204,8 @@ int mei_dbgfs_register(struct mei_device *dev, const char *name)
if (!dir) if (!dir)
return -ENOMEM; return -ENOMEM;
dev->dbgfs_dir = dir;
f = debugfs_create_file("meclients", S_IRUSR, dir, f = debugfs_create_file("meclients", S_IRUSR, dir,
dev, &mei_dbgfs_fops_meclients); dev, &mei_dbgfs_fops_meclients);
if (!f) { if (!f) {
...@@ -228,7 +230,6 @@ int mei_dbgfs_register(struct mei_device *dev, const char *name) ...@@ -228,7 +230,6 @@ int mei_dbgfs_register(struct mei_device *dev, const char *name)
dev_err(dev->dev, "allow_fixed_address: registration failed\n"); dev_err(dev->dev, "allow_fixed_address: registration failed\n");
goto err; goto err;
} }
dev->dbgfs_dir = dir;
return 0; return 0;
err: err:
mei_dbgfs_deregister(dev); mei_dbgfs_deregister(dev);
......
...@@ -643,7 +643,7 @@ static struct pci_device_id nhi_ids[] = { ...@@ -643,7 +643,7 @@ static struct pci_device_id nhi_ids[] = {
{ {
.class = PCI_CLASS_SYSTEM_OTHER << 8, .class_mask = ~0, .class = PCI_CLASS_SYSTEM_OTHER << 8, .class_mask = ~0,
.vendor = PCI_VENDOR_ID_INTEL, .device = 0x156c, .vendor = PCI_VENDOR_ID_INTEL, .device = 0x156c,
.subvendor = 0x2222, .subdevice = 0x1111, .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID,
}, },
{ 0,} { 0,}
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment