Re: [PATCH v3 1/2] remoteproc: Add remoteproc character device interface

From: Bjorn Andersson
Date: Wed Jul 01 2020 - 14:55:52 EST


On Wed 01 Jul 05:13 PDT 2020, Arnaud POULIQUEN wrote:

>
>
> On 7/1/20 12:02 AM, Siddharth Gupta wrote:
> >
> > On 6/30/2020 12:43 AM, Arnaud POULIQUEN wrote:
> >>
> >> On 6/30/20 7:38 AM, Siddharth Gupta wrote:
> >>> On 6/17/2020 1:44 AM, Arnaud POULIQUEN wrote:
> >>>> On 6/16/20 9:56 PM, rishabhb@xxxxxxxxxxxxxx wrote:
> >>>>> On 2020-04-30 01:30, Arnaud POULIQUEN wrote:
[..]
> >>>>>> IOCTLs should probaly be documented.
> >>>>> I have added documentation to
> >>>>> Documentation/userspace-api/ioctl/ioctl-number.rst
> >>>>> Is there another place where I need to add documentation for this?
> >>>> Could you add in this file comments that describe
> >>>> the IOCTL usage and associated parameter?
> >>>>
> >>>> Regards,
> >>>> Arnaud
> >
> > I don't see any for of comments that describe in detail the IOCTL usage,
> > i.e.,
> > input parameters, etc. Could you provide an example so I can follow it?
> >
> > If not, should I instead put them in Documentation/remoteproc.txt?
>
> Bjorn and Mathieu are the right persons to decide on the best place.
>
> Here are 2 exemples of "inline" documented IOCTRLs.
>
> https://elixir.bootlin.com/linux/latest/source/arch/s390/include/uapi/asm/tape390.h#L15
> https://elixir.bootlin.com/linux/latest/source/drivers/net/wan/cosa.h#L63
>
> Could be something like that:
>
> /*
> * The RPROC_SET_SHUTDOWN_ON_RELEASE ioctl allows to enable/disable the
> * automatic remote processors shutdown when the controlling userpsace
> * closes the char device interface.
> *
> * input parameter: integer
> * 0 : disable automatic shutdown
> * other: enable automatic shutdown
> */
> #define RPROC_SET_SHUTDOWN_ON_RELEASE _IOW(RPROC_MAGIC, 1, int)
>
> /*
> * The RPROC_GET_SHUTDOWN_ON_RELEASE ioctl gets information about the
> * automatic remote processors shutdown when the controlling userpsace
> * closes the char device interface.
> *
> * output parameter: integer
> * 0: automatic shutdown disable
> * 1: automatic shutdown enable
> */
> #define RPROC_GET_SHUTDOWN_ON_RELEASE _IOR(RPROC_MAGIC, 2, int)
>

I like this. Thanks for digging up an example Arnaud!

Regards,
Bjorn