From patchwork Wed Apr 5 11:57:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Loehle X-Patchwork-Id: 13201685 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A88C5C7619A for ; Wed, 5 Apr 2023 11:57:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237915AbjDEL5h convert rfc822-to-8bit (ORCPT ); Wed, 5 Apr 2023 07:57:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238013AbjDEL5h (ORCPT ); Wed, 5 Apr 2023 07:57:37 -0400 Received: from mail6.swissbit.com (mail5.swissbit.com [148.251.244.252]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71DE03C0E; Wed, 5 Apr 2023 04:57:35 -0700 (PDT) Received: from mail6.swissbit.com (localhost [127.0.0.1]) by DDEI (Postfix) with ESMTP id D295E22293F; Wed, 5 Apr 2023 13:57:33 +0200 (CEST) Received: from mail6.swissbit.com (localhost [127.0.0.1]) by DDEI (Postfix) with ESMTP id C766B221887; Wed, 5 Apr 2023 13:57:33 +0200 (CEST) X-TM-AS-ERS: 10.181.10.103-127.5.254.253 X-TM-AS-SMTP: 1.0 bXgxLmRtei5zd2lzc2JpdC5jb20= Y2xvZWhsZUBoeXBlcnN0b25lLmNvb Q== X-DDEI-TLS-USAGE: Used Received: from mx1.dmz.swissbit.com (mx.dmz.swissbit.com [10.181.10.103]) by mail6.swissbit.com (Postfix) with ESMTPS; Wed, 5 Apr 2023 13:57:33 +0200 (CEST) From: =?iso-8859-1?q?Christian_L=F6hle?= To: Ulf Hansson , Adrian Hunter , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Avri Altman Subject: [PATCH 1/3] mmc: block: ioctl: define rpmb reliable flag Thread-Topic: [PATCH 1/3] mmc: block: ioctl: define rpmb reliable flag Thread-Index: AdlntW2uE8YL5x37Rg65HliP9l7Uww== Date: Wed, 5 Apr 2023 11:57:21 +0000 Message-ID: Accept-Language: en-US, de-DE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: MIME-Version: 1.0 X-TMASE-Version: DDEI-5.1-9.0.1002-27546.007 X-TMASE-Result: 10-2.026600-10.000000 X-TMASE-MatchedRID: mIinBA9F1pztpeQ2em9csrnHu4BcYSmtwTlc9CcHMZerwqxtE531VIPc XuILVCba7MOQ+kboAnB3ZVcbJy0H7nHPBvSspzfj9k0tWBWiOf+24zimxRfEgXhPzhoND77Mo8W MkQWv6iUJjITObGXoFY2j49Ftap9EOwBXM346/+zDqHd5lJWkyh6aBHx46AYmYHW0KadjRP75im mUIX9zfjmjCzRUNNaJ X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 X-TMASE-INERTIA: 0-0;;;; X-TMASE-XGENCLOUD: 7719b2d5-1bf5-432a-931e-2742bcde89a9-0-0-200-0 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Give a proper name to BIT 31 which is used as reliable write for RPMB. Signed-off-by: Christian Loehle Reviewed-by: Avri Altman --- 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 +#include + #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;