Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1660625

[PATCH v2 3/3] remoteproc/keystone: Ensure the DSPs are in reset in probe

From Suman Anna <s-anna@ti.com>
Newsgroups linux.kernel
Subject [PATCH v2 3/3] remoteproc/keystone: Ensure the DSPs are in reset in probe
Date 2017-06-08 02:30 +0200
Message-ID <tPTuN-5p2-13@gated-at.bofh.it> (permalink)
References <tPTuN-5p2-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: "Andrew F. Davis" <afd@ti.com>

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>
---
v2: No code changes

 drivers/remoteproc/keystone_remoteproc.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/remoteproc/keystone_remoteproc.c b/drivers/remoteproc/keystone_remoteproc.c
index 6e09ef76f7c7..5f776bfd674a 100644
--- a/drivers/remoteproc/keystone_remoteproc.c
+++ b/drivers/remoteproc/keystone_remoteproc.c
@@ -456,6 +456,16 @@ static int keystone_rproc_probe(struct platform_device *pdev)
 	if (of_reserved_mem_device_init(dev))
 		dev_warn(dev, "device does not have specific CMA pool\n");
 
+	/* ensure the DSP is in reset before loading firmware */
+	ret = reset_control_status(ksproc->reset);
+	if (ret < 0) {
+		dev_err(dev, "failed to get reset status, status = %d\n", ret);
+		goto release_mem;
+	} else if (ret == 0) {
+		WARN(1, "device is not in reset\n");
+		keystone_rproc_dsp_reset(ksproc);
+	}
+
 	ret = rproc_add(rproc);
 	if (ret) {
 		dev_err(dev, "failed to add register device with remoteproc core, status = %d\n",
-- 
2.12.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/3] Add Keystone2 Remoteproc driver Suman Anna <s-anna@ti.com> - 2017-06-08 02:30 +0200
  [PATCH v2 2/3] remoteproc/keystone: Add a remoteproc driver for Keystone 2 DSPs Suman Anna <s-anna@ti.com> - 2017-06-08 02:30 +0200
    Re: [PATCH v2 2/3] remoteproc/keystone: Add a remoteproc driver for  Keystone 2 DSPs Santosh Shilimkar <santosh.shilimkar@oracle.com> - 2017-06-10 21:40 +0200
  [PATCH v2 1/3] dt-bindings: remoteproc: Add Keystone DSP remoteproc binding Suman Anna <s-anna@ti.com> - 2017-06-08 02:30 +0200
    Re: [PATCH v2 1/3] dt-bindings: remoteproc: Add Keystone DSP  remoteproc binding Rob Herring <robh@kernel.org> - 2017-06-09 16:30 +0200
    Re: [PATCH v2 1/3] dt-bindings: remoteproc: Add Keystone DSP  remoteproc binding Santosh Shilimkar <santosh.shilimkar@oracle.com> - 2017-06-10 21:40 +0200
  [PATCH v2 3/3] remoteproc/keystone: Ensure the DSPs are in reset in probe Suman Anna <s-anna@ti.com> - 2017-06-08 02:30 +0200
    Re: [PATCH v2 3/3] remoteproc/keystone: Ensure the DSPs are in reset  in probe Santosh Shilimkar <santosh.shilimkar@oracle.com> - 2017-06-10 21:40 +0200

csiph-web