linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michał Mirosław" <mirqus@gmail.com>
To: John Calixto <john.calixto@modsystems.com>
Cc: linux-mmc@vger.kernel.org, Chris Ball <cjb@laptop.org>,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v2 1/2] mmc: Add ioctl to let userspace apps send ACMDs
Date: Wed, 6 Apr 2011 20:11:23 +0200	[thread overview]
Message-ID: <BANLkTinOP6G1=ZcC=7Wxr6eO2sowJ_TH0w@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1104061021350.391@peruna>

W dniu 6 kwietnia 2011 19:37 użytkownik John Calixto
<john.calixto@modsystems.com> napisał:
> On Wed, 6 Apr 2011, Michał Mirosław wrote:
>> 2011/4/5 John Calixto <john.calixto@modsystems.com>:
>> > +#ifdef CONFIG_COMPAT
>> > +struct sd_ioc_cmd32 {
>> > +       u32 write_flag;
>> > +       u32 opcode;
>> > +       u32 arg;
>> > +       u32 response[4];
>> > +       u32 flags;
>> > +       u32 blksz;
>> > +       u32 blocks;
>> > +       u32 postsleep_us;
>> > +       u32 force_timeout_ns;
>> > +       compat_uptr_t data_ptr;
>> > +};
>> > +#define SD_IOC_ACMD32 _IOWR(MMC_BLOCK_MAJOR, 0, struct sd_ioc_cmd32)
>> [...]
>>
>> Since your implementing a new ioctl you can make the structure the
>> same for 64 and 32-bit archs and avoid all this compat crap.
> I was also less than pleased with this, but I chose to implement the
> compat crap because it allow a "natural" userspace API for both the
> kernel32+user32 and kernel64+user64 environments.  The ugliness in the
> kernel is just when you have defined CONFIG_COMPAT.  I think 32-bit-only
> is still an important target for this functionality (think set-top media
> players, mobile devices; basically, anything running on ARM) so always
> having to cast your data pointer to 64-bit is not appealing.  I suspect
> it will be very unlikely to see people using this in the kernel64+user32
> environment.

The problem is only with data_ptr field. If you make it the same size
whether it's for 32-bit or 64-bit arch then you don't need all that
compat code for user32 on kernel64 except for pointer translation when
there's 32-bit process calling.

Best Regards,
Michał Mirosław

      reply	other threads:[~2011-04-06 18:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-05 21:57 [PATCH v2 1/2] mmc: Add ioctl to let userspace apps send ACMDs John Calixto
2011-04-06  9:51 ` Michał Mirosław
2011-04-06 17:37   ` John Calixto
2011-04-06 18:11     ` Michał Mirosław [this message]

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='BANLkTinOP6G1=ZcC=7Wxr6eO2sowJ_TH0w@mail.gmail.com' \
    --to=mirqus@gmail.com \
    --cc=arnd@arndb.de \
    --cc=cjb@laptop.org \
    --cc=john.calixto@modsystems.com \
    --cc=linux-mmc@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).