Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp448051lqp; Thu, 21 Mar 2024 06:19:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXslPgJYUtpMQ5tI44QAFO32AapxsozYo9PMl8qGypI4qs+U7/Nbtivbz4a+nfTzm0xUxakv0pvKjJgw5Zl32qfY1k+/uELDdoAnKO1RQ== X-Google-Smtp-Source: AGHT+IGMfEhkCfZtjjMuTE+ehm41EjEcB4WftiU4lg18yMO/+tDrdeFBUjmLPNOMYxkZ64NTPFes X-Received: by 2002:a05:6402:5483:b0:565:ff64:33b0 with SMTP id fg3-20020a056402548300b00565ff6433b0mr7148705edb.22.1711027197375; Thu, 21 Mar 2024 06:19:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711027197; cv=pass; d=google.com; s=arc-20160816; b=bU6Eww4K2K3C7oLVcVYRS3rjGt4J296Fekv3BC93fw1INVUIQNSZfkHOnghatjEZIX ypOuHnFoVai4fZhm9xSYwkSSDRYhPG0deAQO0iwqW4jKKf5diN7Z6qdUZu++f6OTpJi2 Gfcxi/UrWJ6YRBkhd4zEHz0mHSacDAS3zgDcZWufG5SJHO9nlaybE4n9ZUGP3uBQr39j +5qS1OvdDFFru8ndq9+ULkvI8jtcW/OqXraTH8hffhOhglRhWFW6AKeNRNS0nx4/5qjh TLGn+3Hla+7436XGlwr/pJcg3Vi9nJxc/SwYVTrdfzg90x/Pgs1d+31LDe6MKHIkhtBW Tjdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=Wux1s3DDeZBv3SAkVVcioL1ZXc29Eq5S/w6BTrDFtLI=; fh=tjkzaMg80CphW23eGSxDP5qOG5iXW3tgmqwjcaBjzdY=; b=SR6JZ04EUxKnltBp98ixAsoANUqJr8lZmwqTAJoAZhbq3+kak2W3fPKe+M0h0Hunub ry77i3IPw9HNZGtA1NOGjMIk13ddJgQCsKK7FLU8DM+Xlm5TcGhZ9jvlZ+GSeK/McO9b Tx5WvKHTOrsF7Cv7JGxH1GDv0oPMr+KJL2TSYalIt67nJeD6qV6u/FEeMlSlqowf+SH/ dLKxXY1sfDwRo666xi9EC534xwsSYXqJhI2QBDSYO9eiX62+U8ok/gug7SWFneP0OXdf ecXd4j5+2sg7FStXlaG00IdTIXM/G6yruk0T6Yttty2mIzJIuYVknRtZb+dVEQJpW9Z0 xhKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="MBoOE/Td"; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-110089-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110089-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c14-20020a05640227ce00b005694e013fa2si4465491ede.636.2024.03.21.06.19.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 06:19:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110089-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=@bootlin.com header.s=gm1 header.b="MBoOE/Td"; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-110089-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110089-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com 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 1B64F1F2390F for ; Thu, 21 Mar 2024 13:19:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE1AB84A4A; Thu, 21 Mar 2024 13:19:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="MBoOE/Td" 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 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: linux-kernel@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