Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp1166957lqs; Wed, 6 Mar 2024 08:06:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCURfsLYp7hY93d08Ed7uSoAuQlxt0a1vYtDaIBbCcYO7IfQbrqNpUmSMVfZV4m3p5Fh2/lp9XYl9LkkfBxmd+4hA5okYsfWlJSe7tzCbQ== X-Google-Smtp-Source: AGHT+IE3ptglWOs5LQ5Z7VFmAbiVwCpDNUGODhpeGMY/MNfwKeCslZFU7AgESd5RwPEKm763YkP2 X-Received: by 2002:a17:906:394c:b0:a44:e3d:68a8 with SMTP id g12-20020a170906394c00b00a440e3d68a8mr11359155eje.45.1709741204247; Wed, 06 Mar 2024 08:06:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709741204; cv=pass; d=google.com; s=arc-20160816; b=gm+xGn92rzkWgMIcQzoBjSvRhAWWLMmC9aSpbQRRc8eiTfwED/zCrCvjVzW7nxQwmu A03xFO0Gh0Xyc6xqgyvcr99DcAOiI2gl2N3D3RLPci2o3bE61GC/sgp2N+wqmDkeNQCV a66nm/y7Wo50qgFfYbFv3adaR/AAHamm6ub5PWD9qSBygvtBPKdB/Jr8D+aXP+egRLHO wfnf3ZR0qjVN850LQrx7Zc1wUfwdcTtVgmMv5RTNQr9z034HWYLopfBizbFiOvJoqAHX C7XgQJgNi4lSkr1UNpKZf2kjINfiRnxb20Af4gGvksPg5EHazlEgCai9JOhDFey7NrsD 6etQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=2f+5aPU/XdbNCp1ggYwNVgQ5AaKBkNmvjYLVF7eMmS8=; fh=vgekESiNWFybucSnKC+N2ZK1ewpKzz47WGtdpCa81NU=; b=Pg52U94yRoNGEkV7CiVyhU94/qnLP0RGpeqz3ovx0VpSVcmtV21EVQFC4hACL4//Ns M+GV18J39OuKowkxVq+pqov8mNbnSkCoFBD2vbdXQyqkFZPN4/K9BnPAYc6/o0loPabB kufPbSgwUhdgVb0ln9Vw+cIDbJXi14GZSuSH90JZY78uS0YVz5h2kjhAnNdd03O1kDZv I45xwHLO1sw7ML7jpO9f7zX2iW/PKkjKQknXC//qkSG+bpn+VKK6fOu3sGQ/B2HVI8K7 UTzxw0A6ulhWQUkrzswXjZWM5YouLdfjedcs0hkGpYeSNAsn7E+RkvJCHSA65nnUqErb tHfg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G+9JnmEF; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-94209-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94209-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u6-20020a17090617c600b00a440858706csi6324310eje.563.2024.03.06.08.06.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 08:06:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94209-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G+9JnmEF; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-94209-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94209-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A223D1F29DAE for ; Wed, 6 Mar 2024 15:58:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 87A3D137919; Wed, 6 Mar 2024 15:57:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="G+9JnmEF" Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 302B4137914 for ; Wed, 6 Mar 2024 15:57:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709740625; cv=none; b=AzrSJssUVCHECpd1sF7z5iuTUC0iLhnzHuqObrTVw7sLe88Z5J9ttM0uyJmwKUQmDt2lCJ2kt/gfuLprTBbdPWcaQkuc39reK/22WX25M06t642ufSkYDs4+/7EF0cuKXCwrYQSnGcuKWzoE5T7V3Y4+fTi3UPBd19v53D7eZLI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709740625; c=relaxed/simple; bh=y1KNSY2klj9TyNv0mKj+D0MKiuhGSXTO5BHMy1t7fH8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=BJMX7hp1ObHJjBP/2DYkEJu7ziLBYyppR3YQ+jwqMTrRwjX0pf1XeCiMQyepmZkzNEoCtMy4mVlNnduiw0p4LPMw98zWS/8OHJc1pNhRQugt6r8qwTqQ2TTOocj9g8pZN6AOWOmEhI7oE6zQI4D1x96GFHKWDhlseI3T7BAAcAA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=G+9JnmEF; arc=none smtp.client-ip=209.85.128.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-6095dfcb461so11643297b3.2 for ; Wed, 06 Mar 2024 07:57:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709740623; x=1710345423; 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=2f+5aPU/XdbNCp1ggYwNVgQ5AaKBkNmvjYLVF7eMmS8=; b=G+9JnmEFomgLSXSdnMmXKue6XtwdWTMZFLJDq62dzc4zs0lo6Ee2KwAFQQCz/Ga23o QCQpNBVDawtZDlD3hZTeFCR0hcmn6liXnD8yTfQKFB5RNCA6u2DNfgguYOmD3NA15rOa K87ivmidMac+if65s7GvP8GOWsFeIxBeew02QlL4A1Kbs+YjDxhNf/2J7RwUGDNTHUoJ nQH3eXGailZepNEgGqP0Rmxn/BTbtfw/heGmle7/GA2ZpVm05fT1lqEWfiIlwS+itICi 7DpYNyXiVQBW3FM8FzHAT6uu1DBgC9n7Y012oL6okeVHwEYOUlX9sb6m+iGn+xF7I9II j91g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709740623; x=1710345423; 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=2f+5aPU/XdbNCp1ggYwNVgQ5AaKBkNmvjYLVF7eMmS8=; b=Zzs1KCB3nX2/+Njgt3ny3Ujm86sqdtetkV5lIQctbemlvkPEwbM6noRfbv8zg+1los I+a8AvAdsHNPAtF6HY+0JFyz/fbY8neq0DpZfzVFo38FXBT7s8KA0m4j+dhMM+FgTiZd mgieqOcVf0HSCvQ1aM+o3gaROSoK/RyCWdOXKiDbZPdtfpbyJscY/ngzTDLiiuT8gjpE QcfjSZYsG3xKr5W8BZksUyuwibhc/hAQdF4X588JWSioDG1qTXPRZ9PUJtwsv3q4FcfO mk61MO9+mO+p6nXa0x2Np483ylWpJnY/ChiCNFxa7aBM2G8VHlOX0VgCS+C+UakkfYbj r1OQ== X-Forwarded-Encrypted: i=1; AJvYcCWGSzdiWCKe0j5KtWOkwW3NOz9fHm8Hv324rEzG0le2tUYGt91IOoF9jFoRqTyKB4ejsv4LzG8ucpFqPjZZpdAaZhSzz+XPkfshN7eP X-Gm-Message-State: AOJu0Yx4P1xURZVA1OznoFaNSKCFdELvXenVxWmSFK0beOz8n+lSvRBU DuZdrBzqkiL/EgHNGYedcyBtYLgSUZKzxEwPABXbn2tDjlTyXfoY3jPBn2X1tUWPDaamRxaRlZg DoUpnelNuQc+YMrq2aRaOsMz/JPPai9QrzipcTQ== X-Received: by 2002:a25:6b09:0:b0:dcd:24b6:1aee with SMTP id g9-20020a256b09000000b00dcd24b61aeemr10930675ybc.47.1709740622702; Wed, 06 Mar 2024 07:57:02 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240306-mmc-partswitch-v1-1-bf116985d950@codewreck.org> In-Reply-To: From: Ulf Hansson Date: Wed, 6 Mar 2024 16:56:26 +0100 Message-ID: Subject: Re: [PATCH] mmc: part_switch: fixes switch on gp3 partition To: Linus Walleij Cc: "Jorge Ramirez-Ortiz, Foundries" , Jens Wiklander , Tomas Winkler , Dominique Martinet , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Dominique Martinet , stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 6 Mar 2024 at 15:38, Linus Walleij wrote= : > > On Wed, Mar 6, 2024 at 3:22=E2=80=AFPM Jorge Ramirez-Ortiz, Foundries > wrote: > > > I still cant grasp how "target_part =3D idata->rpmb->part_index" is > > helping in the design. > > > > What happens when: > > 1) EXT_CSD_PART_CONFIG_ACC_MASK > part_index > EXT_CSD_PART_CONFIG_ACC_= RPMB > > target_part now could be indicating a GP instead of an RPMB leading to = failures. > > > > 2) part_index <=3D EXT_CSD_PART_CONFIG_ACC_RPMB > > loses the part_index value . > > > > So part_index should be larger than EXT_CSD_PART_CONFIG_ACC_MASK even > > though the comment indicates it starts at 0? > > > > /** > > * struct mmc_rpmb_data - special RPMB device type for these areas > > * @dev: the device for the RPMB area > > * @chrdev: character device for the RPMB area > > * @id: unique device ID number > > * @part_index: partition index (0 on first) <--------------------- > > * @md: parent MMC block device > > * @node: list item, so we can put this device on a list > > */ > > struct mmc_rpmb_data { > > struct device dev; > > struct cdev chrdev; > > int id; > > > > is it just possible that "target_part =3D idata->rpmb->part_index" just > > needs to be shifted to avoid issues? > > > > I think the fix to the regression I introduced could perhaps address > > this as well. > > I have no clue how the regression happened really ... heh. > > We should probably rename it part_cfg because that is what we > store in it, it's assigned from card->part[idx].part_cfg. > > Then the id field in mmc_rpmb_data should be deleted along > with all the IDA counter code etc and the partition name hardcoded > to be "0" as there will never be anything else. Seems reasonable to me. Are you thinking of sending a cleanup patch on top of $subject patch? Kind regards Uffe