Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp1111719lqs; Wed, 6 Mar 2024 06:44:51 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUvSKj0oCIk6B9hWMrtWKPRQM7Wtpix2cX/RQZtSVrl1m80D65zpERWG1WRy0Wp6YGAGM3j0JEM/cVOHNRJ8Z17vRxBEz8cuWFQlS+lvg== X-Google-Smtp-Source: AGHT+IHmyRGq+D6Zg7+ODPzU+xHnWdPJSYHle8vsTBpmZqNz4uAwgY6+pHNyLE0SvOMljMBJsJyD X-Received: by 2002:a05:6830:b:b0:6e4:ddb7:ae7 with SMTP id c11-20020a056830000b00b006e4ddb70ae7mr5978582otp.17.1709736291020; Wed, 06 Mar 2024 06:44:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709736290; cv=pass; d=google.com; s=arc-20160816; b=NZMeT0ztaxcmuyyspQ+mpmiBu0+8VPqRzHDkmujzy9ACDFZ2Ms02PXs07qF9e+zZPH cICRv0PiYHT9vhJuOwJB6tWQDBmbkIJTO8JqdbRjp1DFd0ab5J+VSfN/T7WbZgKulTNh 7peT1O+QNLQbo00vVU+ZuCkgTZdCiv4WD2rWTiLh7jT8sni0X702enb3I5vxGicvgYXR n50JZRAT5rcNbpKAnreNGQO9w9Y+XMpiWvSGkaP+InoNlx0aDU65I++/7xW0+VVjx74K QtP9Whr3F0pdWw+c5+OX1/ojykAZTxVFwU66eY+XZULV5jS5+gGnlqsea/Y6FsFlPrmW di+g== 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=JbF9LUE00uQRPWZd4Zl2CO3WAagI5yDkhO9LWfTGu1g=; fh=xpkFfhtDsJoRMbOmK6/ICbTjnyy+StwsFRAUqbyYof8=; b=N1y/Vzr3MXiLUXkbL4lSSvbBG2vdcx6w7C2pp9KvaDS04i2YiZONYz5bgdAVkQTo3n b0sHe939IdxOOXtc8+SSFC+2b1d9AvYc57rNha54VwDtBXulkP4pE38vIv+oW+i8e2ux JLkIyGk5tpmyKK7mAr4jTjuE+oEtopzqweYD/Cnrp59dUXu0kdZIwRVNzckl3NlAL5Lm 13aBBQ+iSxlc8ImsNAohGhSLsj/FRuLIxXSKQUv090odvs/rGNeQCXR9xe2AtlnOGizf RBE6YcDWl84C0iiKVOPUFnkrEAfhjFFSDp65995G/5202gsYFcv9Ohd9VWFYUbzXkIu9 nBRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fQzIn7iW; 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-94069-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94069-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c11-20020a63350b000000b005d5c0ffa481si11959584pga.455.2024.03.06.06.44.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 06:44:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94069-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fQzIn7iW; 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-94069-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94069-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C7756B25084 for ; Wed, 6 Mar 2024 14:39:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5731613475B; Wed, 6 Mar 2024 14:38:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="fQzIn7iW" Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.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 DCFCE13442A for ; Wed, 6 Mar 2024 14:38:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709735927; cv=none; b=eOl76lyl2v8r0DRMx3f49PP7DelAN6t8dVRWMcTGPjHR6FPq/9QQHiqv4EynvnE9a+uTlq725wlWESLLTlRPrDla8if6pSRNTMMTjZ07ULrVkLN/Pk8bJznvXUqmtECuRMGhPSvpZY+jxWOwuQS1S9kcjmtgPZ5CxXbZV0TJBR4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709735927; c=relaxed/simple; bh=UYQElA21Vc/pmhp4gVpQGCZky5AHWUDbfIp4Jo9TBWc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=kOf3IVNed4J8h9/2UFbni9FQBYhlOilS0/dABBy+KYETtafyf0pA2WJLJcsUuNqBR1edyRGq3FepZ//+rmGGEq1WvvvbzRjr1tv2lV1m2FfkkJpBxzCzhSrFMZy0qtKy6P+afipxnB11hmcE/f7jZakXGkP4sSDKIMTedFHoQ6U= 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=fQzIn7iW; arc=none smtp.client-ip=209.85.219.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-yb1-f180.google.com with SMTP id 3f1490d57ef6-dcd9e34430cso7144471276.1 for ; Wed, 06 Mar 2024 06:38:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709735925; x=1710340725; 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=JbF9LUE00uQRPWZd4Zl2CO3WAagI5yDkhO9LWfTGu1g=; b=fQzIn7iWzCw6LFRZ5+Fo0f5reaGVdKKJHmu4aBw015uAsEg4nS8VX8rzc7ybMU7fJc HjC40kZvV3d4+3a3rUsGDb7VtZP6gAJbA7F9MUdagPC8UvMcdpbYOmJGhcHQ592WlYbx e6HLP/Csv/M1djh7tiXFtyVp9suOLZvTwFlR6yKLaSNvoy2Bu0BgEE6/CruiegtJVM/5 wJzXwCTZFyRSXQxwjV/xON17tlcz5viLl5R6SpLM3/RLy0T7lBhFBTWlokQ82FyKDpi/ dJRxYKZizqO3Ey6k7Z0j+1m1Pf4ycsEBHkNxOesZqMcizVDI4mJXiSjBrEP1Mqa98J46 5dlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709735925; x=1710340725; 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=JbF9LUE00uQRPWZd4Zl2CO3WAagI5yDkhO9LWfTGu1g=; b=ZAQkk/tjf6isygSfFQfGGSziCa6Y2OPt1X3dS1NUDDwGPiLD4rlP9jMsKtckTXEOPv nN+iDDT0K2wsp6GDU5C7AY+cuC/JwLDjykkLhVUCoLGqYGVcLaQK0nbz5YQaPbf5sSGA ZIxSjcW09riklQZXrG4A4tafk82hAg1q+EGCiVXeWUbLm68DtEztnJJwuh0JgeN6ID0T YyBPSwAj6ynEYyzuWKiPTIyIOjyqsdYHpmg4lntgD2OXQL0gZnazWP0rAkiuh/w/xllb tkWr2bDUyJl7AMPEDHwoAiVsuFOTKCaVFIKp0KJXKBhfpyYTpUCuAxNV0tubh5bMZZU7 m+rQ== X-Forwarded-Encrypted: i=1; AJvYcCWVFQi2AOYq1yjlwC69SG/Br5TffwAFqye0PrytQy9jR04UpezTAsYxxwAJow03wbeHua4uLLC4cSieyKFaiYicvnfgbc3C1OeKs3zl X-Gm-Message-State: AOJu0Yx0a371Ca8AwEyCIgIGo907WGxqCy2wngBxZu4CWmQPIl6jNn2A 1bArGN8QWB7ALHQok/e7NBYuag9QpkvhXaQsU4gxEDU/bGxZnAwGNF/98B5v+sR6p19By2A/xoQ u6BsIBl/vcmhixy0ds+bARqNADCzLqEQlKUrQ5A== X-Received: by 2002:a25:814d:0:b0:dcf:a52d:6134 with SMTP id j13-20020a25814d000000b00dcfa52d6134mr13225878ybm.26.1709735924948; Wed, 06 Mar 2024 06:38:44 -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: Linus Walleij Date: Wed, 6 Mar 2024 15:38:33 +0100 Message-ID: Subject: Re: [PATCH] mmc: part_switch: fixes switch on gp3 partition To: "Jorge Ramirez-Ortiz, Foundries" Cc: Jens Wiklander , Tomas Winkler , Dominique Martinet , Ulf Hansson , 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, 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_RP= MB > target_part now could be indicating a GP instead of an RPMB leading to fa= ilures. > > 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. Yours, Linus Walleij