Skip to contentSkip to conversation

fpga: add cancel() and get_error() to update ops

PATCH In review [email protected] 2 participants 3 messages May 19, 2021 – May 20, 2021 FPGA manager framework

lore
Share & tools
lore

[email protected]

author reviewer
#0 lore raw

PATCH 2/2 fpga: add cancel() and get_error() to update ops

From: Tom Rix <[email protected]>

A user may want to cancel an update or get
more information on when an update fails.
Add some device ops to do these.

---
 include/linux/fpga/fpga-mgr.h | 4 ++++
 1 file changed, 4 insertions(+)
include/linux/fpga/fpga-mgr.h +4 -0
index ab68280f3b4a4..31d6ebc34d87a 100644
@@ -111,6 +111,8 @@ struct fpga_image_info {
  * @write: write count bytes of configuration data to the FPGA
  * @write_sg: write the scatter list of configuration data to the FPGA
  * @write_complete: set FPGA to operating state after writing is done
+ * @cancel: cancel the update
+ * @get_error: get extended error information
  */
 struct fpga_manager_update_ops {
 	int (*write_init)(struct fpga_manager *mgr,
@@ -120,6 +122,8 @@ struct fpga_manager_update_ops {
 	int (*write_sg)(struct fpga_manager *mgr, struct sg_table *sgt);
 	int (*write_complete)(struct fpga_manager *mgr,
 			      struct fpga_image_info *info);
+	int (*cancel)(struct fpga_manager *mgr);
+	int (*get_error)(struct fpga_manager *mgr, u64 *err);
 };
 
 /**
Signature · 1 line
2.26.3
maintainer
#1 lore raw

Tom,

Quoted 36 lines · On Wed, May 19, 2021 at 01:43:18PM -0700, [email protected] wrote:

From: Tom Rix <[email protected]>

A user may want to cancel an update or get
more information on when an update fails.
Add some device ops to do these.

---
 include/linux/fpga/fpga-mgr.h | 4 ++++
 1 file changed, 4 insertions(+)
include/linux/fpga/fpga-mgr.h +4 -0
index ab68280f3b4a4..31d6ebc34d87a 100644
@@ -111,6 +111,8 @@ struct fpga_image_info {
  * @write: write count bytes of configuration data to the FPGA
  * @write_sg: write the scatter list of configuration data to the FPGA
  * @write_complete: set FPGA to operating state after writing is done
+ * @cancel: cancel the update
+ * @get_error: get extended error information
  */
 struct fpga_manager_update_ops {
 	int (*write_init)(struct fpga_manager *mgr,
@@ -120,6 +122,8 @@ struct fpga_manager_update_ops {
 	int (*write_sg)(struct fpga_manager *mgr, struct sg_table *sgt);
 	int (*write_complete)(struct fpga_manager *mgr,
 			      struct fpga_image_info *info);
+	int (*cancel)(struct fpga_manager *mgr);
+	int (*get_error)(struct fpga_manager *mgr, u64 *err);
 };
 
 /**
Signature · 1 line
2.26.3

There is no user for this, so if we add this, we add it with code calling it.

Thanks

- Moritz

author reviewer
#2 lore raw
Quoted 35 lines · Moritz Fischer

Tom,

Quoted 32 lines · On Wed, May 19, 2021 at 01:43:18PM -0700, [email protected] wrote:

From: Tom Rix <[email protected]>

A user may want to cancel an update or get
more information on when an update fails.
Add some device ops to do these.

---
  include/linux/fpga/fpga-mgr.h | 4 ++++
  1 file changed, 4 insertions(+)
include/linux/fpga/fpga-mgr.h +4 -0
index ab68280f3b4a4..31d6ebc34d87a 100644
@@ -111,6 +111,8 @@ struct fpga_image_info {
   * @write: write count bytes of configuration data to the FPGA
   * @write_sg: write the scatter list of configuration data to the FPGA
   * @write_complete: set FPGA to operating state after writing is done
+ * @cancel: cancel the update
+ * @get_error: get extended error information
   */
  struct fpga_manager_update_ops {
  	int (*write_init)(struct fpga_manager *mgr,
@@ -120,6 +122,8 @@ struct fpga_manager_update_ops {
  	int (*write_sg)(struct fpga_manager *mgr, struct sg_table *sgt);
  	int (*write_complete)(struct fpga_manager *mgr,
  			      struct fpga_image_info *info);
+	int (*cancel)(struct fpga_manager *mgr);
+	int (*get_error)(struct fpga_manager *mgr, u64 *err);
  };
 
Quoted 6 lines
Quoted 4 lines
include/linux/fpga/fpga-mgr.h +0 -0
  /**
Signature · 1 line
2.26.3

There is no user for this, so if we add this, we add it with code calling it.

These additions come for unioning the fpga manager ops with the secure manager ops.

So will be needed if the secure manager goes this this way.

Tom

Quoted 4 lines

Thanks

- Moritz