All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Bernhard Walle <walle@corscience.de>,
	dbrownell@users.sourceforge.net,
	spi-devel-general@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [PATCH] spi: spidev: Add 32 bit compat ioctl()
Date: Wed, 2 Feb 2011 10:37:14 +0100	[thread overview]
Message-ID: <201102021037.14364.arnd@arndb.de> (raw)
In-Reply-To: <20110202043944.GG29148@angua.secretlab.ca>

On Wednesday 02 February 2011, Grant Likely wrote:
> On Tue, Feb 01, 2011 at 10:02:46AM +0100, Bernhard Walle wrote:
> > Add the compat_ioctl for operations on /dev/spi* so that 32 bit
> > userspace applications can access SPI. As far as I can see all data
> > structure are already prepared for that, so no additional conversion has
> > to be done.
> > 
> > My use case is MIPS with N32 userspace ABI and toolchain, and that was
> > also the platform where I tested it successfully (Cavium Octeon).
> > 
> > Signed-off-by: Bernhard Walle <walle@corscience.de>
> 
> Arnd, can you please give your opinion on this one?  I haven't fully
> got my head around the subtleties of 32/64 bit file_operations.

The patch is correct on everything except s390, which does not have SPI.
The only thing that is missing for s390 is a pointer conversion of the ioctl
argument, like:

static long     
compat_spidev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
	return spidev_ioctl(filp, cmd, (unsigned long)compat_ptr(arg));
}

Some years ago, I proposed adding a common

#ifdef CONFIG_COMPAT
long generic_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
	if (!file->unlocked_ioctl)
		return -ENOTTY;
	return filp->f_ops->unlocked_ioctl(filp, cmd, (unsigned long)compat_ptr(arg));
}
#else
#define generic_compat_ioctl NULL
#endif

for this purpose, but it never made it in. Maybe I should try again.

	Arnd

  reply	other threads:[~2011-02-02  9:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-01  9:02 [PATCH] spi: spidev: Add 32 bit compat ioctl() Bernhard Walle
2011-02-02  4:39 ` Grant Likely
2011-02-02  9:37   ` Arnd Bergmann [this message]
2011-02-02 10:56     ` Bernhard Walle
2011-02-02 14:12     ` Grant Likely
  -- strict thread matches above, loose matches on Subject: below --
2011-02-03  8:37 Bernhard Walle
2011-02-03 16:56 ` Grant Likely
2011-02-02 11:31 Bernhard Walle
2011-02-02 12:18 ` Arnd Bergmann
2011-02-02 14:15 ` Grant Likely
2011-02-03  8:38   ` Bernhard Walle
2011-02-02 11:30 Bernhard Walle
2011-02-02 10:57 Bernhard Walle
2011-02-02 11:15 ` Arnd Bergmann
2011-02-02 11:32   ` Bernhard Walle
2011-02-02 10:56 y
2011-02-02 10:56 Unknown, y
2011-02-02 10:56 y
2011-01-11 15:32 Bernhard Walle
2010-12-01 10:51 Bernhard Walle

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=201102021037.14364.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=dbrownell@users.sourceforge.net \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=walle@corscience.de \
    /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.