* [PATCH 1/3] mmc: block: ioctl: define rpmb reliable flag
@ 2023-04-05 11:57 Christian Löhle
2023-04-20 12:46 ` Avri Altman
2023-05-15 13:29 ` Ulf Hansson
0 siblings, 2 replies; 3+ messages in thread
From: Christian Löhle @ 2023-04-05 11:57 UTC (permalink / raw)
To: Ulf Hansson, Adrian Hunter, linux-mmc@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Avri Altman
Give a proper name to BIT 31 which is used as reliable write
for RPMB.
Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
---
drivers/mmc/core/block.c | 5 ++++-
include/uapi/linux/mmc/ioctl.h | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 672ab90c4b2d..16e262ddc954 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -49,6 +49,8 @@
#include <linux/uaccess.h>
+#include <uapi/linux/mmc/ioctl.h>
+
#include "queue.h"
#include "block.h"
#include "core.h"
@@ -538,7 +540,8 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
* may be increased by a future standard. We just copy the
* 'Reliable Write' bit here.
*/
- sbc.arg = data.blocks | (idata->ic.write_flag & BIT(31));
+ sbc.arg = data.blocks |
+ (idata->ic.write_flag & MMC_RPMB_RELIABLE_WRITE);
sbc.flags = MMC_RSP_R1 | MMC_CMD_AC;
mrq.sbc = &sbc;
}
diff --git a/include/uapi/linux/mmc/ioctl.h b/include/uapi/linux/mmc/ioctl.h
index e7401ade6822..b2ff7f5be87b 100644
--- a/include/uapi/linux/mmc/ioctl.h
+++ b/include/uapi/linux/mmc/ioctl.h
@@ -11,6 +11,7 @@ struct mmc_ioc_cmd {
* Bit 31 selects 'Reliable Write' for RPMB.
*/
int write_flag;
+#define MMC_RPMB_RELIABLE_WRITE (1 << 31)
/* Application-specific command. true = precede with CMD55 */
int is_acmd;
--
2.37.3
Hyperstone GmbH | Reichenaustr. 39a | 78467 Konstanz
Managing Director: Dr. Jan Peter Berns.
Commercial register of local courts: Freiburg HRB381782
^ permalink raw reply related [flat|nested] 3+ messages in thread* RE: [PATCH 1/3] mmc: block: ioctl: define rpmb reliable flag
2023-04-05 11:57 [PATCH 1/3] mmc: block: ioctl: define rpmb reliable flag Christian Löhle
@ 2023-04-20 12:46 ` Avri Altman
2023-05-15 13:29 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Avri Altman @ 2023-04-20 12:46 UTC (permalink / raw)
To: Christian Löhle, Ulf Hansson, Adrian Hunter,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
> Give a proper name to BIT 31 which is used as reliable write
> for RPMB.
>
> Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Thanks (see nit below),
Avri
> ---
> drivers/mmc/core/block.c | 5 ++++-
> include/uapi/linux/mmc/ioctl.h | 1 +
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index 672ab90c4b2d..16e262ddc954 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -49,6 +49,8 @@
>
> #include <linux/uaccess.h>
>
> +#include <uapi/linux/mmc/ioctl.h>
> +
> #include "queue.h"
> #include "block.h"
> #include "core.h"
> @@ -538,7 +540,8 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card
> *card, struct mmc_blk_data *md,
> * may be increased by a future standard. We just copy the
> * 'Reliable Write' bit here.
> */
> - sbc.arg = data.blocks | (idata->ic.write_flag & BIT(31));
> + sbc.arg = data.blocks |
> + (idata->ic.write_flag & MMC_RPMB_RELIABLE_WRITE);
> sbc.flags = MMC_RSP_R1 | MMC_CMD_AC;
> mrq.sbc = &sbc;
> }
> diff --git a/include/uapi/linux/mmc/ioctl.h b/include/uapi/linux/mmc/ioctl.h
> index e7401ade6822..b2ff7f5be87b 100644
> --- a/include/uapi/linux/mmc/ioctl.h
> +++ b/include/uapi/linux/mmc/ioctl.h
> @@ -11,6 +11,7 @@ struct mmc_ioc_cmd {
> * Bit 31 selects 'Reliable Write' for RPMB.
No longer needed.
Thanks,
Avri
> */
> int write_flag;
> +#define MMC_RPMB_RELIABLE_WRITE (1 << 31)
>
> /* Application-specific command. true = precede with CMD55 */
> int is_acmd;
> --
> 2.37.3
>
>
> Hyperstone GmbH | Reichenaustr. 39a | 78467 Konstanz
> Managing Director: Dr. Jan Peter Berns.
> Commercial register of local courts: Freiburg HRB381782
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 1/3] mmc: block: ioctl: define rpmb reliable flag
2023-04-05 11:57 [PATCH 1/3] mmc: block: ioctl: define rpmb reliable flag Christian Löhle
2023-04-20 12:46 ` Avri Altman
@ 2023-05-15 13:29 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2023-05-15 13:29 UTC (permalink / raw)
To: Christian Löhle
Cc: Adrian Hunter, linux-mmc@vger.kernel.org,
linux-kernel@vger.kernel.org, Avri Altman
On Wed, 5 Apr 2023 at 13:57, Christian Löhle <CLoehle@hyperstone.com> wrote:
>
> Give a proper name to BIT 31 which is used as reliable write
> for RPMB.
>
> Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
> ---
> drivers/mmc/core/block.c | 5 ++++-
> include/uapi/linux/mmc/ioctl.h | 1 +
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index 672ab90c4b2d..16e262ddc954 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -49,6 +49,8 @@
>
> #include <linux/uaccess.h>
>
> +#include <uapi/linux/mmc/ioctl.h>
> +
> #include "queue.h"
> #include "block.h"
> #include "core.h"
> @@ -538,7 +540,8 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
> * may be increased by a future standard. We just copy the
> * 'Reliable Write' bit here.
> */
> - sbc.arg = data.blocks | (idata->ic.write_flag & BIT(31));
> + sbc.arg = data.blocks |
> + (idata->ic.write_flag & MMC_RPMB_RELIABLE_WRITE);
> sbc.flags = MMC_RSP_R1 | MMC_CMD_AC;
> mrq.sbc = &sbc;
> }
> diff --git a/include/uapi/linux/mmc/ioctl.h b/include/uapi/linux/mmc/ioctl.h
> index e7401ade6822..b2ff7f5be87b 100644
> --- a/include/uapi/linux/mmc/ioctl.h
> +++ b/include/uapi/linux/mmc/ioctl.h
> @@ -11,6 +11,7 @@ struct mmc_ioc_cmd {
> * Bit 31 selects 'Reliable Write' for RPMB.
> */
> int write_flag;
> +#define MMC_RPMB_RELIABLE_WRITE (1 << 31)
I am not sure this is really worth it. Keeping kernel headers for user
space in sync is a bit messy.
The define as such seems reasonable, but isn't it better to have the
define at two places then? One that's part of the MMC subsystem in the
kernel and another that's specific to the mmc-utils userspace tool?
[...]
Kind regards
Uffe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-05-15 13:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-05 11:57 [PATCH 1/3] mmc: block: ioctl: define rpmb reliable flag Christian Löhle
2023-04-20 12:46 ` Avri Altman
2023-05-15 13:29 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox