aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-09-26 20:53:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-26 20:53:15 -0400
commit64b796e23172850cab313e2e411b58fd391eec95 (patch)
tree1ecb4b86a39d88ea529fa12e7383c2fef6283ef1
parent518a7cb6980cd640c7f979d29021ad870f60d7d7 (diff)
parent50314035d6b1e9e07753162dd3be8df81b998086 (diff)
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
-rw-r--r--drivers/extcon/extcon.c2
-rw-r--r--drivers/hv/channel_mgmt.c17
-rw-r--r--drivers/misc/mei/debugfs.c3
-rw-r--r--drivers/thunderbolt/nhi.c2
4 files changed, 21 insertions, 3 deletions
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index a07addde297b..8dd0af1d50bc 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -159,7 +159,7 @@ static int find_cable_index_by_name(struct extcon_dev *edev, const char *name)
159static bool is_extcon_changed(u32 prev, u32 new, int idx, bool *attached) 159static bool is_extcon_changed(u32 prev, u32 new, int idx, bool *attached)
160{ 160{
161 if (((prev >> idx) & 0x1) != ((new >> idx) & 0x1)) { 161 if (((prev >> idx) & 0x1) != ((new >> idx) & 0x1)) {
162 *attached = new ? true : false; 162 *attached = ((new >> idx) & 0x1) ? true : false;
163 return true; 163 return true;
164 } 164 }
165 165
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 2f9aead4ecfc..652afd11a9ef 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -204,6 +204,8 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid)
204 spin_lock_irqsave(&vmbus_connection.channel_lock, flags); 204 spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
205 list_del(&channel->listentry); 205 list_del(&channel->listentry);
206 spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags); 206 spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
207
208 primary_channel = channel;
207 } else { 209 } else {
208 primary_channel = channel->primary_channel; 210 primary_channel = channel->primary_channel;
209 spin_lock_irqsave(&primary_channel->lock, flags); 211 spin_lock_irqsave(&primary_channel->lock, flags);
@@ -211,6 +213,14 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid)
211 primary_channel->num_sc--; 213 primary_channel->num_sc--;
212 spin_unlock_irqrestore(&primary_channel->lock, flags); 214 spin_unlock_irqrestore(&primary_channel->lock, flags);
213 } 215 }
216
217 /*
218 * We need to free the bit for init_vp_index() to work in the case
219 * of sub-channel, when we reload drivers like hv_netvsc.
220 */
221 cpumask_clear_cpu(channel->target_cpu,
222 &primary_channel->alloced_cpus_in_node);
223
214 free_channel(channel); 224 free_channel(channel);
215} 225}
216 226
@@ -458,6 +468,13 @@ static void init_vp_index(struct vmbus_channel *channel, const uuid_le *type_gui
458 continue; 468 continue;
459 } 469 }
460 470
471 /*
472 * NOTE: in the case of sub-channel, we clear the sub-channel
473 * related bit(s) in primary->alloced_cpus_in_node in
474 * hv_process_channel_removal(), so when we reload drivers
475 * like hv_netvsc in SMP guest, here we're able to re-allocate
476 * bit from primary->alloced_cpus_in_node.
477 */
461 if (!cpumask_test_cpu(cur_cpu, 478 if (!cpumask_test_cpu(cur_cpu,
462 &primary->alloced_cpus_in_node)) { 479 &primary->alloced_cpus_in_node)) {
463 cpumask_set_cpu(cur_cpu, 480 cpumask_set_cpu(cur_cpu,
diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c
index 4b469cf9e60f..8504dbeacd3b 100644
--- a/drivers/misc/mei/debugfs.c
+++ b/drivers/misc/mei/debugfs.c
@@ -204,6 +204,8 @@ int mei_dbgfs_register(struct mei_device *dev, const char *name)
204 if (!dir) 204 if (!dir)
205 return -ENOMEM; 205 return -ENOMEM;
206 206
207 dev->dbgfs_dir = dir;
208
207 f = debugfs_create_file("meclients", S_IRUSR, dir, 209 f = debugfs_create_file("meclients", S_IRUSR, dir,
208 dev, &mei_dbgfs_fops_meclients); 210 dev, &mei_dbgfs_fops_meclients);
209 if (!f) { 211 if (!f) {
@@ -228,7 +230,6 @@ int mei_dbgfs_register(struct mei_device *dev, const char *name)
228 dev_err(dev->dev, "allow_fixed_address: registration failed\n"); 230 dev_err(dev->dev, "allow_fixed_address: registration failed\n");
229 goto err; 231 goto err;
230 } 232 }
231 dev->dbgfs_dir = dir;
232 return 0; 233 return 0;
233err: 234err:
234 mei_dbgfs_deregister(dev); 235 mei_dbgfs_deregister(dev);
diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c
index c68fe1222c16..20a41f7de76f 100644
--- a/drivers/thunderbolt/nhi.c
+++ b/drivers/thunderbolt/nhi.c
@@ -643,7 +643,7 @@ static struct pci_device_id nhi_ids[] = {
643 { 643 {
644 .class = PCI_CLASS_SYSTEM_OTHER << 8, .class_mask = ~0, 644 .class = PCI_CLASS_SYSTEM_OTHER << 8, .class_mask = ~0,
645 .vendor = PCI_VENDOR_ID_INTEL, .device = 0x156c, 645 .vendor = PCI_VENDOR_ID_INTEL, .device = 0x156c,
646 .subvendor = 0x2222, .subdevice = 0x1111, 646 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID,
647 }, 647 },
648 { 0,} 648 { 0,}
649}; 649};