Skip to content

Commit 406e0d6

Browse files
committed
HSD#16027607811: misc: fcs: handle SDOS warning
This patch addresses the SDOS warning that occurs for weak keys. Signed-off-by: Sagar Khadgi <sagar.khadgi@intel.com> Reviewed-by: Tanmay Kathpalia <tanmay.kathpalia@intel.com> Reviewed-by: Khadgi Sagar <sagar.khadgi@intel.com> Reviewed-by: Mahesh Rao <mahesh.rao@altera.com> Reviewed-by: Ang Tien Sung <tien.sung.ang@intel.com>
1 parent 723315a commit 406e0d6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

drivers/misc/socfpga-config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ static ssize_t sdos_store(struct device *dev, struct device_attribute *attr,
10551055

10561056
ret = hal_sdos_crypt(k_ctx);
10571057
if (ret)
1058-
pr_err("Failed to get device identity\n");
1058+
pr_err("Failed to perform SDOS operation\n");
10591059

10601060
out:
10611061

drivers/misc/socfpga_fcs_hal.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@
7070
#define HKDF_INPUT_DATA_SIZE 80
7171

7272
#define FCS_MAX_RESP_MS 50
73+
#define SDOS_DECRYPTION_REPROVISION_KEY_WARN 0x102
74+
#define SDOS_DECRYPTION_NOT_LATEST_KEY_WARN 0x103
7375

7476
static struct socfpga_fcs_priv *priv;
7577

@@ -2351,8 +2353,10 @@ FCS_HAL_INT hal_sdos_crypt(struct fcs_cmd_context *const k_ctx)
23512353
FCS_DEV_SDOS_DATA_EXT, ret);
23522354
goto free_dbuf;
23532355
}
2354-
if (priv->status) {
2355-
LOG_ERR("Mailbox error, Failed to perform SDOS operation ret: %d priv->status = %d\n",
2356+
if ((priv->status) &&
2357+
(priv->status != SDOS_DECRYPTION_REPROVISION_KEY_WARN) &&
2358+
(priv->status != SDOS_DECRYPTION_NOT_LATEST_KEY_WARN)) {
2359+
LOG_ERR("Failed to perform SDOS operation ret: %d Mailbox Status = %d\n",
23562360
ret, priv->status);
23572361
ret = -EIO;
23582362
goto copy_mbox_status;

0 commit comments

Comments
 (0)