aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/driver-api/fpga/fpga-mgr.rst5
-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
-rw-r--r--include/linux/fpga/fpga-mgr.h20
-rw-r--r--tools/hv/hv_fcopy_daemon.c1
10 files changed, 57 insertions, 44 deletions
diff --git a/Documentation/driver-api/fpga/fpga-mgr.rst b/Documentation/driver-api/fpga/fpga-mgr.rst
index 4b3825da48d9..82b6dbbd31cd 100644
--- a/Documentation/driver-api/fpga/fpga-mgr.rst
+++ b/Documentation/driver-api/fpga/fpga-mgr.rst
@@ -184,6 +184,11 @@ API for implementing a new FPGA Manager driver
184API for programming an FPGA 184API for programming an FPGA
185--------------------------- 185---------------------------
186 186
187FPGA Manager flags
188
189.. kernel-doc:: include/linux/fpga/fpga-mgr.h
190 :doc: FPGA Manager flags
191
187.. kernel-doc:: include/linux/fpga/fpga-mgr.h 192.. kernel-doc:: include/linux/fpga/fpga-mgr.h
188 :functions: fpga_image_info 193 :functions: fpga_image_info
189 194
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);
diff --git a/include/linux/fpga/fpga-mgr.h b/include/linux/fpga/fpga-mgr.h
index 8942e61f0028..8ab5df769923 100644
--- a/include/linux/fpga/fpga-mgr.h
+++ b/include/linux/fpga/fpga-mgr.h
@@ -53,12 +53,20 @@ enum fpga_mgr_states {
53 FPGA_MGR_STATE_OPERATING, 53 FPGA_MGR_STATE_OPERATING,
54}; 54};
55 55
56/* 56/**
57 * FPGA Manager flags 57 * DOC: FPGA Manager flags
58 * FPGA_MGR_PARTIAL_RECONFIG: do partial reconfiguration if supported 58 *
59 * FPGA_MGR_EXTERNAL_CONFIG: FPGA has been configured prior to Linux booting 59 * Flags used in the &fpga_image_info->flags field
60 * FPGA_MGR_BITSTREAM_LSB_FIRST: SPI bitstream bit order is LSB first 60 *
61 * FPGA_MGR_COMPRESSED_BITSTREAM: FPGA bitstream is compressed 61 * %FPGA_MGR_PARTIAL_RECONFIG: do partial reconfiguration if supported
62 *
63 * %FPGA_MGR_EXTERNAL_CONFIG: FPGA has been configured prior to Linux booting
64 *
65 * %FPGA_MGR_ENCRYPTED_BITSTREAM: indicates bitstream is encrypted
66 *
67 * %FPGA_MGR_BITSTREAM_LSB_FIRST: SPI bitstream bit order is LSB first
68 *
69 * %FPGA_MGR_COMPRESSED_BITSTREAM: FPGA bitstream is compressed
62 */ 70 */
63#define FPGA_MGR_PARTIAL_RECONFIG BIT(0) 71#define FPGA_MGR_PARTIAL_RECONFIG BIT(0)
64#define FPGA_MGR_EXTERNAL_CONFIG BIT(1) 72#define FPGA_MGR_EXTERNAL_CONFIG BIT(1)
diff --git a/tools/hv/hv_fcopy_daemon.c b/tools/hv/hv_fcopy_daemon.c
index d78aed86af09..8ff8cb1a11f4 100644
--- a/tools/hv/hv_fcopy_daemon.c
+++ b/tools/hv/hv_fcopy_daemon.c
@@ -234,6 +234,7 @@ int main(int argc, char *argv[])
234 break; 234 break;
235 235
236 default: 236 default:
237 error = HV_E_FAIL;
237 syslog(LOG_ERR, "Unknown operation: %d", 238 syslog(LOG_ERR, "Unknown operation: %d",
238 buffer.hdr.operation); 239 buffer.hdr.operation);
239 240