From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D8493C54E68 for ; Thu, 21 Mar 2024 13:19:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fsAOfGzxtBbeO/cZigDh2sbGATJhKfiiM7zwdKNiRrQ=; b=eGAgdl0A/NvPbu ieuLsjYTMuHbQ6rDZxNKoRPdrl2iMsULluUW4OX+agYU6Xa9bWHRQkQnNV5OY4FSImuKfwHyNb0HS 56J6OPC/mpqGRYhc7qFLUNOvhCuX18eFI6hAnSmGQ1szORr7LypInJI+0mypV86xrQSIXzDw82y4O 0rpDnUU23afXa2jfH6fbcWqb3xfVaHyleLZiYLP5asX5/hFtwBwhAkPBwzxhEic/V/ZxdHk7XF7fL d04bPS6Z2WVHGSZz2+E+CvUq/yaA6VzXfoKt4++pF+di4YJshTLEodyNOnAAlQgd2OeEb7qrcpyWo t7wjlNldhX8FzqW9Gm1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnIKf-000000036Hj-03IP; Thu, 21 Mar 2024 13:19:45 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnIKb-000000036Gi-1C8w for linux-mtd@lists.infradead.org; Thu, 21 Mar 2024 13:19:43 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 4D9BBE0009; Thu, 21 Mar 2024 13:19:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1711027178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Wux1s3DDeZBv3SAkVVcioL1ZXc29Eq5S/w6BTrDFtLI=; b=MBoOE/TdPuhXe16Grsc3TzmXJ9oCsqgYShJpE3uG/edE5lbdMpxbLojckikoY/d/WP8DNa SrBSEsgml8tVUa3xDMX8uPIAnW1UifW3PflqNxQonUdqeiCBlRE2ngn2SkewJ1BGLu5KLH XNlVY14IOYZa7G0cwTECVqw99oilSgZPYGGTbMPKJ2Ay29sAWFRI07KWrGGGv965Q1CPN3 7qEOjzke+bqJXJex0ocr6QJlkhuR0gWH8a03utAsnnRydbcKQM4sMlxGmbPB0PzkND0DFr jD30VPH0Ds5O6DRf14T+HxHfj4xIqNPvwAau7MaaSJxZM8WCVdmos+5HbNP6Hw== Date: Thu, 21 Mar 2024 14:19:35 +0100 From: Miquel Raynal To: Christian Marangi Cc: Richard Weinberger , Vignesh Raghavendra , Srinivas Kandagatla , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Martin Blumenstingl , Claudiu Beznea , AngeloGioacchino Del Regno , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2] mtd: limit OTP NVMEM Cell parse to non Nand devices Message-ID: <20240321141935.1b9f6e71@xps-13> In-Reply-To: <65fc0d2b.050a0220.102ac.24f6@mx.google.com> References: <20240321095522.12755-1-ansuelsmth@gmail.com> <20240321113256.7e66ac0f@xps-13> <65fc0d2b.050a0220.102ac.24f6@mx.google.com> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-GND-Sasl: miquel.raynal@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240321_061941_756509_88A35ABE X-CRM114-Status: GOOD ( 24.68 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org SGksCgphbnN1ZWxzbXRoQGdtYWlsLmNvbSB3cm90ZSBvbiBUaHUsIDIxIE1hciAyMDI0IDExOjM0 OjE2ICswMTAwOgoKPiBPbiBUaHUsIE1hciAyMSwgMjAyNCBhdCAxMTozMjo1NkFNICswMTAwLCBN aXF1ZWwgUmF5bmFsIHdyb3RlOgo+ID4gSGkgQ2hyaXN0aWFuLAo+ID4gCj4gPiBhbnN1ZWxzbXRo QGdtYWlsLmNvbSB3cm90ZSBvbiBUaHUsIDIxIE1hciAyMDI0IDEwOjU1OjEzICswMTAwOgo+ID4g ICAKPiA+ID4gTVREIE9UUCBsb2dpYyBpcyB2ZXJ5IGZyYWdpbGUgYW5kIGNhbiBiZSBwcm9ibGVt YXRpYyB3aXRoIHNvbWUgc3BlY2lmaWMKPiA+ID4ga2luZCBvZiBkZXZpY2VzLgo+ID4gPiAKPiA+ ID4gTlZNRU0gYWNyb3NzIHRoZSB5ZWFycyBoYWQgdmFyaW91cyBpdGVyYXRpb24gb24gaG93IENl bGxzIGNvdWxkIGJlCj4gPiA+IGRlY2xhcmVkIGluIERUIGFuZCBNVEQgT1RQIHByb2JhYmx5IHdh cyBsZWZ0IGJlaGluZCBhb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Bvbmx5IHF1ZXVlIGl0IGFmdGVyIC1yYzEg aXMgb3V0LgoKVGhhbmtzLApNaXF1w6hsCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX18KTGludXggTVREIGRpc2N1c3Npb24gbWFpbGluZyBsaXN0 Cmh0dHA6Ly9saXN0cy5pbmZyYWRlYWQub3JnL21haWxtYW4vbGlzdGluZm8vbGludXgtbXRkLwo= From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 074DE83CC3; Thu, 21 Mar 2024 13:19:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.196 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711027188; cv=none; b=KCyuCOHKAoi7oalLsk4A2RaQ5dGoeVE8E3F5iOyDHdMFPA1RY5fWLSQfvSI9W/0u59+NwUXi4lb8VOSZU26uW7PnMvEsfZ9tkjbWQT/AQtZ/g8Nq9q5vgsoHiqa1VazjAs1sM9YfrCvYoahL25iJF2bN5uyi5lgHI5MGppJh/Q8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711027188; c=relaxed/simple; bh=TmHxMArZKamM08j0KP5mHNczauqyyC7V7vfbm9mgaxQ=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YmL8FjzZ5Uki4pv8lYRYZkMHssiFsZg1xPm1O5ARKcyqfhPhRXaDCps7pg8HY3YBx5fRfTnhttTV+bYGVLITAvVNyUtTq5hwY4YbRZPuqCK3b8uT1iOog2SrGhK1TckQyMntzbcdH43upH4MBjPmVtOF0SppSgm7imgPDBk10Ew= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=MBoOE/Td; arc=none smtp.client-ip=217.70.183.196 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="MBoOE/Td" Received: by mail.gandi.net (Postfix) with ESMTPSA id 4D9BBE0009; Thu, 21 Mar 2024 13:19:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1711027178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Wux1s3DDeZBv3SAkVVcioL1ZXc29Eq5S/w6BTrDFtLI=; b=MBoOE/TdPuhXe16Grsc3TzmXJ9oCsqgYShJpE3uG/edE5lbdMpxbLojckikoY/d/WP8DNa SrBSEsgml8tVUa3xDMX8uPIAnW1UifW3PflqNxQonUdqeiCBlRE2ngn2SkewJ1BGLu5KLH XNlVY14IOYZa7G0cwTECVqw99oilSgZPYGGTbMPKJ2Ay29sAWFRI07KWrGGGv965Q1CPN3 7qEOjzke+bqJXJex0ocr6QJlkhuR0gWH8a03utAsnnRydbcKQM4sMlxGmbPB0PzkND0DFr jD30VPH0Ds5O6DRf14T+HxHfj4xIqNPvwAau7MaaSJxZM8WCVdmos+5HbNP6Hw== Date: Thu, 21 Mar 2024 14:19:35 +0100 From: Miquel Raynal To: Christian Marangi Cc: Richard Weinberger , Vignesh Raghavendra , Srinivas Kandagatla , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Martin Blumenstingl , Claudiu Beznea , AngeloGioacchino Del Regno , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2] mtd: limit OTP NVMEM Cell parse to non Nand devices Message-ID: <20240321141935.1b9f6e71@xps-13> In-Reply-To: <65fc0d2b.050a0220.102ac.24f6@mx.google.com> References: <20240321095522.12755-1-ansuelsmth@gmail.com> <20240321113256.7e66ac0f@xps-13> <65fc0d2b.050a0220.102ac.24f6@mx.google.com> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com Hi, ansuelsmth@gmail.com wrote on Thu, 21 Mar 2024 11:34:16 +0100: > On Thu, Mar 21, 2024 at 11:32:56AM +0100, Miquel Raynal wrote: > > Hi Christian, > >=20 > > ansuelsmth@gmail.com wrote on Thu, 21 Mar 2024 10:55:13 +0100: > > =20 > > > MTD OTP logic is very fragile and can be problematic with some specif= ic > > > kind of devices. > > >=20 > > > NVMEM across the years had various iteration on how Cells could be > > > declared in DT and MTD OTP probably was left behind and > > > add_legacy_fixed_of_cells was enabled without thinking of the consequ= ences. > > >=20 > > > That option enables NVMEM to scan the provided of_node and treat each > > > child as a NVMEM Cell, this was to support legacy NVMEM implementation > > > and don't cause regression. > > >=20 > > > This is problematic if we have devices like Nand where the OTP is > > > triggered by setting a special mode in the flash. In this context real > > > partitions declared in the Nand node are registered as OTP Cells and > > > this cause probe fail with -EINVAL error. > > >=20 > > > This was never notice due to the fact that till now, no Nand supported > > > the OTP feature. With commit e87161321a40 ("mtd: rawnand: macronix: O= TP > > > access for MX30LFxG18AC") this changed and coincidentally this Nand is > > > used on an FritzBox 7530 supported on OpenWrt. > > >=20 > > > Alternative and more robust way to declare OTP Cells are already > > > prossible by using the fixed-layout node or by declaring a child node > > > with the compatible set to "otp-user" or "otp-factory". > > >=20 > > > To fix this and limit any regression with other MTD that makes use of > > > declaring OTP as direct child of the dev node, disable > > > add_legacy_fixed_of_cells if we have a node called nand since it's the > > > standard property name to identify Nand devices attached to a Nand > > > Controller. =20 > >=20 > > You forgot to update the commit log :-) > > =20 >=20 > Ugh... sorry. Ok to resend or I need to wait 24h similar to the rules on > net-next? >=20 You can go ahead, but I'll only queue it after -rc1 is out. Thanks, Miqu=C3=A8l