[linux-yocto] [PATCH 21/25] driver, misc: enhance service layer for u-boot w/o SMC support
Meng.Li at windriver.com
Meng.Li at windriver.com
Tue Apr 3 19:37:44 PDT 2018
From: Richard Gong <richard.gong at intel.com>
commit ecc5919628b706ecc57300c7dbea38e59f2bede1 from
https://github.com/altera-opensource/linux-socfpga.git
Service layer makes a SMC call to u-boot for the shared memory. If SMC is
not supported at u-boot, u-boot will return service layer a invalid value
and cause service layer probe failure. Kernel crashes as a result.
This patch is used to enhance service layer driver. So that if u-boot
doesn't support SMC yet, the service layer driver probe will fail without
crashing the kernel.
FPGA configuration will not work in the case which u-boot doesn't support
SMC.
Signed-off-by: Richard Gong <richard.gong at intel.com>
Signed-off-by: Meng Li <Meng.Li at windriver.com>
---
drivers/misc/intel-service.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/misc/intel-service.c b/drivers/misc/intel-service.c
index 18690b8..c87d9aa 100644
--- a/drivers/misc/intel-service.c
+++ b/drivers/misc/intel-service.c
@@ -194,6 +194,9 @@ struct intel_svc_chan *request_svc_channel_byname(
int i;
chan = ERR_PTR(-EPROBE_DEFER);
+ if (list_empty(&svc_ctrl))
+ return ERR_PTR(-ENODEV);
+
controller = list_first_entry(&svc_ctrl,
struct intel_svc_controller, node);
for (i = 0; i < SVC_NUM_CHANNEL; i++) {
--
1.7.9.5
More information about the linux-yocto
mailing list