Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2044913rwd; Mon, 15 May 2023 06:38:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4iqINNx0p5vJKa3w51VCZ3Wt4x+YI97od39yC8ADr2yfy6wYiSMfdC9HWnc2xxN18PBTgk X-Received: by 2002:a17:903:234c:b0:1aa:ffa9:9260 with SMTP id c12-20020a170903234c00b001aaffa99260mr43708870plh.7.1684157924830; Mon, 15 May 2023 06:38:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684157924; cv=none; d=google.com; s=arc-20160816; b=ZX/VDsrSHPB80ZKu9ntTpxz/g+1gT6QE7VWCjfpa7L+uu0rnSUFu7/KZ3h5s6TtaCm CgjVLl9MfWL3/a3N/m3JspmvnEF+qXUEGGBpGegH9l2veEEwILy37wPRPcQ4xkfHz7L0 JKnZR9ezfhIZAv+MJutV66Vpwqfp6oVVVyOkZWwE7gWg9oumF59Nbq1Q6GqQ/5xV8kgd JcG0zqaU8hr8leqsJdWlZTlvJRjNQ++MVzApDis74evtkN1XdVXAawgoDnxoyrilzjqb rgES31xCNejZfQFXd/+icws2ni8Cx9/i/GDcFIhQpRpsm7vlzc4yVcjDfHEeGIiyuO5p ofJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=tBBnywFAp40cBSWQciTvgFzP/RU4Qu/PWS6WSvEJl9c=; b=b3yPtTwdGEgFFuobTFU7QGvivq5CyKlO/M14tqyQNFyz//xf9T/uQpL5OZTV7AhMMu 8ZadvZm+/P+/CVZF7Y8DVvaiCWE9GBEcYPpH2Vjzweu8k9wzm6JgJwfGn71V3Lsg0Puv PE8E0QocpKaoKfSGAAer0UdYS5YtpAdJEkD7G2rOSH2KthwnB+Sn45cNYDGdBJY+b0Ou VpaGvcvXLJbZ3EGSl1uVK8pZXGNONcD/IWUJ20IG1d55qVtNttPg8zCWVF8uMgIj4khK A+V2AGsdNzrZKIxZYPC81g08q1AnC3/OdhdLzxgkymVTmfefFQT7PVSi1ufOsQRN9uDx 0eAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ip6XM3Ig; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ik9-20020a170902ab0900b001aae90cd42dsi15119723plb.312.2023.05.15.06.38.31; Mon, 15 May 2023 06:38:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ip6XM3Ig; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242364AbjEON3t (ORCPT + 99 others); Mon, 15 May 2023 09:29:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242151AbjEON3j (ORCPT ); Mon, 15 May 2023 09:29:39 -0400 Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C831E1FF7 for ; Mon, 15 May 2023 06:29:37 -0700 (PDT) Received: by mail-yb1-xb35.google.com with SMTP id 3f1490d57ef6-b9a7e639656so19622016276.0 for ; Mon, 15 May 2023 06:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684157377; x=1686749377; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tBBnywFAp40cBSWQciTvgFzP/RU4Qu/PWS6WSvEJl9c=; b=ip6XM3IgqX6aF1OsyKVAsDHhju5FVnDewzxp1m2ht+T7GXgzjubGVaBiagihtkHtN0 lPrUzIDL53/NCo9Jirc3lyKhJA9d8e+WG9zxApKdVnOPzc7cnMRD2d/jAXayy236jrBU oZlTxCOZxZLHUYjcm1eZ8SMnhBqOWAsSha6kKdR2DLr5PoxtXr/CuHo+aSk82mXl0h52 Dh7LXKVUxq0KwFVgU72H2KjhjdaXHHZAUzDz2AAH80Jn35JutPj51OXAyKGeNY+cKFPz UNrH/vp9Qy2Y085oNZG39w4kRV0qKAyPd5Ig7+PfgDdUW/mA2dN6NbqkQWSK0f5rUyg7 sgDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684157377; x=1686749377; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tBBnywFAp40cBSWQciTvgFzP/RU4Qu/PWS6WSvEJl9c=; b=XilIqlgp5bT9Skp7xZrTs9UBbuhRQs7TnUTHLSlZcfF68dKOlMpPZq+IFrdfVnznuh JqrZgVMdvogoCbhS6UZ8Wg7Y3AbeogTIDJJL1SJOC9OdL8wq7D0a8bg08H+itCiOD4+v Ys/Oglttac/GONor0uwKDMlTUZiEZjiJ0kEolkE2wFW8wmKCyEnbn/Hz/V71lkWok1bw F5gBlWb+SR6xSgSTaw3ks03D/fI1eogD+m+60rK4zbZKq2DF2rMD2yZUIiYA1Oeg5L9s g6lsmOwy4Mc0ZrczwjCgG6J7u9D283dVjtXOqxZT01O4bb+YmlwGO/b5R2s9CqzB40Bd FV6w== X-Gm-Message-State: AC+VfDzkZINr7NSROZAAQ+SW4xTo/aZiz3hX56dSCtcRHsEFVHfippUf /+YkH2I4YkHfAj+5YTfKQpngRepzznapkcq9t8AJQQ== X-Received: by 2002:a81:7d02:0:b0:55a:88f0:a49c with SMTP id y2-20020a817d02000000b0055a88f0a49cmr34355712ywc.33.1684157377002; Mon, 15 May 2023 06:29:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ulf Hansson Date: Mon, 15 May 2023 15:29:01 +0200 Message-ID: Subject: Re: [PATCH 1/3] mmc: block: ioctl: define rpmb reliable flag To: =?UTF-8?Q?Christian_L=C3=B6hle?= Cc: Adrian Hunter , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Avri Altman Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 5 Apr 2023 at 13:57, Christian L=C3=B6hle = wrote: > > Give a proper name to BIT 31 which is used as reliable write > for RPMB. > > Signed-off-by: Christian Loehle > --- > 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 th= e > * 'Reliable Write' bit here. > */ > - sbc.arg =3D data.blocks | (idata->ic.write_flag & BIT(31)= ); > + sbc.arg =3D data.blocks | > + (idata->ic.write_flag & MMC_RPMB_RELIABLE_WRITE); > sbc.flags =3D MMC_RSP_R1 | MMC_CMD_AC; > mrq.sbc =3D &sbc; > } > diff --git a/include/uapi/linux/mmc/ioctl.h b/include/uapi/linux/mmc/ioct= l.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