Received: by 10.223.185.116 with SMTP id b49csp4411892wrg; Tue, 6 Mar 2018 15:34:32 -0800 (PST) X-Google-Smtp-Source: AG47ELvEQVyfJBU2O3ec8mZMFSXtYZaVOCtxmrFgr8wjXLsRa7SNCIvNBk51L3Ajg4FDI3ctevg1 X-Received: by 10.98.133.193 with SMTP id m62mr20486103pfk.74.1520379272486; Tue, 06 Mar 2018 15:34:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520379272; cv=none; d=google.com; s=arc-20160816; b=POZLL+Qw/pZ3W2mespoobjJEpqNKiM1XbRBqcgPqctB++SaiL3K6O6zB+B4lsNSxf3 OYYTmeIhCC5Br0Wk81Y1A1LC4Sge+WFNQuKOSGCVDo/8Prv35l+q1QtUDI8aEbLIZq+e KJhkhC/gBwU/p6BOHjqHj5oPkAwT49am/I/Uww+neuinCnArSnpwFOUS8GkGr8WJH5WJ SnM6XHB+OYgwUXY62s9+gw5zEBwPKruEUvX8rJ2ITqlYm+CpsZrEVzfaQGHuxsgK2S5i 2EDI2B1EmBqPuoO4XpcEpOCkDelLuVpAX4aZXL6z5e2PR67ccLfOmRFqt7hocFPp0EEH m1Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=bRriMp6n2K80uqw9Rbb57R/p+k1Hgqkb7mzJWq9aq08=; b=N80gnf/tGAjOxEq7FHYXmihwvvzavkT3o0/5BAZr7gzw1WbcudhwHx/yG55h/xTwKK n+kgbh6DQjhSPnTNiM3tw3j5in6SI1sz43pQqobwRrvfnpETpC/lofO9udQ3vEUES4wd ShbrSf2ljLFa8YWCQXiZ+23zpWo56706lLDWzFnpo8bS7HEm2MV0f0jvWXawUhUGtTys nxI0QR0n9hHvUYOuT1K5htIoknVrTK+YVkrxY8rQU7BAiDVhtLSRcMbcJg3vE3CGrmOY HOoLOR724hCfjNFLhcT/0jswoGs3HYhFkYWOAiRPUzbIds9p7P1Wi5rultg4jclyYquG cBnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 203si6340153pfz.110.2018.03.06.15.34.18; Tue, 06 Mar 2018 15:34:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754192AbeCFXSJ (ORCPT + 99 others); Tue, 6 Mar 2018 18:18:09 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:53651 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753971AbeCFXSH (ORCPT ); Tue, 6 Mar 2018 18:18:07 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id BC11280262; Wed, 7 Mar 2018 00:18:05 +0100 (CET) Date: Wed, 7 Mar 2018 00:18:05 +0100 From: Pavel Machek To: Richard Weinberger Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, cyrille.pitchen@wedev4u.fr, marek.vasut@gmail.com, boris.brezillon@free-electrons.com, computersforpeace@gmail.com, dwmw2@infradead.org, dedekind1@gmail.com, tharvey@gateworks.com, stable@vger.kernel.org Subject: Re: [PATCH] ubi: Reject MLC NAND Message-ID: <20180306231805.GA28183@amd> References: <20180303104554.5958-1-richard@nod.at> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HlL+5n6rz5pIUxbD" Content-Disposition: inline In-Reply-To: <20180303104554.5958-1-richard@nod.at> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat 2018-03-03 11:45:54, Richard Weinberger wrote: > While UBI and UBIFS seem to work at first sight with MLC NAND, you will > most likely lose all your data upon a power-cut or due to read/write > disturb. > In order to protect users from bad surprises, refuse to attach to MLC > NAND. >=20 > Cc: stable@vger.kernel.org That sounds like _really_ bad idea for stable. All it does is it removes support for hardware that somehow works. Now... Yes, handling flash is hard, MLC NAND is worst of the bunch. But... Read disturb is not unique to MLC, right? Happens to all the flashes, its just that MLC has tighter margins for error. Power-cut. UBIFS is just not power-cut safe, right? My notes say that power-cut during erase could result in flash that contains all 1s, but will start showing errors very quickly. Again, not MLC specific. Can be solved with battery... (And yes, there are some problems specific to MLC, where parts of page need to be written in specific order. Not sure how it affects ubifs. But it was not listed as a reason for the patch.) > Signed-off-by: Richard Weinberger > --- > drivers/mtd/ubi/build.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) >=20 > diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c > index e941395de3ae..753494e042d5 100644 > --- a/drivers/mtd/ubi/build.c > +++ b/drivers/mtd/ubi/build.c > @@ -854,6 +854,17 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi= _num, > return -EINVAL; > } > =20 > + /* > + * Both UBI and UBIFS have been designed for SLC NAND and NOR flashes. > + * MLC NAND is different and needs special care, otherwise UBI or UBIFS > + * will die soon and you will lose all your data. > + */ > + if (mtd->type =3D=3D MTD_MLCNANDFLASH) { > + pr_err("ubi: refuse attaching mtd%d - MLC NAND is not supported\n", > + mtd->index); > + return -EINVAL; > + } > + > if (ubi_num =3D=3D UBI_DEV_NUM_AUTO) { > /* Search for an empty slot in the @ubi_devices array */ > for (ubi_num =3D 0; ubi_num < UBI_MAX_DEVICES; ubi_num++) --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --HlL+5n6rz5pIUxbD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlqfIa0ACgkQMOfwapXb+vJ6ZQCgqFe1Pe55Q2kgHjXoMClPat83 iCAAn2HkaKl7ZEWEuffl0iDyWmSFI405 =OGEp -----END PGP SIGNATURE----- --HlL+5n6rz5pIUxbD--