Re: [PATCH v4] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-18 Thread Arnd Bergmann
On Wednesday 13 April 2011, John Calixto wrote: Gah! OK, so much for the v5 I just sent then. What do you think about the compat_ioctl that I sent in v2? It means having the extra 32-bit compat structure, but at least all the compat overhead is conditional upon CONFIG_COMPAT. If you're not

Re: [PATCH v4] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-18 Thread Arnd Bergmann
On Wednesday 13 April 2011, John Calixto wrote: Since the code is limited to ACMD and cannot do arbitrary commands, it's actually not possible to use this for the passthrough scenario, so you should not mention it in the changelog. I would also still advocate something more

Re: [PATCH v4] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-18 Thread John Calixto
On Mon, 18 Apr 2011, Arnd Bergmann wrote: On Wednesday 13 April 2011, John Calixto wrote: Gah! OK, so much for the v5 I just sent then. What do you think about the compat_ioctl that I sent in v2? It means having the extra 32-bit compat structure, but at least all the compat overhead is

Re: [PATCH v4] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-18 Thread John Calixto
On Mon, 18 Apr 2011, Arnd Bergmann wrote: In v6, it seems you have implemented the full CMD passthrough, if I read it correctly. Is there anything still missing? Hi Arnd, As far as I have tested, the v6 patch does indeed have full CMD passthrough. John -- To unsubscribe from this list: send

Re: [PATCH v4] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-12 Thread Michał Mirosław
2011/4/11 John Calixto john.cali...@modsystems.com: [...] --- /dev/null +++ b/include/linux/mmc/ioctl.h @@ -0,0 +1,32 @@ +#ifndef _MMC_IOCTL_H +#define _MMC_IOCTL_H +struct mmc_ioc_cmd { +       /* implies direction of data.  true = write, false = read */ +       int write_flag; + +      

Re: [PATCH v4] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-12 Thread John Calixto
On Tue, 12 Apr 2011, Michał Mirosław wrote: 2011/4/11 John Calixto john.cali...@modsystems.com: [...] --- /dev/null +++ b/include/linux/mmc/ioctl.h @@ -0,0 +1,32 @@ +#ifndef _MMC_IOCTL_H +#define _MMC_IOCTL_H +struct mmc_ioc_cmd { +       /* implies direction of data.  true =

v5 changelog - mmc: Add ioctl to let userspace apps send ACMDs

2011-04-12 Thread John Calixto
A small fix for a compiler warning. Thanks to Michał Mirosław for suggesting the solution! Patch history below: - v5 - fix 32-bit compiler warning about the 32+64 compat pointer - v4 - replace postsleep udelay() with usleep_range() - add cmd_timeout_ms field for R1B commands - v3

[PATCH v5] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-12 Thread John Calixto
Sending ACMDs from userspace is useful for such things as: - The security application of an SD card (SD Specification, Part 3, Security) - SD passthrough for virtual machines Tested on TI PCIxx12 (SDHCI), Sigma Designs SMP8652 SoC, TI OMAP3621 SoC, TI OMAP3630 SoC, Samsung S5PC110

Re: [PATCH v4] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-12 Thread Arnd Bergmann
On Tuesday 12 April 2011, Michał Mirosław wrote: + unsigned int cmd_timeout_ms; + __u64 data_ptr; /* DAT buffer */ This will be more natural if you have an anonymous union here: union { __u64 data_ptr_ void *data_ptr; }; No, that really does not work. It's important for

Re: [PATCH v4] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-12 Thread John Calixto
On Wed, 13 Apr 2011, Arnd Bergmann wrote: On Tuesday 12 April 2011, Michał Mirosław wrote: + unsigned int cmd_timeout_ms; + __u64 data_ptr; /* DAT buffer */ This will be more natural if you have an anonymous union here: union { __u64 data_ptr_ void *data_ptr; };

Re: [PATCH v4] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-12 Thread Arnd Bergmann
On Monday 11 April 2011, John Calixto wrote: Sending ACMDs from userspace is useful for such things as: - The security application of an SD card (SD Specification, Part 3, Security) - SD passthrough for virtual machines Tested on TI PCIxx12 (SDHCI), Sigma Designs SMP8652

Re: [PATCH v5] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-12 Thread John Calixto
Please ignore v5. The fix for the compiler warning is not appropriate for all endians/archs. John -- To unsubscribe from this list: send the line unsubscribe linux-mmc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v4] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-12 Thread John Calixto
Hi Arnd, On Wed, 13 Apr 2011, Arnd Bergmann wrote: On Monday 11 April 2011, John Calixto wrote: Sending ACMDs from userspace is useful for such things as: - The security application of an SD card (SD Specification, Part 3, Security) - SD passthrough for virtual

Re: [PATCH v3] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-11 Thread Chris Ball
Hi John, On Thu, Apr 07 2011, John Calixto wrote: Sending ACMDs from userspace is useful for such things as: - The security application of an SD card (SD Specification, Part 3, Security) - SD passthrough for virtual machines Tested on TI PCIxx12 (SDHCI), Sigma Designs

mmc: Add ioctl to let userspace apps send ACMDs

2011-04-11 Thread John Calixto
Since this patch has gone through multiple revisions now, I thought I'd list the changes in each revision: - v4 - replace postsleep udelay() with usleep_range() - add cmd_timeout_ms field for R1B commands - v3 - copy data from userspace before claiming host - break out copy from

[PATCH v4] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-11 Thread John Calixto
Sending ACMDs from userspace is useful for such things as: - The security application of an SD card (SD Specification, Part 3, Security) - SD passthrough for virtual machines Tested on TI PCIxx12 (SDHCI), Sigma Designs SMP8652 SoC, TI OMAP3621 SoC, TI OMAP3630 SoC, Samsung S5PC110

Re: [PATCH v3] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-11 Thread John Calixto
On Mon, 11 Apr 2011, Chris Ball wrote: This adds two gcc warnings here (compiling for ARM): CC drivers/mmc/card/block.o drivers/mmc/card/block.c: In function ‘mmc_blk_ioctl_copy_from_user’: drivers/mmc/card/block.c:199:33: warning: cast to pointer from integer of different size

Re: [PATCH v3] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-08 Thread Andrei Warkentin
On Fri, Apr 8, 2011 at 3:22 AM, Andrei Warkentin andr...@motorola.com wrote: + +       /* +        * According to the SD specs, some commands require a delay after +        * issuing the command. +        */ +       if (idata-ic.postsleep_us) +               udelay(idata-ic.postsleep_us);

Re: [PATCH v3] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-08 Thread John Calixto
Hi Andrei, On Fri, 8 Apr 2011, Andrei Warkentin wrote: Hi John, On Thu, Apr 7, 2011 at 8:18 PM, John Calixto john.cali...@modsystems.com wrote: +       /* data.flags must already be set before doing this. */ +       mmc_set_data_timeout(data, card); +       /* Allow overriding the

Re: [PATCH v3] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-08 Thread Andrei Warkentin
Hi John, On Fri, Apr 8, 2011 at 2:20 PM, John Calixto john.cali...@modsystems.com wrote: Hi Andrei, On Fri, 8 Apr 2011, Andrei Warkentin wrote: Hi John, On Thu, Apr 7, 2011 at 8:18 PM, John Calixto john.cali...@modsystems.com wrote: +       /* data.flags must already be set before doing

Re: [PATCH v3] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-08 Thread Chris Ball
Hi, On Fri, Apr 08 2011, Andrei Warkentin wrote: I'm not sure what the etiquette for this list is, but you can a Reviewed-by: Andrei Warkentin andr...@motorola.com ...if that's alright with the maintainers. More than fine; thanks very much for the review, Andrei. - Chris. -- Chris Ball

Re: [PATCH v3] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-08 Thread John Calixto
On Fri, 8 Apr 2011, Andrei Warkentin wrote: I'm not sure what the etiquette for this list is, but you can a Reviewed-by: Andrei Warkentin andr...@motorola.com ...if that's alright with the maintainers. Will do - Thanks for taking the time Andrei! John -- To unsubscribe from this list:

[PATCH v3] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-07 Thread John Calixto
Sending ACMDs from userspace is useful for such things as: - The security application of an SD card (SD Specification, Part 3, Security) - SD passthrough for virtual machines Tested on TI PCIxx12 (SDHCI), Sigma Designs SMP8652 SoC, TI OMAP3621 SoC, TI OMAP3630 SoC, Samsung S5PC110

Re: [PATCH v2 1/2] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-06 Thread Michał Mirosław
2011/4/5 John Calixto john.cali...@modsystems.com: Sending ACMDs from userspace is useful for such things as:    - The security application of an SD card (SD Specification, Part 3,      Security)    - SD passthrough for virtual machines Tested on TI PCIxx12 (SDHCI), Sigma Designs SMP8652

Re: [PATCH v2 1/2] mmc: Add ioctl to let userspace apps send ACMDs

2011-04-06 Thread John Calixto
On Wed, 6 Apr 2011, Michał Mirosław wrote: 2011/4/5 John Calixto john.cali...@modsystems.com: +       /* +        * Only allow ACMDs on the whole block device, not on partitions.   This +        * prevents overspray between sibling partitions. +        */ +       if (bdev !=