Skip to contentSkip to conversation

mmc: document 'Reliable Write' bit in uapi header

PATCH Superseded Wolfram Sang 3 participants 3 messages Dec 3, 2018 MMC, SD and SDIO

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: document 'Reliable Write' bit in uapi header

If we use it this way, people should know about it.

---

Still not super happy about shifting into the sign bit, but yeah... don't break userspace, I guess.

 include/uapi/linux/mmc/ioctl.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
include/uapi/linux/mmc/ioctl.h +4 -1
index 45f369dc0a42..ae659333e73f 100644
@@ -5,7 +5,10 @@
 #include <linux/types.h>
 
 struct mmc_ioc_cmd {
-	/* Implies direction of data.  true = write, false = read */
+	/*
+	 * Implies direction of data.  true = write, false = read.
+	 * Bit 31 selects 'Reliable Write' for RPMB.
+	 */
 	int write_flag;
 
 	/* Application-specific command.  true = precede with CMD55 */
Signature · 1 line
2.11.0
Reviewed-by on v1 1/1
#1 lore raw

Hi Wolfram,

Quoted 3 lines · Wolfram Sang

If we use it this way, people should know about it.

Quoted 4 lines

---

Still not super happy about shifting into the sign bit, but yeah... don't break userspace, I guess.

Indeed.

Quoted 8 lines
 include/uapi/linux/mmc/ioctl.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
include/uapi/linux/mmc/ioctl.h +0 -0
index 45f369dc0a42..ae659333e73f 100644

include/uapi/linux/mmc/ioctl.h line 9

Quoted 6 lines
include/uapi/linux/mmc/ioctl.h +2 -1
@@ -5,7 +5,10 @@
 #include <linux/types.h>
 
 struct mmc_ioc_cmd {
-       /* Implies direction of data.  true = write, false = read */
+       /*
+        * Implies direction of data.  true = write, false = read.

nonzero = write, zero = read?

include/uapi/linux/mmc/ioctl.h line 10

Quoted 1 line
include/uapi/linux/mmc/ioctl.h +1 -0
+        * Bit 31 selects 'Reliable Write' for RPMB.

Perhaps having a #define for this would be nice?
Can also be used by the driver, instead of 1 << 31, which some static analyzers may complain about.

include/uapi/linux/mmc/ioctl.h line 14

Quoted 4 lines
include/uapi/linux/mmc/ioctl.h +1 -0
+        */
        int write_flag;
 
        /* Application-specific command.  true = precede with CMD55 */

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#2 lore raw
Quoted 4 lines
Quoted 2 lines

Thanks, Geert!

Quoted 5 lines

include/uapi/linux/mmc/ioctl.h line 9

Quoted 3 lines
include/uapi/linux/mmc/ioctl.h +2 -1
-       /* Implies direction of data.  true = write, false = read */
+       /*
+        * Implies direction of data.  true = write, false = read.

nonzero = write, zero = read?

Yes, even better. Will update.

Quoted 5 lines
Quoted 1 line

+ * Bit 31 selects 'Reliable Write' for RPMB.

Perhaps having a #define for this would be nice?
Can also be used by the driver, instead of 1 << 31, which some static analyzers may complain about.

Maybe. Should be an incremental patch then, I'd say.