aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-07 02:15:57 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-07 02:15:57 -0400
commitfb1c592cf4c9eeb84ec6bce13c13c11c7d05b6c7 (patch)
tree5977346539c33f26cda10f60313365e4616931c1 /drivers
parent4ebaf0754c7a1109e66693f488f02b78f5875fee (diff)
parenteafa717bc145963c944bb0a64d16add683861b35 (diff)
Merge tag 'char-misc-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
I wrote: "Char/Misc fixes for 4.19-rc7 Here are 8 small fixes for some char/misc driver issues Included here are: - fpga driver fixes - thunderbolt bugfixes - firmware core revert/fix - hv core fix - hv tool fix All of these have been in linux-next with no reported issues." * tag 'char-misc-4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: thunderbolt: Initialize after IOMMUs thunderbolt: Do not handle ICM events after domain is stopped firmware: Always initialize the fw_priv list object docs: fpga: document fpga manager flags fpga: bridge: fix obvious function documentation error tools: hv: fcopy: set 'error' in case an unknown operation was requested fpga: do not access region struct after fpga_region_unregister Drivers: hv: vmbus: Use get/put_cpu() in vmbus_connect()
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/firmware_loader/main.c7
-rw-r--r--drivers/fpga/dfl-fme-region.c4
-rw-r--r--drivers/fpga/fpga-bridge.c2
-rw-r--r--drivers/fpga/of-fpga-region.c3
-rw-r--r--drivers/hv/connection.c8
-rw-r--r--drivers/thunderbolt/icm.c49
-rw-r--r--drivers/thunderbolt/nhi.c2
7 files changed, 37 insertions, 38 deletions
diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c
index b3c0498ee433..8e9213b36e31 100644
--- a/drivers/base/firmware_loader/main.c
+++ b/drivers/base/firmware_loader/main.c
@@ -226,8 +226,11 @@ static int alloc_lookup_fw_priv(const char *fw_name,
226 } 226 }
227 227
228 tmp = __allocate_fw_priv(fw_name, fwc, dbuf, size); 228 tmp = __allocate_fw_priv(fw_name, fwc, dbuf, size);
229 if (tmp && !(opt_flags & FW_OPT_NOCACHE)) 229 if (tmp) {
230 list_add(&tmp->list, &fwc->head); 230 INIT_LIST_HEAD(&tmp->list);
231 if (!(opt_flags & FW_OPT_NOCACHE))
232 list_add(&tmp->list, &fwc->head);
233 }
231 spin_unlock(&fwc->lock); 234 spin_unlock(&fwc->lock);
232 235
233 *fw_priv = tmp; 236 *fw_priv = tmp;
diff --git a/drivers/fpga/dfl-fme-region.c b/drivers/fpga/dfl-fme-region.c
index 0b7e19c27c6d..51a5ac2293a7 100644
--- a/drivers/fpga/dfl-fme-region.c
+++ b/drivers/fpga/dfl-fme-region.c
@@ -14,6 +14,7 @@
14 */ 14 */
15 15
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/fpga/fpga-mgr.h>
17#include <linux/fpga/fpga-region.h> 18#include <linux/fpga/fpga-region.h>
18 19
19#include "dfl-fme-pr.h" 20#include "dfl-fme-pr.h"
@@ -66,9 +67,10 @@ eprobe_mgr_put:
66static int fme_region_remove(struct platform_device *pdev) 67static int fme_region_remove(struct platform_device *pdev)
67{ 68{
68 struct fpga_region *region = dev_get_drvdata(&pdev->dev); 69 struct fpga_region *region = dev_get_drvdata(&pdev->dev);
70 struct fpga_manager *mgr = region->mgr;
69 71
70 fpga_region_unregister(region); 72 fpga_region_unregister(region);
71 fpga_mgr_put(region->mgr); 73 fpga_mgr_put(mgr);
72 74
73 return 0; 75 return 0;
74} 76}
diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
index 24b8f98b73ec..c983dac97501 100644
--- a/drivers/fpga/fpga-bridge.c
+++ b/drivers/fpga/fpga-bridge.c
@@ -125,7 +125,7 @@ static int fpga_bridge_dev_match(struct device *dev, const void *data)
125 * 125 *
126 * Given a device, get an exclusive reference to a fpga bridge. 126 * Given a device, get an exclusive reference to a fpga bridge.
127 * 127 *
128 * Return: fpga manager struct or IS_ERR() condition containing error code. 128 * Return: fpga bridge struct or IS_ERR() condition containing error code.
129 */ 129 */
130struct fpga_bridge *fpga_bridge_get(struct device *dev, 130struct fpga_bridge *fpga_bridge_get(struct device *dev,
131 struct fpga_image_info *info) 131 struct fpga_image_info *info)
diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c
index 35fabb8083fb..052a1342ab7e 100644
--- a/drivers/fpga/of-fpga-region.c
+++ b/drivers/fpga/of-fpga-region.c
@@ -437,9 +437,10 @@ eprobe_mgr_put:
437static int of_fpga_region_remove(struct platform_device *pdev) 437static int of_fpga_region_remove(struct platform_device *pdev)
438{ 438{
439 struct fpga_region *region = platform_get_drvdata(pdev); 439 struct fpga_region *region = platform_get_drvdata(pdev);
440 struct fpga_manager *mgr = region->mgr;
440 441
441 fpga_region_unregister(region); 442 fpga_region_unregister(region);
442 fpga_mgr_put(region->mgr); 443 fpga_mgr_put(mgr);
443 444
444 return 0; 445 return 0;
445} 446}
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index ced041899456..f4d08c8ac7f8 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -76,6 +76,7 @@ static int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo,
76 __u32 version) 76 __u32 version)
77{ 77{
78 int ret = 0; 78 int ret = 0;
79 unsigned int cur_cpu;
79 struct vmbus_channel_initiate_contact *msg; 80 struct vmbus_channel_initiate_contact *msg;
80 unsigned long flags; 81 unsigned long flags;
81 82
@@ -118,9 +119,10 @@ static int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo,
118 * the CPU attempting to connect may not be CPU 0. 119 * the CPU attempting to connect may not be CPU 0.
119 */ 120 */
120 if (version >= VERSION_WIN8_1) { 121 if (version >= VERSION_WIN8_1) {
121 msg->target_vcpu = 122 cur_cpu = get_cpu();
122 hv_cpu_number_to_vp_number(smp_processor_id()); 123 msg->target_vcpu = hv_cpu_number_to_vp_number(cur_cpu);
123 vmbus_connection.connect_cpu = smp_processor_id(); 124 vmbus_connection.connect_cpu = cur_cpu;
125 put_cpu();
124 } else { 126 } else {
125 msg->target_vcpu = 0; 127 msg->target_vcpu = 0;
126 vmbus_connection.connect_cpu = 0; 128 vmbus_connection.connect_cpu = 0;
diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c
index e1e264a9a4c7..28fc4ce75edb 100644
--- a/drivers/thunderbolt/icm.c
+++ b/drivers/thunderbolt/icm.c
@@ -738,14 +738,6 @@ icm_fr_xdomain_connected(struct tb *tb, const struct icm_pkg_header *hdr)
738 u8 link, depth; 738 u8 link, depth;
739 u64 route; 739 u64 route;
740 740
741 /*
742 * After NVM upgrade adding root switch device fails because we
743 * initiated reset. During that time ICM might still send
744 * XDomain connected message which we ignore here.
745 */
746 if (!tb->root_switch)
747 return;
748
749 link = pkg->link_info & ICM_LINK_INFO_LINK_MASK; 741 link = pkg->link_info & ICM_LINK_INFO_LINK_MASK;
750 depth = (pkg->link_info & ICM_LINK_INFO_DEPTH_MASK) >> 742 depth = (pkg->link_info & ICM_LINK_INFO_DEPTH_MASK) >>
751 ICM_LINK_INFO_DEPTH_SHIFT; 743 ICM_LINK_INFO_DEPTH_SHIFT;
@@ -1037,14 +1029,6 @@ icm_tr_device_connected(struct tb *tb, const struct icm_pkg_header *hdr)
1037 if (pkg->hdr.packet_id) 1029 if (pkg->hdr.packet_id)
1038 return; 1030 return;
1039 1031
1040 /*
1041 * After NVM upgrade adding root switch device fails because we
1042 * initiated reset. During that time ICM might still send device
1043 * connected message which we ignore here.
1044 */
1045 if (!tb->root_switch)
1046 return;
1047
1048 route = get_route(pkg->route_hi, pkg->route_lo); 1032 route = get_route(pkg->route_hi, pkg->route_lo);
1049 authorized = pkg->link_info & ICM_LINK_INFO_APPROVED; 1033 authorized = pkg->link_info & ICM_LINK_INFO_APPROVED;
1050 security_level = (pkg->hdr.flags & ICM_FLAGS_SLEVEL_MASK) >> 1034 security_level = (pkg->hdr.flags & ICM_FLAGS_SLEVEL_MASK) >>
@@ -1408,19 +1392,26 @@ static void icm_handle_notification(struct work_struct *work)
1408 1392
1409 mutex_lock(&tb->lock); 1393 mutex_lock(&tb->lock);
1410 1394
1411 switch (n->pkg->code) { 1395 /*
1412 case ICM_EVENT_DEVICE_CONNECTED: 1396 * When the domain is stopped we flush its workqueue but before
1413 icm->device_connected(tb, n->pkg); 1397 * that the root switch is removed. In that case we should treat
1414 break; 1398 * the queued events as being canceled.
1415 case ICM_EVENT_DEVICE_DISCONNECTED: 1399 */
1416 icm->device_disconnected(tb, n->pkg); 1400 if (tb->root_switch) {
1417 break; 1401 switch (n->pkg->code) {
1418 case ICM_EVENT_XDOMAIN_CONNECTED: 1402 case ICM_EVENT_DEVICE_CONNECTED:
1419 icm->xdomain_connected(tb, n->pkg); 1403 icm->device_connected(tb, n->pkg);
1420 break; 1404 break;
1421 case ICM_EVENT_XDOMAIN_DISCONNECTED: 1405 case ICM_EVENT_DEVICE_DISCONNECTED:
1422 icm->xdomain_disconnected(tb, n->pkg); 1406 icm->device_disconnected(tb, n->pkg);
1423 break; 1407 break;
1408 case ICM_EVENT_XDOMAIN_CONNECTED:
1409 icm->xdomain_connected(tb, n->pkg);
1410 break;
1411 case ICM_EVENT_XDOMAIN_DISCONNECTED:
1412 icm->xdomain_disconnected(tb, n->pkg);
1413 break;
1414 }
1424 } 1415 }
1425 1416
1426 mutex_unlock(&tb->lock); 1417 mutex_unlock(&tb->lock);
diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c
index 88cff05a1808..5cd6bdfa068f 100644
--- a/drivers/thunderbolt/nhi.c
+++ b/drivers/thunderbolt/nhi.c
@@ -1191,5 +1191,5 @@ static void __exit nhi_unload(void)
1191 tb_domain_exit(); 1191 tb_domain_exit();
1192} 1192}
1193 1193
1194fs_initcall(nhi_init); 1194rootfs_initcall(nhi_init);
1195module_exit(nhi_unload); 1195module_exit(nhi_unload);