lkml.org 
[lkml]   [2017]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC LINUX PATCH 04/19] remoteproc: sysfs: Add running independent state
Date
From: Wendy Liang <wendy.liang@xilinx.com>

Show running independent state to indicate the remote
runs and it is not started by the remoteproc driver.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
drivers/remoteproc/remoteproc_sysfs.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_sysfs.c b/drivers/remoteproc/remoteproc_sysfs.c
index 47be411..616057d 100644
--- a/drivers/remoteproc/remoteproc_sysfs.c
+++ b/drivers/remoteproc/remoteproc_sysfs.c
@@ -74,6 +74,7 @@ static ssize_t firmware_store(struct device *dev,
[RPROC_RUNNING] = "running",
[RPROC_CRASHED] = "crashed",
[RPROC_DELETED] = "deleted",
+ [RPROC_RUNNING_INDEPENDENT] = "running_independent",
[RPROC_LAST] = "invalid",
};

@@ -97,14 +98,16 @@ static ssize_t state_store(struct device *dev,
int ret = 0;

if (sysfs_streq(buf, "start")) {
- if (rproc->state == RPROC_RUNNING)
+ if (rproc->state == RPROC_RUNNING ||
+ rproc->state == RPROC_RUNNING_INDEPENDENT)
return -EBUSY;

ret = rproc_boot(rproc);
if (ret)
dev_err(&rproc->dev, "Boot failed: %d\n", ret);
} else if (sysfs_streq(buf, "stop")) {
- if (rproc->state != RPROC_RUNNING)
+ if (rproc->state != RPROC_RUNNING &&
+ rproc->state != RPROC_RUNNING_INDEPENDENT)
return -EINVAL;

rproc_shutdown(rproc);
--
1.9.1
\
 
 \ /
  Last update: 2017-03-24 20:33    [W:0.171 / U:0.744 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site