Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2785559lqp; Mon, 25 Mar 2024 09:09:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWvL8OJjgAy7v6ib3QsDoYmjG0PPDqeNAwzU9DMEAprkJMWtS+cRtE4cKygGlYF9/5A1WhtqfyMm+jkbQsXXPhTo4wv1AT6nL05voRJCQ== X-Google-Smtp-Source: AGHT+IE3YY4kZn0tB2ks29uh8BpFqoJ0LuCT5EVxpBEOA0mowIsSOb36Ba0hxu25KiPoPNHkri3s X-Received: by 2002:a05:6a00:3d0a:b0:6ea:ab60:b11d with SMTP id lo10-20020a056a003d0a00b006eaab60b11dmr3602666pfb.29.1711382959222; Mon, 25 Mar 2024 09:09:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711382959; cv=pass; d=google.com; s=arc-20160816; b=lKMc23uCY7505TzrTFsrOCaoKBb74cFU3oKPWJnnTql9IrZh3WqXAqgCJvKHGFZDfr BUMH10yk2GX2F9x8/b/X1qeih33oHXkNp64zXrbsJWCUurfg+74pIyZygYbNBVZEEunP jnHC/MEO5EyipXT4UNEjG78WDr8xg7loI3ILuvBs3B+I2HdmVpIqhieLnAy7c35Z8XYy i/lzwjCTnxKfLRR8ofIAlhCbfe30oL9pzbl6BFoRt4pkfjCYCo01nIOoLAgS0fO6zKWt /CTUiF1koVX40vUTTOvRejtO1elVT0ojzIk672V0ayDH10TPFktOWk57IQcNqXXc/t45 tGhg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:subject:cc:to:from :date:message-id:dkim-signature; bh=WHRv7g3CiPKX519Ky5IELZFKVKXY3LsLEia5o8nsqvI=; fh=WrUKrDXPaRhMSDNNNOXfayAa8BNygOKdBuWplkbnvmw=; b=G6IekGVty4nu2OESLDAPEkdAsIm4bxoMQi4YaOU2KRRIwujuwb9Dzckt623b+4yScG 6CZXxX0AtEjj9KS1MqzSNOQawsRp54U+cRlv7vDoC8G2CGTkD3BOMC71zN/0NpeOKiC8 f55tgAPcuribcfHrNkHbQJzjNih3BbhO+GcWONmabeYzEJqP+Jxq518oiuEbl9j0Gf5n EZEp9gEiaS5XBn5eglsTJeTF9UYqx1s4egcU92pffou5AewrvQ/n8uQn/iUp5TlcptP6 c+Tv083aNnOzibRYi7hbJof0nsXGZ0pTISMf0W8urrcXxclw8mxtxsj73NFuJTLmRpXB RHrw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hEnbhZZG; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-116810-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116810-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id a8-20020aa780c8000000b006ea8c975ef0si5256046pfn.398.2024.03.25.09.09.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 09:09:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116810-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hEnbhZZG; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-116810-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116810-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id A7EE0B281B9 for ; Mon, 25 Mar 2024 14:19:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04D5D18B5F1; Mon, 25 Mar 2024 10:47:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hEnbhZZG" 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 D7CF912FF99; Mon, 25 Mar 2024 10:19:26 +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=1711361968; cv=none; b=Gj2eFCYOKzj2UB7k8xAadwBce4sK4A0WfXJARlwjfo+kqckBfCQL/APJt0HnJEpZahoegjXLeaXEt76tARhBqX9hm4ALKrlilQFxviDXC37ljlRcn6IhVU9zu5BEZv2j16FSux7U4Ph10QybCX21XdZqi0xygmbseOep4rRgNm0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711361968; c=relaxed/simple; bh=BUGNqjoLfsxQHYk/8rWceZNAXz2Yeg4TAAXA9qHpQmQ=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rNmrqBn7ViUJ3lgx3DFLEyQoX5PWGLplQ2Oo83bxXfryYIeAqP1x/wV7NYJChR3OpV1WVh7cSpPEgQRosBL2mRIsPaW8++3Gwl+w8RYppXMjpW9odUskUawcZdpQ72gHBFgpLCxxb0BGHQOoyiYaAsM2gCBS1P7vBZ96A+t5p7s= 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=hEnbhZZG; 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 Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2d46c2e8dd7so52809541fa.1; Mon, 25 Mar 2024 03:19:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711361965; x=1711966765; 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=WHRv7g3CiPKX519Ky5IELZFKVKXY3LsLEia5o8nsqvI=; b=hEnbhZZGMKZPX/A+j2pQpkHdK/Jp6wn6Je77NtPIqFCqSNN7dQFDFvMLYifefYfGUx Yb5xxMT8lSrJzhHPidCDDtc8dm7NhLcas2pz+lV8+hsOtkaAKxy2WUVbw6FkTqJFU2CE 1yRqLCaRhlvow1IwoU6ObDRYOD74h2y1K4XzLBmW7V18doBAWxsGoZy44HqdDiy8e8zi /4+cQjuoqL7uFK3gXItgI2cycm66zM4ZxRB8a8CjlqvLZ708PG8yDvVkijxBlWmaqK1N 1ILEYn3SxUBXFKPnqRviF3yD028uiS9zvf7UUMSwaS/t4aQQoNpGJY0XARFqIQB2fN7+ ctDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711361965; x=1711966765; 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=WHRv7g3CiPKX519Ky5IELZFKVKXY3LsLEia5o8nsqvI=; b=Qomr3OMSYcOLME1biEmzYlRuPp6mo54/QlDaEwSI2CdnMAZr8q5liQSDslndTxED2i zEGONIHMb4EyITc6+RSRg7AVm5nKCNrTi9qG4BzsAYryuMKBJQMc2t+FOoe8ebhcL95M dEzB2VGGpKnhGh1SCfpfsJry8Hym0Wz51vP9vxM04r/kiIwx29RQ2Wbe8ZZx2Vmn+Lt1 xTbK9osh+jNkx8lU2X1kJbZd+j4fVsR0TAABQcydYgqpNLLiAiCQLc1h4dfPdR9Pm6Jo 358O8lr8NZNEVHPONM1wTT3O6UPoD7jvNGXqNURV+6J76R9BY1eC04/p3Lxp1pFimn7p sT7Q== X-Forwarded-Encrypted: i=1; AJvYcCXMDreAwXFb8sR0PKaO3joN5qmH+Zyl/rwPV7qvt4vUpjM7KISPijVT+O/YXjVobrY+snCcq8LcmGq5Kwq8v04Wtq16lBGzQYzMYH7dMIXp3FN0JZAhG0YxHGXXM8/1+Uf1s7bB X-Gm-Message-State: AOJu0YxxyzHiU836lsPCQO5X8LttqWXyeRozlKdvXEmkbMTMFkdGHY8A YLfLWpr7kxLvpifnfS2PlzDT+v1vVUxDvt5n2VGRwgiOwi+LxP3l X-Received: by 2002:a2e:b794:0:b0:2d4:6814:7c98 with SMTP id n20-20020a2eb794000000b002d468147c98mr4026696ljo.43.1711361964560; Mon, 25 Mar 2024 03:19:24 -0700 (PDT) Received: from Ansuel-XPS. (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.gmail.com with ESMTPSA id gw8-20020a05600c850800b004146dd6bfe2sm7935583wmb.47.2024.03.25.03.19.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 03:19:24 -0700 (PDT) Message-ID: <66014fac.050a0220.92b6d.5b41@mx.google.com> X-Google-Original-Message-ID: Date: Mon, 25 Mar 2024 11:19:20 +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> <65fc0d2b.050a0220.102ac.24f6@mx.google.com> <20240321141935.1b9f6e71@xps-13> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240321141935.1b9f6e71@xps-13> On Thu, Mar 21, 2024 at 02:19:35PM +0100, Miquel Raynal wrote: > 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, > > > > > > 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? > > > > You can go ahead, but I'll only queue it after -rc1 is out. > Doing it right now. -- Ansuel