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 2DDA0C54E68 for ; Thu, 21 Mar 2024 10:34:32 +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:In-Reply-To:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0/RLtOveg7CbjIpj9YR41tZHupuJ6O+FFCrm7bdqf4Q=; b=2Sm4akzGa9td0B +87tpSxHyLHjxW4RikQwObLvPTg5KQrQ/YAyQrXVSdHq6gWaP8QzI2DbR8OiJRmJvW0ZeaGn/YrAy 1AHHRDy0igye9qgAvx1oDyoHe7wbAgtYNooKKF8w3SktxLe3Milb313wRtYpb/Jqxf0agiUwwGJR+ Wy3Y/LMCGcZkJwXxWjCfLQmgrkFXDVJjOEfVU5Ik+LjUoX6dJBp+95hMUJHg+s9U2sZCpF9LXK2dd gyutl2jW4c9NBpcjeVH+UDSMm0fIw6eF+E2lQVX5O10+xB8U4atQO/fz3Uw5BSXv9nnrmCx4TmIFd ooQJD4rEXpYpwa9Tyn6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnFkg-00000002eal-1z6t; Thu, 21 Mar 2024 10:34:26 +0000 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnFkc-00000002eZp-3wcQ for linux-mtd@lists.infradead.org; Thu, 21 Mar 2024 10:34:24 +0000 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2d46c2e8dd7so10077631fa.1 for ; Thu, 21 Mar 2024 03:34:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711017260; x=1711622060; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=NHG19S00nW0KrNYH2WSzHwN8S/SHdrN0ELw9d3lEmaU=; b=id5yRz7ZgHrLRxuvGueAMFsp3YmxRMDKtI37/RoGi0XYpOnPMC1nPdB0gD/elkEi1c T/HLF39FW8P3EXzR3r7m4X55OJE3+4RW7eL83BaeSVgEOlNA6tBZiv6hLDYCzV2+A/pT KYX+fqU82hJpuFIeRTH7QN1zPaTtcUMuZLObYdalZJqXe9ZXjMncYIzU6Q8uwuscRQdE R90evlKnkIlV4KWgrtE9Q/aYvyc7z0njaUqF6ZD696/+hh+kpCzirdrL1yw7/A/4wr68 /7p2oA29xzsM62iw9bNQy1c4rt5B2cnrGIcWqqVxC5eQArQbxMjxn0PlLHM6D56urHAp CtYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711017260; x=1711622060; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=NHG19S00nW0KrNYH2WSzHwN8S/SHdrN0ELw9d3lEmaU=; b=Dkw4huKGLDNUYwwo0thmzyX6COu+3MxRL7Bce+De3q0Q6HXmx3kBVvIAx9GEGQ11zg 3Eje2o1SEFcRY+mAzWgnR1NDEqpZbigpS/ev8ep+Fy9mjSMEBVKzl1aE4IIa/R6FoMrm KxZ+JDp6LzN+nc3PqPcP6zuC8CW8XfQEn72403I8awg+5lOyg58PVlg2deIKOQ/rFBKv TnUaYyFf1IwtIjbbt+RkTPV6IJIrE/cGzyJorFbn23OdKL/J+xXv2H9TLUP3/7VhxSqb Q5dPYUQL2Pxq5OChxjoaqDD5m3gcES7ID+QfN9Z6di6/yRDbc/pNdgy/nq2xxdq9R/Nm mYzw== X-Forwarded-Encrypted: i=1; AJvYcCXzIGdwbxYGoWRxV9tWwiKwO+da+sziEJ91HLVcn85UTattebAwyntFS6FS6ArrctpYnBSswexEjM19mMR64BunWF3nhFR5YoqP3+lh0w== X-Gm-Message-State: AOJu0YzBXw6gy487Lw2qYc/KOHHW18SeCyEQRRtSBUcKv304kmCMsBXm z2e0+OzHD4CDZ0Rww2eowtjb/ZoGHVpHpLbXf8rijiUlI9sGkqDG X-Google-Smtp-Source: AGHT+IHZsmHDVKcW8S4Muplgc0gm08EDd7GKFo3DN0TZd0vtgrg7sUO9gJqCCt6ZDD/IbDH6dh92eQ== X-Received: by 2002:a2e:a4cf:0:b0:2d2:c83c:ffd7 with SMTP id p15-20020a2ea4cf000000b002d2c83cffd7mr2823962ljm.42.1711017259315; Thu, 21 Mar 2024 03:34:19 -0700 (PDT) Received: from Ansuel-XPS. (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.gmail.com with ESMTPSA id p5-20020a05600c468500b004132ae838absm5174369wmo.43.2024.03.21.03.34.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 03:34:19 -0700 (PDT) Message-ID: <65fc0d2b.050a0220.102ac.24f6@mx.google.com> X-Google-Original-Message-ID: Date: Thu, 21 Mar 2024 11:34:16 +0100 From: Christian Marangi To: Miquel Raynal 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 References: <20240321095522.12755-1-ansuelsmth@gmail.com> <20240321113256.7e66ac0f@xps-13> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240321113256.7e66ac0f@xps-13> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240321_033423_144962_7F65CE0C X-CRM114-Status: GOOD ( 23.36 ) 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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On Thu, Mar 21, 2024 at 11:32:56AM +0100, Miquel Raynal wrote: > Hi Christian, > > ansuelsmth@gmail.com wrote on Thu, 21 Mar 2024 10:55:13 +0100: > > > MTD OTP logic is very fragile and can be problematic with some specific > > kind of devices. > > > > 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 consequences. > > > > 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. > > > > 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. > > > > This was never notice due to the fact that till now, no Nand supported > > the OTP feature. With commit e87161321a40 ("mtd: rawnand: macronix: OTP > > access for MX30LFxG18AC") this changed and coincidentally this Nand is > > used on an FritzBox 7530 supported on OpenWrt. > > > > 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". > > > > 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. > > You forgot to update the commit log :-) > Ugh... sorry. Ok to resend or I need to wait 24h similar to the rules on net-next? -- Ansuel ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (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 7D81F1CA9A; Thu, 21 Mar 2024 10:34:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711017263; cv=none; b=kRb43vHB3NLDo+iudA5peS8cX+B81lussEJ5KQdxphjYU3NK6qzOmRb/+okcxymscszjv5goHSPr7yu3YSftT+c834qpWtnysSjbsLnjPBEAZrLFZKib7VJ+lguo+VeEMsf1LZEp2LXoOt0VIC7QJ0qC8/q/L/uuxXgz/eXPHrM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711017263; c=relaxed/simple; bh=VOi+PZbV9b+AJm91llBcxlZV4MlF+wjNnLpe9He3k4U=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ugJHGfZftI/Z1VY6rN1EXB5gSddvWrJue5dJ4KCcmrFTVxzPisJUDv9tREJP1k6B66f08E+qgezKPnEH6QOjTJywUQUGYPCtskZIs/iLiqNnbnYXjcs9Xj4diaWjdJweahlU+X1dZg8Vce6xzV3+2UIDRgEXOIbr4PwL1UdPscU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Pf8Sgnky; arc=none smtp.client-ip=209.85.208.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Pf8Sgnky" Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2d21cdbc85bso13144381fa.2; Thu, 21 Mar 2024 03:34:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711017260; x=1711622060; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=NHG19S00nW0KrNYH2WSzHwN8S/SHdrN0ELw9d3lEmaU=; b=Pf8Sgnky+RpTU8uNqAULmUoqPc7racMy/dxoWq5+OSwoMSk1yaMBYlYxEQlDIzljk5 ZQ9Vcf+hbOrrnF0CrodzG9f2RWisa5afqChmXHh8ppYv4Vy4FBiUoNBjebzhjOiD/pZO Qm983ZnShaV2B8060spbw9Yax+UOGlnBZqk/6WleHeywgE/ibZsan1nDclne/mqTWiHW 9FiSjKq/nDTBmkW3VUgsV4eDAAapltEupWPJlVSIdT0g71tsX7gszX6ikr4yCOAbvyqh 8awws85lijgG7aUjoxCYPrNW9D2DU/rkM9jO5OTmgPUpoW2ZVh+HVi5Ba1Yz9oD2xhG9 Piag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711017260; x=1711622060; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=NHG19S00nW0KrNYH2WSzHwN8S/SHdrN0ELw9d3lEmaU=; b=p814uV7CrTvNc2FPepjipWgQSyABeY2hWnwQF8f8kfD/iWGKN22Ry6+8+xk2kUsQ9y oxwR+P3QDLyqZd5dNEhTsMbvkD71Sz4O19fQX7qHRP8xr0ZZRWMn84YtthSu+LLV1p8R ly67tYkkKK+QG2JQrSmUGfQUXQuHuAqFOsnrng5Kgx9crEDAeuUT5Cvzi4VW0vt9LPD5 NOEhJoJyYTAsENk3skEJR0vXqAWyF6gWP0nvlFX7O6rV4J/MzizQN7YeKAyCvNfM91Wr o0hmE0ZEtYSSZzXBPtw+faZ8QQGbNoy7RxhgIIm2Jh56+xMc3E/H32wKJMGQHanl7dbx RXbg== X-Forwarded-Encrypted: i=1; AJvYcCVp9/+YAxf0amusY4qCul/HuF1FcL9iaXIjsuuS9Luvlt6ZFsUjDPqNzUPMJR6vEJZKWXAXSVeFv7W8C0vEFlJ37vvB3uGkadQSqlQWTRm27ITkm6Eiew4ZaIOGssategELbEAF X-Gm-Message-State: AOJu0Yz+f4zihsrsjYHrbI4a5G5salWcVCMPQMhqX9cKZeLulj1l7mJt RhgNIW3AkbnbxhosyaFdQLPkvzRBCzoSX+rHwNmsTNHx3QookbdN X-Google-Smtp-Source: AGHT+IHZsmHDVKcW8S4Muplgc0gm08EDd7GKFo3DN0TZd0vtgrg7sUO9gJqCCt6ZDD/IbDH6dh92eQ== X-Received: by 2002:a2e:a4cf:0:b0:2d2:c83c:ffd7 with SMTP id p15-20020a2ea4cf000000b002d2c83cffd7mr2823962ljm.42.1711017259315; Thu, 21 Mar 2024 03:34:19 -0700 (PDT) Received: from Ansuel-XPS. (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.gmail.com with ESMTPSA id p5-20020a05600c468500b004132ae838absm5174369wmo.43.2024.03.21.03.34.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 03:34:19 -0700 (PDT) Message-ID: <65fc0d2b.050a0220.102ac.24f6@mx.google.com> X-Google-Original-Message-ID: Date: Thu, 21 Mar 2024 11:34:16 +0100 From: Christian Marangi To: Miquel Raynal 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 References: <20240321095522.12755-1-ansuelsmth@gmail.com> <20240321113256.7e66ac0f@xps-13> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240321113256.7e66ac0f@xps-13> On Thu, Mar 21, 2024 at 11:32:56AM +0100, Miquel Raynal wrote: > Hi Christian, > > ansuelsmth@gmail.com wrote on Thu, 21 Mar 2024 10:55:13 +0100: > > > MTD OTP logic is very fragile and can be problematic with some specific > > kind of devices. > > > > 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 consequences. > > > > 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. > > > > 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. > > > > This was never notice due to the fact that till now, no Nand supported > > the OTP feature. With commit e87161321a40 ("mtd: rawnand: macronix: OTP > > access for MX30LFxG18AC") this changed and coincidentally this Nand is > > used on an FritzBox 7530 supported on OpenWrt. > > > > 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". > > > > 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. > > You forgot to update the commit log :-) > Ugh... sorry. Ok to resend or I need to wait 24h similar to the rules on net-next? -- Ansuel