Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp909408rdb; Fri, 1 Dec 2023 01:39:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IER9dw4oxZsQnCvKW5z45hkH4R1Ra7Uil0tyvam1UdoYAqx4sA/WnXft9CEYg5aRi9EKHAU X-Received: by 2002:a05:6a20:3d0b:b0:18c:90f9:5084 with SMTP id y11-20020a056a203d0b00b0018c90f95084mr19631611pzi.27.1701423561197; Fri, 01 Dec 2023 01:39:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701423561; cv=none; d=google.com; s=arc-20160816; b=iy2GwpwTOOw2lN6GMiL/n1Lt6ARQx8Qv8d+tQ+ki4IZsowzl4T8tAUC/IiGwpD4vfi uRBm2rGzwZNHvcRPq0tXFNANtu2BafmJ/zbLja2NkGjPG/DH2fE2iKwng3S6v04wXFDj iWk9WpY9RBBMsCvUdIx7PHpUHlnJ6HQSOLmJiPQEKOe97rXbSQxc4M9XVwpVuew073A0 Q+iGGJDNsRbtJceB1j+qjPrHisGGDz48eL5SdUcb6LrLkRVrigVszhYzMc6OgtJywN32 TQmSFcMqTPqH7yuJ3kZ3jRXamDqYyMfh+AOeBKZTwgtoaaYs64bnPyKvisC63faQAcnN fHfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=jC3/MuCtGjepod8Zkfcj95KcJ99A6m3gq/BQ2t/6ZL4=; fh=hdTZryjASHUJ7O6A/vmj+oad8i6JR3RD6AnjPu+iQ9s=; b=Z5d7AiA//+FucNPbAETt/7dk3L9iNYpW2IXgb6z/aLA1UGWXzKFbdDSR7QPPi6K2m4 S9mvtd+6ySgc31ZikKUQk//dfvybCblt8r9M0vnFX1kSlNVqTc3c0WlxhvFdubyQ8pBh lLS9bEhD8KULMeEaYfJwq/fVO6+Bjt8Pqx2tEMUez4S+YTQjfzvEtzT7YGzFNA6QNzLg pkMIjeEDTNlNvThP5mSAt81yBmQeRIviSD+Ta/4mjRoOOFtwZqUb3Qv5LZNpe55bK3cR f3bA+RDIhif08sLGYV+O01ySkFEGUsLe2ABuBOqt8lrSmX+wHJNGJFj8ADSjmjoISoSR +HKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foundries.io header.s=google header.b=iGyUHwET; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=foundries.io Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id s14-20020a170902a50e00b001d000c817a9si906763plq.18.2023.12.01.01.39.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 01:39:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@foundries.io header.s=google header.b=iGyUHwET; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=foundries.io Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 8B253833AB27; Fri, 1 Dec 2023 01:39:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378033AbjLAJjF (ORCPT + 99 others); Fri, 1 Dec 2023 04:39:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378047AbjLAJi7 (ORCPT ); Fri, 1 Dec 2023 04:38:59 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A79C12B for ; Fri, 1 Dec 2023 01:39:04 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40b479ec4a3so16949265e9.2 for ; Fri, 01 Dec 2023 01:39:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundries.io; s=google; t=1701423543; x=1702028343; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:from:to :cc:subject:date:message-id:reply-to; bh=jC3/MuCtGjepod8Zkfcj95KcJ99A6m3gq/BQ2t/6ZL4=; b=iGyUHwETdWNYzY8Zfu300PY2PStD5FxNBr5dz/jjSUPRMRfDpONJiQp5/pKf/P4Glg 4mWd8mcwZcZxajpqhnMOOjXc0YsMw3/tARKVBc38sDKkvX7DiE287rDs8hOZdcuaQ60R LlRqxzvz3LsbZGULZyreqYKthB+4SMCUktfFxLGRoBcNet5m/EyTveYfOrUxjPHkIdZH BKuJCFkZfVphA9crns/Xz0nqPk3RcPgmq8ir1N5SwWi7BdUIeJAocQFEc9rXnW/aLJid ITwzWg/M63zxN3DGqNcHCeB+HmeH5CVMXGnzCKJ2fPWuM8431j91c40BRWscmUUWykes SFOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701423543; x=1702028343; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jC3/MuCtGjepod8Zkfcj95KcJ99A6m3gq/BQ2t/6ZL4=; b=Nr98n4Xza+CrC3zg/r7l4h55OpMaXen8yypZfwKvJdivckMQSF4vY3jY11R06GoEVo IBSEPFXM065TG4FRAeJq+0fsC6j6xIm7miLcBswA1tPOOR3t8pTGqIAE70X7ykA2pZnq j/JeYgQCiJUKV9hbIsvEslrsRDbxvmnvDnRXmI4dVolS9jZp31XOnaIsTlpzHXBHM2CH PsVNWjVYSLhe2ISlgHSRIthzx/56sPaxiVjL/DlPnLsUrQZ3oBVek/rUXYyhgLJGSlig hPGAxas771VmSt4lk4kpdRGaje5fyr4nZAoAzXI0dUjvokebZ65coGktirQGDkms4q7O 8LEA== X-Gm-Message-State: AOJu0Yyp4LMzRZdPbIf/mJe0IkgrHBSF/79w7kGKJjcUoQKmCto3ZvNC fY3qG1EzDeQNnk7NUN90P6ddRA== X-Received: by 2002:a7b:cc82:0:b0:40b:5e22:97f with SMTP id p2-20020a7bcc82000000b0040b5e22097fmr369829wma.110.1701423543053; Fri, 01 Dec 2023 01:39:03 -0800 (PST) Received: from trax (139.red-79-144-198.dynamicip.rima-tde.net. [79.144.198.139]) by smtp.gmail.com with ESMTPSA id bd22-20020a05600c1f1600b004090798d29csm4877947wmb.15.2023.12.01.01.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 01:39:02 -0800 (PST) From: "Jorge Ramirez-Ortiz, Foundries" X-Google-Original-From: "Jorge Ramirez-Ortiz, Foundries" Date: Fri, 1 Dec 2023 10:39:01 +0100 To: Linus Walleij Cc: Jorge Ramirez-Ortiz , 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 Subject: Re: [PATCH] mmc: rpmb: fixes pause retune on all RPMB partitions. Message-ID: References: <20231201091034.936441-1-jorge@foundries.io> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 morse.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 (morse.vger.email [0.0.0.0]); Fri, 01 Dec 2023 01:39:18 -0800 (PST) On 01/12/23 10:28:52, Linus Walleij wrote: > Hi Jorge, > > thanks for your patch! > > On Fri, Dec 1, 2023 at 10:10 AM 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? ack, will do. > > > > + const unsigned int mask = EXT_CSD_PART_CONFIG_ACC_RPMB; > > int ret = 0; > > > > - if (part_type == EXT_CSD_PART_CONFIG_ACC_RPMB) { > > + if (part_type & mask == mask) { > > That looks complex, can't we just: > > if (part_type & EXT_CSD_PART_CONFIG_ACC_RPMB)? I chose to mention the mask nature of the field for clarity - just in case - but I'd much rather do your suggestion. So will do :) > > > + const unsigned int mask = EXT_CSD_PART_CONFIG_ACC_RPMB; > > int ret = 0; > > > > - if (part_type == EXT_CSD_PART_CONFIG_ACC_RPMB) { > > + if (part_type & mask == mask) { > > Dito here. yep > > Yours, > Linus Walleij thanks !