All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Jonathan Marek <jonathan@marek.ca>
Cc: linux-arm-msm@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] misc: fastrpc: add ioctl for attaching to sensors pd
Date: Mon, 7 Sep 2020 14:33:44 +0200	[thread overview]
Message-ID: <20200907123344.GA2371705@kroah.com> (raw)
In-Reply-To: <20200901003300.11985-1-jonathan@marek.ca>

On Mon, Aug 31, 2020 at 08:32:59PM -0400, Jonathan Marek wrote:
> Initializing sensors requires attaching to pd 2. Add an ioctl for that.
> 
> This corresponds to FASTRPC_INIT_ATTACH_SENSORS in the downstream driver.
> 
> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
> ---
>  drivers/misc/fastrpc.c      | 9 ++++++---
>  include/uapi/misc/fastrpc.h | 5 +++--
>  2 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> index 7939c55daceb..ea5e9ca0d705 100644
> --- a/drivers/misc/fastrpc.c
> +++ b/drivers/misc/fastrpc.c
> @@ -1276,7 +1276,7 @@ static int fastrpc_dmabuf_alloc(struct fastrpc_user *fl, char __user *argp)
>  	return 0;
>  }
>  
> -static int fastrpc_init_attach(struct fastrpc_user *fl)
> +static int fastrpc_init_attach(struct fastrpc_user *fl, int pd)
>  {
>  	struct fastrpc_invoke_args args[1];
>  	int tgid = fl->tgid;
> @@ -1287,7 +1287,7 @@ static int fastrpc_init_attach(struct fastrpc_user *fl)
>  	args[0].fd = -1;
>  	args[0].reserved = 0;
>  	sc = FASTRPC_SCALARS(FASTRPC_RMID_INIT_ATTACH, 1, 0);
> -	fl->pd = 0;
> +	fl->pd = pd;
>  
>  	return fastrpc_internal_invoke(fl, true, FASTRPC_INIT_HANDLE,
>  				       sc, &args[0]);
> @@ -1477,7 +1477,10 @@ static long fastrpc_device_ioctl(struct file *file, unsigned int cmd,
>  		err = fastrpc_invoke(fl, argp);
>  		break;
>  	case FASTRPC_IOCTL_INIT_ATTACH:
> -		err = fastrpc_init_attach(fl);
> +		err = fastrpc_init_attach(fl, 0);
> +		break;
> +	case FASTRPC_IOCTL_INIT_ATTACH_SNS:
> +		err = fastrpc_init_attach(fl, 2);

Shouldn't you have #defines for those magic numbers somewhere?  What
does 0 and 2 mean?

thanks,

greg k-h

  reply	other threads:[~2020-09-07 12:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01  0:32 [PATCH] misc: fastrpc: add ioctl for attaching to sensors pd Jonathan Marek
2020-09-07 12:33 ` Greg Kroah-Hartman [this message]
2020-09-07 13:51   ` Jonathan Marek
2020-09-07 13:58     ` Srinivas Kandagatla
2020-09-07 14:02       ` Jonathan Marek
2020-09-08  8:19         ` Srinivas Kandagatla
2020-09-07 12:36 ` Srinivas Kandagatla
2020-09-07 13:47   ` Jonathan Marek
2020-09-07 14:01     ` Srinivas Kandagatla
2020-09-07 14:05       ` Jonathan Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200907123344.GA2371705@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@arndb.de \
    --cc=jonathan@marek.ca \
    --cc=jorge.ramirez-ortiz@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.