mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Timur Tabi <timur@freescale.com>, <kumar.gala@freescale.com>,
	<linux-kernel@vger.kernel.org>, <akpm@kernel.org>,
	<linux-console@vger.kernel.org>, <greg@kroah.com>,
	<linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH 7/7] [v2] drivers/misc: introduce Freescale hypervisor management driver
Date: Wed, 1 Jun 2011 17:24:12 -0500	[thread overview]
Message-ID: <20110601172412.761ff799@schlenkerla.am.freescale.net> (raw)
In-Reply-To: <201106012340.14237.arnd@arndb.de>

On Wed, 1 Jun 2011 23:40:14 +0200
Arnd Bergmann <arnd@arndb.de> wrote:

> > +static long ioctl_dtprop(struct fsl_hv_ioctl_prop __user *p, int set)
> > +{
> > +	struct fsl_hv_ioctl_prop param;
> > +	char __user *upath, *upropname;
> > +	void __user *upropval;
> > +	char *path = NULL, *propname = NULL;
> > +	void *propval = NULL;
> > +	int ret = 0;
> > +
> 
> I'm not convinced that an ioctl interface is the right way to work with
> device tree properties. A more natural way would be to export it as
> a file system, or maybe as a flattened device tree blob (the latter option
> would require changing the hypervisor interface, which might not be
> possible).

I wanted to have the hypervisor take an update dtb (we already have special
meta-properties for things like deletion as part of the hv config
mechanism).  But others on the project wanted to keep it simple, and so
get/set property it was. :-/

It's unlikely to change at this point without a real need.

As for a filesystem interface, it's not a good match either.  You can't
iterate over anything to read out the full tree from the hv.  You can't
delete anything.  You can't create empty nodes.  The hv interface was meant
to enable some specific management actions, rather than to provide general
device tree access.  This driver is a thin wrapper around the management
hcalls.

There would still be other ioctls needed for starting/stopping the
partition, etc.

> > +/**
> > + * fsl_hv_ioctl: ioctl main entry point
> > + */
> > +static long fsl_hv_ioctl(struct file *file, unsigned int cmd,
> > +			 unsigned long argaddr)
> > +{
> > +	union fsl_hv_ioctl_param __user *arg =
> > +		(union fsl_hv_ioctl_param __user *)argaddr;
> > +	long ret;
> > +
> 
> For an ioctl, please follow the normal pattern of defining a separate
> structure for each case, no union.

And have fsl_hypervisor.h provide the full set of proper ioctl numbers, with
the specific struct for each ioctl referenced, rather than having the client program do
"ioctl(f, _IOWR(0, cmd, union fsl_hv_ioctl_param), p)".

-Scott


  reply	other threads:[~2011-06-01 22:24 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01 18:35 Timur Tabi
2011-06-01 19:46 ` Alan Cox
2011-06-01 20:24   ` Timur Tabi
2011-06-01 20:34     ` Alan Cox
2011-06-01 20:54   ` Scott Wood
2011-06-01 21:45     ` Alan Cox
2011-06-01 21:40 ` Arnd Bergmann
2011-06-01 22:24   ` Scott Wood [this message]
2011-06-03 15:28     ` Arnd Bergmann
2011-06-03 16:22       ` Scott Wood
2011-06-06 15:53         ` Arnd Bergmann
2011-06-06 18:15           ` Scott Wood
2011-06-06 19:48             ` Arnd Bergmann
2011-06-02 21:28   ` Timur Tabi
2011-06-03 15:24     ` Arnd Bergmann
2011-06-03 15:28       ` Timur Tabi
2011-06-06 15:42         ` Arnd Bergmann
2011-06-06 15:48           ` Timur Tabi
2011-06-06 16:03             ` Arnd Bergmann
2011-06-06 16:09               ` Timur Tabi
2011-06-06 16:24                 ` Arnd Bergmann
2011-06-06 16:27                   ` Timur Tabi
2011-06-06 21:01                   ` Chris Metcalf
2011-06-06 21:23                     ` Konrad Rzeszutek Wilk
2011-06-06 23:04                       ` Chris Metcalf
2011-06-07  7:08                         ` Arnd Bergmann
2011-06-07 16:49                           ` Chris Metcalf
2011-06-07 19:16                             ` Arnd Bergmann
2011-06-07 19:20                               ` Timur Tabi
2011-06-07 19:34                                 ` Arnd Bergmann
2011-06-03 14:44   ` Timur Tabi
2011-06-03 15:17     ` Arnd Bergmann

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=20110601172412.761ff799@schlenkerla.am.freescale.net \
    --to=scottwood@freescale.com \
    --cc=akpm@kernel.org \
    --cc=arnd@arndb.de \
    --cc=greg@kroah.com \
    --cc=kumar.gala@freescale.com \
    --cc=linux-console@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=timur@freescale.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®