summaryrefslogtreecommitdiff
path: root/drivers/firmware/stratix10-svc.c
diff options
context:
space:
mode:
authorRichard Gong <richard.gong@intel.com>2019-11-04 19:24:36 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-14 08:11:32 +0300
commite9cb0497b1c801a66f9abc907b2c55241099e6ac (patch)
tree659026ef1d9113ee2b3fee119fcedc4303951888 /drivers/firmware/stratix10-svc.c
parentc0e5f4e73a7148e18b763067d181661987cb4c09 (diff)
downloadlinux-e9cb0497b1c801a66f9abc907b2c55241099e6ac.tar.xz
firmware: Fix incompatible function behavior for RSU driver
The older versions of remote system update (RSU) firmware don't support retry and notify features then the kernel module dies when it queries the RSU retry counter or performs notify operation. Update the Intel service layer and RSU drivers to be compatible with all versions of RSU firmware. Reported-by: Radu Barcau <radu.bacrau@intel.com> Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Richard Gong <richard.gong@intel.com> Link: https://lore.kernel.org/r/1572884676-1385-1-git-send-email-richard.gong@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/firmware/stratix10-svc.c')
-rw-r--r--drivers/firmware/stratix10-svc.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c
index b485321189e1..c6c31402848d 100644
--- a/drivers/firmware/stratix10-svc.c
+++ b/drivers/firmware/stratix10-svc.c
@@ -493,8 +493,24 @@ static int svc_normal_to_secure_thread(void *data)
pdata->chan->scl->receive_cb(pdata->chan->scl, cbdata);
break;
default:
- pr_warn("it shouldn't happen\n");
+ pr_warn("Secure firmware doesn't support...\n");
+
+ /*
+ * be compatible with older version firmware which
+ * doesn't support RSU notify or retry
+ */
+ if ((pdata->command == COMMAND_RSU_RETRY) ||
+ (pdata->command == COMMAND_RSU_NOTIFY)) {
+ cbdata->status =
+ BIT(SVC_STATUS_RSU_NO_SUPPORT);
+ cbdata->kaddr1 = NULL;
+ cbdata->kaddr2 = NULL;
+ cbdata->kaddr3 = NULL;
+ pdata->chan->scl->receive_cb(
+ pdata->chan->scl, cbdata);
+ }
break;
+
}
};