Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1215466
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 4/4] remoteproc: debugfs: Add ability to boot remote processor using debugfs |
| Date | 2015-08-28 19:30 +0200 |
| Message-ID | <q2vDs-1sU-15@gated-at.bofh.it> (permalink) |
| References | <q2peG-EC-5@gated-at.bofh.it> <q2peH-EC-23@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 28/08/15 03:31, Lee Jones wrote:
> This functionality is especially useful during the testing phase. When
> used in conjunction with Mailbox's Test Framework we can trivially conduct
> end-to-end testing i.e. boot co-processor, send and receive messages to
> the co-processor, then shut it down again (repeat as required).
This does not strike me as a particularly well defined nor suitable
interface for controlling a remote processor's state. I know you are
just extending the existing debugfs interface here, but someone ought to
remove that piece of code and make it a proper character device or
netlink or whatever that allows someone to get proper signaling of
what's going on with the remote processor state by polling or listening
to a socket.
What's the intended use case behind debugfs for this after all? Is your
application expected to keep reading the state file in a loop until it
is happy and reads "running", how is that not racy by nature?
>
> Signed-off-by: Ludovic Barre <ludovic.barre@st.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
> drivers/remoteproc/remoteproc_debugfs.c | 29 +++++++++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
> diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c
> index 9d30809..464470d 100644
> --- a/drivers/remoteproc/remoteproc_debugfs.c
> +++ b/drivers/remoteproc/remoteproc_debugfs.c
> @@ -88,8 +88,37 @@ static ssize_t rproc_state_read(struct file *filp, char __user *userbuf,
> return simple_read_from_buffer(userbuf, count, ppos, buf, i);
> }
>
> +static ssize_t rproc_state_write(struct file *filp, const char __user *userbuf,
> + size_t count, loff_t *ppos)
> +{
> + struct rproc *rproc = filp->private_data;
> + char buf[2];
> + int ret;
> +
> + ret = copy_from_user(buf, userbuf, 1);
> + if (ret)
> + return -EFAULT;
> +
> + switch (buf[0]) {
> + case '0':
> + rproc_shutdown(rproc);
> + break;
> + case '1':
> + ret = rproc_boot(rproc);
> + if (ret)
> + dev_warn(&rproc->dev, "Boot failed: %d\n", ret);
> + break;
> + default:
> + dev_err(&rproc->dev, "Unrecognised option: %x\n", buf[1]);
> + return -EINVAL;
> + }
> +
> + return count;
> +}
> +
> static const struct file_operations rproc_state_ops = {
> .read = rproc_state_read,
> + .write = rproc_state_write,
> .open = simple_open,
> .llseek = generic_file_llseek,
> };
>
--
Florian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 0/4] remoteproc: Add driver for STMicroelectronics platforms Lee Jones <lee.jones@linaro.org> - 2015-08-28 12:40 +0200
[PATCH v2 2/4] remoteproc: dt: Provide bindings for ST's Remote Processor Controller driver Lee Jones <lee.jones@linaro.org> - 2015-08-28 12:40 +0200
Re: [PATCH v2 2/4] remoteproc: dt: Provide bindings for ST's Remote Processor Controller driver Rob Herring <robherring2@gmail.com> - 2015-08-31 17:30 +0200
Re: [PATCH v2 2/4] remoteproc: dt: Provide bindings for ST's Remote Processor Controller driver Lee Jones <lee.jones@linaro.org> - 2015-09-01 12:50 +0200
Re: [PATCH v2 2/4] remoteproc: dt: Provide bindings for ST's Remote Processor Controller driver Rob Herring <robherring2@gmail.com> - 2015-09-01 14:00 +0200
Re: [STLinux Kernel] [PATCH v2 2/4] remoteproc: dt: Provide bindings for ST's Remote Processor Controller driver Peter Griffin <peter.griffin@linaro.org> - 2015-09-01 11:00 +0200
Re: [STLinux Kernel] [PATCH v2 2/4] remoteproc: dt: Provide bindings for ST's Remote Processor Controller driver Lee Jones <lee.jones@linaro.org> - 2015-09-01 11:20 +0200
Re: [STLinux Kernel] [PATCH v2 2/4] remoteproc: dt: Provide bindings for ST's Remote Processor Controller driver Lee Jones <lee.jones@linaro.org> - 2015-09-01 15:00 +0200
[PATCH v2 3/4] remoteproc: Supply controller driver for ST's Remote Processors Lee Jones <lee.jones@linaro.org> - 2015-08-28 12:40 +0200
Re: [PATCH v2 3/4] remoteproc: Supply controller driver for ST's Remote Processors Nathan Lynch <Nathan_Lynch@mentor.com> - 2015-08-28 18:30 +0200
Re: [PATCH v2 3/4] remoteproc: Supply controller driver for ST's Remote Processors Lee Jones <lee.jones@linaro.org> - 2015-09-01 10:00 +0200
Re: [STLinux Kernel] [PATCH v2 3/4] remoteproc: Supply controller driver for ST's Remote Processors Peter Griffin <peter.griffin@linaro.org> - 2015-09-01 10:20 +0200
Re: [STLinux Kernel] [PATCH v2 3/4] remoteproc: Supply controller driver for ST's Remote Processors Lee Jones <lee.jones@linaro.org> - 2015-09-01 11:20 +0200
[PATCH v2 4/4] remoteproc: debugfs: Add ability to boot remote processor using debugfs Lee Jones <lee.jones@linaro.org> - 2015-08-28 12:40 +0200
Re: [PATCH v2 4/4] remoteproc: debugfs: Add ability to boot remote processor using debugfs Nathan Lynch <Nathan_Lynch@mentor.com> - 2015-08-28 17:30 +0200
Re: [PATCH v2 4/4] remoteproc: debugfs: Add ability to boot remote processor using debugfs Lee Jones <lee.jones@linaro.org> - 2015-09-01 09:50 +0200
Re: [PATCH v2 4/4] remoteproc: debugfs: Add ability to boot remote processor using debugfs Florian Fainelli <f.fainelli@gmail.com> - 2015-08-28 19:30 +0200
Re: [PATCH v2 4/4] remoteproc: debugfs: Add ability to boot remote processor using debugfs Lee Jones <lee.jones@linaro.org> - 2015-09-01 09:50 +0200
[PATCH v2 1/4] ARM: STiH407: Add nodes for RemoteProc Lee Jones <lee.jones@linaro.org> - 2015-08-28 12:40 +0200
Re: [STLinux Kernel] [PATCH v2 1/4] ARM: STiH407: Add nodes for RemoteProc Peter Griffin <peter.griffin@linaro.org> - 2015-09-01 10:30 +0200
Re: [STLinux Kernel] [PATCH v2 1/4] ARM: STiH407: Add nodes for RemoteProc Lee Jones <lee.jones@linaro.org> - 2015-09-01 11:20 +0200
Re: [STLinux Kernel] [PATCH v2 1/4] ARM: STiH407: Add nodes for RemoteProc Peter Griffin <peter.griffin@linaro.org> - 2015-09-01 11:20 +0200
csiph-web