Commit a81a6216209c2424a5ca50faa6eef9fec68cb839

Authored by Andrew F. Davis
Committed by Suman Anna
1 parent 89f80d0ce1

remoteproc/keystone: ensure the DSPs are in reset in probe

The DSPs are expected to be in reset when the driver probes a device.
If the DSPs are out of reset in probe, the system may crash when the
firmware is being loaded. So, add a check to make sure the DSP resets
are asserted, and if not, throw a eye-catchy warning and assert the
resets specifically.

Signed-off-by: Andrew F. Davis <afd@ti.com>
[s-anna@ti.com: replace warning with a WARN]
Signed-off-by: Suman Anna <s-anna@ti.com>

Showing 1 changed file with 10 additions and 0 deletions Side-by-side Diff

drivers/remoteproc/keystone_remoteproc.c
... ... @@ -907,6 +907,16 @@
907 907 if (rproc_get_alias_id(rproc) < 0)
908 908 dev_warn(&pdev->dev, "device does not have an alias id\n");
909 909  
  910 + /* ensure the DSP is in reset before loading firmware */
  911 + ret = reset_control_status(ksproc->reset);
  912 + if (ret < 0) {
  913 + dev_err(dev, "failed to get reset status, status = %d\n", ret);
  914 + goto release_mem;
  915 + } else if (ret == 0) {
  916 + WARN(1, "device is not in reset\n");
  917 + keystone_rproc_dsp_reset(ksproc);
  918 + }
  919 +
910 920 ret = rproc_add(rproc);
911 921 if (ret) {
912 922 dev_err(dev, "failed to add register device with remoteproc core, status = %d\n",