Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp906256rdb; Fri, 1 Dec 2023 01:31:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEzV4uAR97Nu4W1gT4dLqkBsR36O/1k1QvBfWwYh0ng6tmUiwQ6km6oPkOQ0KLu0Hh+I/74 X-Received: by 2002:a05:6871:538a:b0:1fa:17d6:df41 with SMTP id hy10-20020a056871538a00b001fa17d6df41mr29056197oac.27.1701423101388; Fri, 01 Dec 2023 01:31:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701423101; cv=none; d=google.com; s=arc-20160816; b=m4zX/Dsc7/WJvr+SF6f/E5lMFQxnGkPPDqjCbSsVKhUw01+HjYIhGZj/gawj4Femp+ 5cK+bqfWuph1EAMn8BMwo/leHkJ7jnykDeuPiWj0vcUEwlkGtWin9fp2y8wcV0hLrGL8 jcDFuS7PuEByhOanV0JttQAwxMMROEDCg/u8vbL0Wcsl3UU5N4Pi7dv3l5tXp4+IUZz/ /+0eUFxsZKMi80Kmgc7Y6UY12NA8xpb68bjKzp7u3AjL0eygSy23u4Weeo8C5RmK5DGf 94/KSKc35j2R6zkL1hApmCFqfi7LZ/6/HAQhhNTPzEJpHZxzPbvnekVMOAgKecRu6HRH yweg== 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=CMJWPTMz3I601PDaKg2G9zUK8oGX7I/FmdndTXV+PEQ=; fh=F5Ue1vnLe53yoyMWoVP8H77ld16PZ3TVLrDGGBQqABw=; b=rcIFp6/SUAWNb/iV78qN+++CDCSqfSpPfjeYisezBXImsfO0Wv2nhMhKzc+KibUrbJ 8PXUAgm49Dw87Ogj7ZdjizlbzSN4xMOLBedzOcDu1d3wYXCMmR96d3GzfwlPodtWrp7M Jn9dayt9yZjXnU89i2Mgs6WIGJjT/4jb3uAxE4NX+oxUmdukOFXZ9icEo4WYC7ACfH0P DCi2H+ng8RgY+KWNVRnBSVAoVwAAZRGLwcdnFkMqKfmk8ydYZcbw2dH/5nc65ZOkkm4J JbHYNvSBjgmX8gVyfm060u3S1sJNksbEomCWDLTjOzJSFT3AfuM1+Gzl6Gy0S0Ql9MMD boIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="cgJ+49/0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id t67-20020a632d46000000b005b930e0b600si2964542pgt.820.2023.12.01.01.31.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 01:31:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="cgJ+49/0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 37EF58068C78; Fri, 1 Dec 2023 01:31:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378213AbjLAJbV (ORCPT + 99 others); Fri, 1 Dec 2023 04:31:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378068AbjLAJbD (ORCPT ); Fri, 1 Dec 2023 04:31:03 -0500 Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43FA5469E for ; Fri, 1 Dec 2023 01:29:06 -0800 (PST) Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-5d34d85e610so17601717b3.3 for ; Fri, 01 Dec 2023 01:29:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701422945; x=1702027745; darn=vger.kernel.org; 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=CMJWPTMz3I601PDaKg2G9zUK8oGX7I/FmdndTXV+PEQ=; b=cgJ+49/0UbaSjAIUhmS5SocHDBx5KjVQSIBtJrMHoKlfni5Q76uujUzQBPpBqh2pgz CLhspyrejyhIj5Jnih4hoDikQ+kOaHTF2sXwGXboSVwdLQ7vEtHuWgtC0aW64a7Ybnw6 yZbmjKQcq4ZG5a329c7iubSwnUzjNz0f3T8vSjigMUp/j75uiF5k72ICj3OdagoPbhwj UDe3VaURzy7E1ZJORcfnF6mM0CQBisKEIfyKNCe8zfRamQTL0dVgBvtHH7BinhaVAdtu j0Ll7MhKQ5q3P7pYpRPUtbkq61hWzlqD64979xH6O3lRDodkChzRht7JURyaSAtfVPZj h7dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701422945; x=1702027745; 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=CMJWPTMz3I601PDaKg2G9zUK8oGX7I/FmdndTXV+PEQ=; b=fNUz036TfQ1hqN1cmO6nHjTgKm4NU1FzUJKitPvpdWKFFGF05ZOxvx8z7PTN1OY93r Akc1BBHZMpsrfJS8qXmCXlcNVz2c9XiHaZ6uNgGzR3rE9JfBKmsZyAO7LBwE5lfwl87S I5+OMyGhwAD5pwzrEusyIfF5qIHbaND9q2wKOawZ2yYa2LE8DUs56C3/YHewDopxcQEu ZKI7oUvZTKfajscAFEpakfXdrGqrNEpMc18ViTeSoPjYpfNYwhxEunUMlxuMVsLyExsA gTBgz0xyJASJ4DkhI0ExKg++ciTMNRbe665t27NkJGRfphAgy8qycRMS5xnp5vxn+Hul xb8w== X-Gm-Message-State: AOJu0YzG5yo/+LpthGqocdLpUhK9dWFkzdhwP5IkF9g+NrQ3bUY1fFaJ rIKNepLVrRtVClubvgCMf3xjcAd6jls6br8GWb5jaA== X-Received: by 2002:a81:ae59:0:b0:5d4:313c:4b07 with SMTP id g25-20020a81ae59000000b005d4313c4b07mr937537ywk.23.1701422945075; Fri, 01 Dec 2023 01:29:05 -0800 (PST) MIME-Version: 1.0 References: <20231201091034.936441-1-jorge@foundries.io> In-Reply-To: <20231201091034.936441-1-jorge@foundries.io> From: Linus Walleij Date: Fri, 1 Dec 2023 10:28:52 +0100 Message-ID: Subject: Re: [PATCH] mmc: rpmb: fixes pause retune on all RPMB partitions. To: Jorge Ramirez-Ortiz Cc: ulf.hansson@linaro.org, CLoehle@hyperstone.com, adrian.hunter@intel.com, jinpu.wang@ionos.com, hare@suse.de, beanhuo@micron.com, asuk4.q@gmail.com, yangyingliang@huawei.com, yibin.ding@unisoc.com, victor.shih@genesyslogic.com.tw, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 01 Dec 2023 01:31:37 -0800 (PST) Hi Jorge, thanks for your patch! On Fri, Dec 1, 2023 at 10:10=E2=80=AFAM Jorge Ramirez-Ortiz wrote: > When RPMB was converted to a character device, it added support for > multiple RPMB partitions (Commit 97548575bef3 ("mmc: block: Convert RPMB > to a character device"). > > One of the changes in this commit was transforming the variable > target_part defined in __mmc_blk_ioctl_cmd into a bitmask. > > This inadvertedly regressed the validation check done in > mmc_blk_part_switch_pre() and mmc_blk_part_switch_post(). > > This commit fixes that regression. > > Fixes: 97548575bef3 ("mmc: block: Convert RPMB to a character device") > Signed-off-by: Jorge Ramirez-Ortiz My bug :/ Shouldn't we also add Cc: stable@vger.kernel.org? > + const unsigned int mask =3D EXT_CSD_PART_CONFIG_ACC_RPMB; > int ret =3D 0; > > - if (part_type =3D=3D EXT_CSD_PART_CONFIG_ACC_RPMB) { > + if (part_type & mask =3D=3D mask) { That looks complex, can't we just: if (part_type & EXT_CSD_PART_CONFIG_ACC_RPMB)? > + const unsigned int mask =3D EXT_CSD_PART_CONFIG_ACC_RPMB; > int ret =3D 0; > > - if (part_type =3D=3D EXT_CSD_PART_CONFIG_ACC_RPMB) { > + if (part_type & mask =3D=3D mask) { Dito here. Yours, Linus Walleij