Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp916686lqs; Wed, 6 Mar 2024 00:04:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUPqvtmlg8R1RqQ0lrwGvjvgVO4fNfG+AdIzxbTd1CaH7Rm3B4kYGgExzBLF68GtvwNTT6nMhFEptj7gDfI/SdzUPEaaQpWLr4wne7SpA== X-Google-Smtp-Source: AGHT+IGznkPmkSrNO76R6alfyGrlJIzXrl29pK5N4lTVUqhcQ5CAmkjqPEQXLGkUCXvPJ3jpnvos X-Received: by 2002:a05:6359:4c2a:b0:17b:85ff:8fe6 with SMTP id kj42-20020a0563594c2a00b0017b85ff8fe6mr4770060rwc.25.1709712260857; Wed, 06 Mar 2024 00:04:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709712260; cv=pass; d=google.com; s=arc-20160816; b=ArzWegcT+Tatnt1hsEiOu2f2OPUCwlU9ykal40HO1JAc+O0h5XWC3XQZcNcevXQYRA K7PAI/CA1Hn53AQfJjNS2cSTI94F++pVlxKU+qtVBZ/F59Fkz9L2Mg5jWpKhH4PC5tBn eUqmFPM1+sXAEA68CL/EWimsCusrRNkdNYp5uKKQPiBDPSBR7NIpDA2tRgqSgdOtMkU2 TwRExe+KLd9Mtq94RzNb92God7mw4Jz4gKMGRGnVs8pmZmNPQuLc8GP5QqHLOOBc3Z7h TmZOSwMrMRO2G6Tv2GqfSmM7et/of6mSrUzY5L0mGgDSPg+MzQBJCko5POgfkmJAmBil JhnQ== 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=pNCmhehLL35vXsU0wn+FY52cOQ04rVxtOxTd7hBwrYk=; fh=Chf7+/kvACkAHr2MLDA2y2eoP6VWAmD6UuFPt4PuRTo=; b=WksA01tyiM14ec4rEKkAOJOUqTG2UObFRPOM6oyEWpK2pWz/92xoV0UfT9PtKZoIlq 1nhN0qtt4ZQwKBDsv9nMwmlHEXzqC+ChTd/DEMgA0CZQHs8k/7c3b8q8L5FFEgOMCGCC ITMu++89sQ5p8gubkLNHod9bSvsvuB7plkz4B8FKX2OrNIgiw0T2rVfZwIKKyAdNZMod sbyLlhiw0HwdwLfAkOlrGa8nuCUU9zPvDSS8y5191GuJsyNwU1Yffylbp/rDKYfuRAc1 oEcHFqtLjjAz7B3zx2I20CuVD6UPyjnk0jFVs8QeuGIZoJ9x/Y9YVJ1PZL8mRk/q3R4o uvOA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E7rujQUV; 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-93460-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93460-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id jv4-20020a05621429e400b0069017283bfesi13895029qvb.275.2024.03.06.00.04.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 00:04:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93460-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E7rujQUV; 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-93460-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93460-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9243D1C22A6D for ; Wed, 6 Mar 2024 08:04:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E20C5D727; Wed, 6 Mar 2024 08:04:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="E7rujQUV" Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com [209.85.219.172]) (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 ED9D05C8F2 for ; Wed, 6 Mar 2024 08:03:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709712239; cv=none; b=soCAdLDD4II0tm1ExMcjNQikBtPFBv/0oVz5G7l45+TcnAe7o7HAAocVHv37eoAiqBhRao7IhPMC3oAi9MYKdiqu5fah4ZWPi2JwZbcMqI/ql845V+gUitjf12DpZHuayrDyvf7voE9ZZ0WmD7XeGJENoHZyGkPpi+sBFtJCZ7Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709712239; c=relaxed/simple; bh=jodEnASZyLUgeoSk8Z4M/Y1uTQ6Xpxy5XIGxKW5nvb4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=k3wMc6rmlvlFuTmF/RTii2/0VCU6J6/qCQfc8MARL0GWhuq7GH+YoAs0RPSdz9X1Dnhuc8PrQWT2VPUvU2rU6ah4mUM/5AwONSPqlaerqwqcGuYTzw8bF9jS5MGi/0U3MRcGgKZ3pwgDmkitSv+2GhEZqH+DnxFPVVBn7lAY5fI= 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=E7rujQUV; arc=none smtp.client-ip=209.85.219.172 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-f172.google.com with SMTP id 3f1490d57ef6-d9b9adaf291so5990372276.1 for ; Wed, 06 Mar 2024 00:03:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709712237; x=1710317037; 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=pNCmhehLL35vXsU0wn+FY52cOQ04rVxtOxTd7hBwrYk=; b=E7rujQUVYeoWx/m8hA9hkx0GDzR3BTMLukF0Jetc4sxIjRUFr6uPVE06y91p4nHvTy MqWqVXe+IUth9hJkCY1x1pYmXZIWtHH+74c7y3vhSnPaSMqS+7lYUmWF4rkd/P6wgQ6b xTFexi7tpMcBqZpQyzn4p8ALXP/NWcpiXE9smPbzk7id/o2A97ZJv7jUjowBmxlhaJTr dAU0nDl4js4tgC2r3suA3rxW8+M+HhRzj+Sp4sPEPegi1yk8IqlUyF4IxWnfcm/MKK2H t4fOQegPJPTLNJ+E8EUUj2utc00LiRk0R6YtP6FIY0rY50QcsVy0s8VIo20hvpPPXtcI Xdwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709712237; x=1710317037; 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=pNCmhehLL35vXsU0wn+FY52cOQ04rVxtOxTd7hBwrYk=; b=bPPF4o79pYJzW7JXOY9JN8jSeEMhOw7j4h63nIdTEnylZuLEhMAy79VwJ4GzamEmff PQclisjMxObtKMXPd84jswNwtA+2zpcRvXlDoKC1Wfb9IUR34XBNdb/n8JTzD2JCGKCm D6T/lVGU4VnTZf7OaerbLL8kuTRTjZ/bsLjHjESS+/UHBWv/mtgTgJEnhuqB4M6yDk68 EYvYVvrXHNbSSOXm268O28s33oxWTTbCcPeMXwo4kziHMqoiP+5VsOfdna7VRLOcP/ME vVhehWR0HzSn74v0gJDZhlvv1C6uQrLslkKM7lb0JrgnZOWXUV4zr+BG47Dfp7ZCqWOT qp2g== X-Forwarded-Encrypted: i=1; AJvYcCX75rItJBxm8NGYicQ7AfwuIMeOc0YoxJvhoagrtcvJdV1BL5+SGlIFGr1df5RgCKMpQXb+kAbqHpVCBPy1I+bFglJko6uh4Nuyfkhj X-Gm-Message-State: AOJu0YyWj87cpdjUgiTHgvh/ZuNmrRgGSMGvU1i4ttOqlztLUO/WTK6M xnBB4dExwYNDJABJQmKdRv+EpaiKlNy8gwGhPpQHY+fVScebEo4kRLJFkFo4+27JKegEN9MqLtd TA1DNFSucrOAPb4r+GW8asM1iWBKVeY9G0aRVLw== X-Received: by 2002:a25:aa8b:0:b0:dcf:b5b7:c72 with SMTP id t11-20020a25aa8b000000b00dcfb5b70c72mr11184681ybi.0.1709712236941; Wed, 06 Mar 2024 00:03:56 -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: <20240306-mmc-partswitch-v1-1-bf116985d950@codewreck.org> From: Linus Walleij Date: Wed, 6 Mar 2024 09:03:45 +0100 Message-ID: Subject: Re: [PATCH] mmc: part_switch: fixes switch on gp3 partition To: Dominique Martinet Cc: Ulf Hansson , Jorge Ramirez-Ortiz , 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 2:45=E2=80=AFAM Dominique Martinet wrote: > From: Dominique Martinet > > Commit e7794c14fd73 ("mmc: rpmb: fixes pause retune on all RPMB > partitions.") added a mask check for 'part_type', but the mask used was > wrong leading to the code intended for rpmb also being executed for GP3. > > On some MMCs (but not all) this would make gp3 partition inaccessible: > armadillo:~# head -c 1 < /dev/mmcblk2gp3 > head: standard input: I/O error > armadillo:~# dmesg -c > [ 422.976583] mmc2: running CQE recovery > [ 423.058182] mmc2: running CQE recovery > [ 423.137607] mmc2: running CQE recovery > [ 423.137802] blk_update_request: I/O error, dev mmcblk2gp3, sector 0 op= 0x0:(READ) flags 0x80700 phys_seg 4 prio class 0 > [ 423.237125] mmc2: running CQE recovery > [ 423.318206] mmc2: running CQE recovery > [ 423.397680] mmc2: running CQE recovery > [ 423.397837] blk_update_request: I/O error, dev mmcblk2gp3, sector 0 op= 0x0:(READ) flags 0x0 phys_seg 1 prio class 0 > [ 423.408287] Buffer I/O error on dev mmcblk2gp3, logical block 0, async= page read > > the part_type values of interest here are defined as follow: > main 0 > boot0 1 > boot1 2 > rpmb 3 > gp0 4 > gp1 5 > gp2 6 > gp3 7 > > so mask with EXT_CSD_PART_CONFIG_ACC_MASK (7) to correctly identify rpmb > > Fixes: e7794c14fd73 ("mmc: rpmb: fixes pause retune on all RPMB partition= s.") > Cc: stable@vger.kernel.org > Cc: Jorge Ramirez-Ortiz > Signed-off-by: Dominique Martinet The patch: Reviewed-by: Linus Walleij > A couple of notes: > - this doesn't fail on all eMMCs, I can still access gp3 on some models > but it seems to fail reliably with micron's "G1M15L" > - I've encountered this on the 5.10 backport (in 5.10.208), so that'll > need to be backported everywhere the fix was taken... Which device is this? I have never seen an eMMC using the GP:s in my life. Or did you create the GP manually? Yours, Linus Walleij