4.19-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bjorn Andersson <[email protected]>

commit 137dc5843faeacabf48fc22a8dc58c4e0b4f0927 upstream.

The scm device must be present in order for the rmtfs driver to
configure memory permissions for the rmtfs memory region, so check that
it is probed before continuing.

Cc: [email protected]
Fixes: fa65f8045137 ("soc: qcom: rmtfs-mem: Add support for assigning memory to 
remote")
Signed-off-by: Bjorn Andersson <[email protected]>
Signed-off-by: Andy Gross <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/soc/qcom/rmtfs_mem.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/soc/qcom/rmtfs_mem.c
+++ b/drivers/soc/qcom/rmtfs_mem.c
@@ -212,6 +212,11 @@ static int qcom_rmtfs_mem_probe(struct p
                dev_err(&pdev->dev, "failed to parse qcom,vmid\n");
                goto remove_cdev;
        } else if (!ret) {
+               if (!qcom_scm_is_available()) {
+                       ret = -EPROBE_DEFER;
+                       goto remove_cdev;
+               }
+
                perms[0].vmid = QCOM_SCM_VMID_HLOS;
                perms[0].perm = QCOM_SCM_PERM_RW;
                perms[1].vmid = vmid;


Reply via email to