firmware: fpga: replace the error codes with the standard ones
Subsystems (2)
PATCH 1/1 firmware: fpga: replace the error codes with the standard ones
From: Richard Gong <[email protected]>
The Intel service layer driver has defined error codes for the specific services, which started from FPGA configuration then RSU (Remote Status Update).
Intel service layer driver should define the standard error codes rather than keep adding more error codes for the new services.
The standard error codes will be used by all the clients of Intel service layer driver.
Replace FPGA and RSU specific error codes with Intel service layer’s Common error codes.
All changes need to be in one patch, otherwise it will break bisection.
Richard Gong (1):
firmware: fpga: replace the error codes with the standard ones
drivers/firmware/stratix10-rsu.c | 10 +-- drivers/firmware/stratix10-svc.c | 62 ++++++------------- drivers/fpga/stratix10-soc.c | 25 +++----- include/linux/firmware/intel/stratix10-smc.h | 49 +++++++-------- .../linux/firmware/intel/stratix10-svc-client.h | 71 +++++++++------------- 5 files changed, 84 insertions(+), 133 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/1 firmware: fpga: replace the error codes with the standard ones
From: Richard Gong <[email protected]>
The Intel service layer driver has defined error codes for the specific services, which started from FPGA configuration then RSU (Remote Status Update).
Intel service layer driver should define the standard error codes rather than keep adding more error codes for the new services.
The standard error codes will be used by all the clients of Intel service layer driver.
Replace FPGA and RSU specific error codes with Intel service layer’s Common error codes.
--- drivers/firmware/stratix10-rsu.c | 10 +-- drivers/firmware/stratix10-svc.c | 62 ++++++------------- drivers/fpga/stratix10-soc.c | 25 +++----- include/linux/firmware/intel/stratix10-smc.h | 49 +++++++-------- .../linux/firmware/intel/stratix10-svc-client.h | 71 +++++++++------------- 5 files changed, 84 insertions(+), 133 deletions(-)
drivers/firmware/stratix10-rsu.c +5 -5
@@ -72,7 +72,7 @@ static void rsu_status_callback(struct stratix10_svc_client *client,struct stratix10_rsu_priv *priv = client->priv;struct arm_smccc_res *res = (struct arm_smccc_res *)data->kaddr1; -if (data->status ==BIT (SVC_STATUS_RSU_OK )) { +if (data->status ==BIT (SVC_STATUS_OK )) { priv->status.version =FIELD_GET (RSU_VERSION_MASK , res->a2); priv->status.state =FIELD_GET (RSU_STATE_MASK , res->a2);
@@ -108,9 +108,9 @@ static void rsu_command_callback(struct stratix10_svc_client *client, {struct stratix10_rsu_priv *priv = client->priv; -if (data->status ==BIT (SVC_STATUS_RSU_NO_SUPPORT )) +if (data->status ==BIT (SVC_STATUS_NO_SUPPORT ))dev_warn (client->dev,"Secure FW doesn't support notify\n" ); -else if (data->status ==BIT (SVC_STATUS_RSU_ERROR )) +else if (data->status ==BIT (SVC_STATUS_ERROR ))dev_err (client->dev,"Failure, returned status is %lu\n" ,BIT (data->status));
@@ -133,9 +133,9 @@ static void rsu_retry_callback(struct stratix10_svc_client *client,struct stratix10_rsu_priv *priv = client->priv;unsigned int *counter = (unsigned int *)data->kaddr1; -if (data->status ==BIT (SVC_STATUS_RSU_OK )) +if (data->status ==BIT (SVC_STATUS_OK )) priv->retry_counter = *counter; -else if (data->status ==BIT (SVC_STATUS_RSU_NO_SUPPORT )) +else if (data->status ==BIT (SVC_STATUS_NO_SUPPORT ))dev_warn (client->dev,"Secure FW doesn't support retry\n" );else dev_err(client->dev, "Failed to get retry counter %lu\n",
drivers/firmware/stratix10-svc.c +18 -44
133 lines not on this page · raw message
drivers/fpga/stratix10-soc.c +10 -15
@@ -154,11 +154,11 @@ static void s10_receive_callback(struct stratix10_svc_client *client,* Here we set status bits as we receive them. Elsewhere, we always use * test_and_clear_bit() to check status in priv->status */ -for (i =0 ; i <=SVC_STATUS_RECONFIG_ERROR ; i++) +for (i =0 ; i <=SVC_STATUS_ERROR ; i++)if (status & (1 << i))set_bit (i, &priv->status); -if (status &BIT (SVC_STATUS_RECONFIG_BUFFER_DONE )) { +if (status &BIT (SVC_STATUS_BUFFER_DONE )) {s10_unlock_bufs (priv, data->kaddr1);s10_unlock_bufs (priv, data->kaddr2);s10_unlock_bufs (priv, data->kaddr3);
@@ -209,8 +209,7 @@ static int s10_ops_write_init(struct fpga_manager *mgr, } ret =0 ; -if (!test_and_clear_bit (SVC_STATUS_RECONFIG_REQUEST_OK , - &priv->status)) { +if (!test_and_clear_bit (SVC_STATUS_OK , &priv->status)) { ret = -ETIMEDOUT ; goto init_done; }
@@ -323,17 +322,15 @@ static int s10_ops_write(struct fpga_manager *mgr, const char *buf, &priv->status_return_completion, S10_BUFFER_TIMEOUT); -if (test_and_clear_bit (SVC_STATUS_RECONFIG_BUFFER_DONE , - &priv->status) || -test_and_clear_bit (SVC_STATUS_RECONFIG_BUFFER_SUBMITTED , +if (test_and_clear_bit (SVC_STATUS_BUFFER_DONE , &priv->status) || +test_and_clear_bit (SVC_STATUS_BUFFER_SUBMITTED , &priv->status)) { ret =0 ;continue ; } -if (test_and_clear_bit (SVC_STATUS_RECONFIG_ERROR , - &priv->status)) { -dev_err (dev,"ERROR - giving up - SVC_STATUS_RECONFIG_ERROR\n" ); +if (test_and_clear_bit (SVC_STATUS_ERROR , &priv->status)) { +dev_err (dev,"ERROR - giving up - SVC_STATUS_ERROR\n" ); ret = -EFAULT ;break ; }
@@ -393,13 +390,11 @@ static int s10_ops_write_complete(struct fpga_manager *mgr, timeout = ret; ret =0 ; -if (test_and_clear_bit (SVC_STATUS_RECONFIG_COMPLETED , - &priv->status)) +if (test_and_clear_bit (SVC_STATUS_COMPLETED , &priv->status))break ; -if (test_and_clear_bit (SVC_STATUS_RECONFIG_ERROR , - &priv->status)) { -dev_err (dev,"ERROR - giving up - SVC_STATUS_RECONFIG_ERROR\n" ); +if (test_and_clear_bit (SVC_STATUS_ERROR , &priv->status)) { +dev_err (dev,"ERROR - giving up - SVC_STATUS_ERROR\n" ); ret = -EFAULT ;break ; }
include/linux/firmware/intel/stratix10-smc.h +21 -28
105 lines not on this page · raw message
include/linux/firmware/intel/stratix10-svc-client.h +30 -41
107 lines not on this page · raw message
Signature · 1 line
2.7.4