From nobody Wed Apr 8 04:41:32 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 712503C9ECF; Tue, 10 Mar 2026 19:07:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773169660; cv=none; b=COWgjDB77LBf/i6skQeB3I5+rqy6YcbZlA8xsTH8J/lOYV3rvVCpDxFrlhK6C3kwzn7ELmPSkx/Ii5Hd+V00T0GTX/hZ25hE3ch0aE4gg/nRR7mIEk+Llk/0QUO9eLyJLtYLXob/X31HqXi9Zsi06OwukrahPKsedWFyJLVljUU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773169660; c=relaxed/simple; bh=8IrGoRMwtgnhv48TdfwYQOdUsxHDpClxitdKrDFCMOc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Q8twx/1nIreVGui2Z0plTDZNPNfIdPAMC8gz4d/fEl7NHph7EFlbPJTlG8BKZO3RCj7ayGf3M7LjASEFoYEaTAwetEumWKGgmuSj2HD+jJvtFSY+rgdML6lqwlTReAuNE5bI3lUhEoFq74eJXxvH5bGRkg+yns3Kja+DW/hlcSM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=secGepUA; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="secGepUA" Received: by smtp.kernel.org (Postfix) with ESMTPS id 348F3C19425; Tue, 10 Mar 2026 19:07:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773169660; bh=8IrGoRMwtgnhv48TdfwYQOdUsxHDpClxitdKrDFCMOc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=secGepUA67AOJDs5Ab46ZOq9y6zfskEMSvmOWP2VoG/l6UvtI9vfvRHlps5qOgMum 1bi/HF0Wjr2s2zJ4z4uwa5t/QHt7tu0XIsJpTRnMUTHs+Ez/yuOjR9Pjb1xiuaP29V YNCPzRH9gNX700Wo/PDfy5uknFut8yAPVEi83fxK9lDsYru55Hjii4Uvi3B+yBmvbc 2E8+p3g1mOJ5uKuAdNNJLVm08jauLe7FPdyZ44HosePyHRZQrLGiQXEXZpT1KMqyGy 3qXMKk9UeBendIayJzjkkP8C1j9J4p/HZle2LYB4P9t2EA1UtiG/wnMWHVZSvtdaTg 5PN8sfLdlUvig== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26516FD4F16; Tue, 10 Mar 2026 19:07:40 +0000 (UTC) From: Frank Li via B4 Relay Date: Tue, 10 Mar 2026 15:07:37 -0400 Subject: [PATCH 1/3] mtd: rawnand: gpmi: set chip->of_node to nand@0 child node if present 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 Message-Id: <20260310-gpmi_nand-v1-1-6a665151aa75@nxp.com> References: <20260310-gpmi_nand-v1-0-6a665151aa75@nxp.com> In-Reply-To: <20260310-gpmi_nand-v1-0-6a665151aa75@nxp.com> To: Han Xu , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: imx@lists.linux.dev, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Max Krummenacher , Francesco Dolcini , Frank Li X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1773169659; l=1960; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=a9JwL4V+z0V/CdLgwtBGNvbdwXlOFNtmIrkNA8GkZ4Q=; b=1hqUkmrfgaunI5WwUJZTxhGdYB1iquyAtHc/hWcUoyZ+nhMTFPedqecwiuKNw/Vi/kyU+RAOS WgeCfL6SUijBZuehbGpcjgygs1j1Altum22n53OH5VMsyVIe5TsjQsn X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-Endpoint-Received: by B4 Relay for Frank.Li@nxp.com/20240130 with auth_id=121 X-Original-From: Frank Li Reply-To: Frank.Li@nxp.com From: Frank Li The nand-controller.yaml binding requires a child node (e.g. nand@0) under the NAND controller. However, the driver currently assigns the controller's of_node directly to the NAND chip. Search for the first child node with the "nand" prefix and assign it to chip->of_node. This filters out properties such as "partition" that may be placed under the controller node in some older DTS files. Fall back to using the controller's of_node if no suitable child node is found to maintain backward compatibility. This issue went unnoticed because the default behavior works for most NAND chips. Signed-off-by: Frank Li --- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/= raw/gpmi-nand/gpmi-nand.c index 51f595fbc834e7f711331629bb9f7a1482749b62..c1f766cb225aad3502d73ef54a9= aedcd50054b93 100644 --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c @@ -5,6 +5,7 @@ * Copyright (C) 2010-2015 Freescale Semiconductor, Inc. * Copyright (C) 2008 Embedded Alley Solutions, Inc. */ +#include #include #include #include @@ -2688,7 +2689,15 @@ static int gpmi_nand_init(struct gpmi_nand_data *thi= s) =20 /* init the nand_chip{}, we don't support a 16-bit NAND Flash bus. */ nand_set_controller_data(chip, this); - nand_set_flash_node(chip, this->pdev->dev.of_node); + + struct device_node *np __free(device_node) =3D + of_get_next_child_with_prefix(this->pdev->dev.of_node, NULL, "nand"); + + if (np) + nand_set_flash_node(chip, np); + else + nand_set_flash_node(chip, this->pdev->dev.of_node); + chip->legacy.block_markbad =3D gpmi_block_markbad; chip->badblock_pattern =3D &gpmi_bbt_descr; chip->options |=3D NAND_NO_SUBPAGE_WRITE; --=20 2.43.0 From nobody Wed Apr 8 04:41:32 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 711373C457B; Tue, 10 Mar 2026 19:07:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773169660; cv=none; b=FIUYszHRnaNGBg2QUinmFx9ThBb7aBlxNJ+8VlL/oIgjAYK+/xPlgV3ON/r54+v8RlSybByzQwBUVRfck6BA467FYQr/HTs+7/e55yk5LtV3MrUGwydyVxiUQrONtiivjsWUhDg7UXBrkPMdgo+k3GixqeIwc9rG2k3q7ViePrQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773169660; c=relaxed/simple; bh=swVryWkevogj/HEKHBlOlgACQaUp6HCFWqxYjXi6JDs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UTPHPjCIhQeZdzPwqaKb6NsbQqsLO6aSByUvbRbU0myS6NfivRPkK4ByQrSxGynmxqaW3Qgq2cU4XknfyiwyBlyJPyVy/yR6mist9kZ8Uay0h1QdYC+XtFMWhZSiE4KTce8WwwOlfiLmaSK6f6wsZcbxMtWqSIp8xCKXJNBJqzk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jcU1Uy//; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jcU1Uy//" Received: by smtp.kernel.org (Postfix) with ESMTPS id 413B7C2BCB0; Tue, 10 Mar 2026 19:07:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773169660; bh=swVryWkevogj/HEKHBlOlgACQaUp6HCFWqxYjXi6JDs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=jcU1Uy//ddwtFoGfkSqMKM3rSMm0VfAqCsOqSAw5CXoPST5dHvOE5b/KtRcGIIG3Q u25vR6jmZ9CaTXhhFhHmhhlhu/SF7L2r1AAVaQ1/35HgY/84VIXiRd6n7dpL8taaY3 iaUTflDT0XXh/8fhOdITOK+sp6UHOEuhMKPWzkVJacrpejC4F3ek9YW9bZRFBlvyQx Jbgm+xoKmotyhwHVxg6YqrLYtLzcQkUDAkP9fImguw8KebJ9BoIXs6Fphq59otv8Ei euAfiNtRpfdTF1bVw0BfMC7DyWhTgEhXLnSAnuyUqbKE5fTm/TN5/JOygnPtS5fsph bbqJOgYEVwaDg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 370B0FD4F23; Tue, 10 Mar 2026 19:07:40 +0000 (UTC) From: Frank Li via B4 Relay Date: Tue, 10 Mar 2026 15:07:38 -0400 Subject: [PATCH 2/3] mtd: rawnand: mxc: set chip->of_node to nand@0 child node if present 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 Message-Id: <20260310-gpmi_nand-v1-2-6a665151aa75@nxp.com> References: <20260310-gpmi_nand-v1-0-6a665151aa75@nxp.com> In-Reply-To: <20260310-gpmi_nand-v1-0-6a665151aa75@nxp.com> To: Han Xu , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: imx@lists.linux.dev, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Max Krummenacher , Francesco Dolcini , Frank Li X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1773169659; l=1828; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=bOj/g+UY+4s889neQOAMnpSX/wgGz20f6Io/aYMX6LU=; b=sh93q7HWhsnaCKLZJ2Qq9mCg1igrjdWIT0UcPJC1loYjHO6n/x55Zvvbg0+k8sraeMaRzgx+c K502GrP2CkaCs5pORsfOhPhKkCdy+uzAcki6HaIUqBErDcRCWwAzRZ7 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-Endpoint-Received: by B4 Relay for Frank.Li@nxp.com/20240130 with auth_id=121 X-Original-From: Frank Li Reply-To: Frank.Li@nxp.com From: Frank Li The nand-controller.yaml binding requires a child node (e.g. nand@0) under the NAND controller. However, the driver currently assigns the controller's of_node directly to the NAND chip. Search for the first child node with the "nand" prefix and assign it to chip->of_node. This filters out properties such as "partition" that may be placed under the controller node in some older DTS files. Fall back to using the controller's of_node if no suitable child node is found to maintain backward compatibility. This issue went unnoticed because the default behavior works for most NAND chips. Signed-off-by: Frank Li --- Build test only because can't find such old boards, logic is the same as gpmi nand flash controller. --- drivers/mtd/nand/raw/mxc_nand.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/mxc_nand.c b/drivers/mtd/nand/raw/mxc_nan= d.c index 8c56b685bf91a462a707ff868c601358375aafce..4d8b92e7e67257535142b3a0deb= 5b179e1a17bad 100644 --- a/drivers/mtd/nand/raw/mxc_nand.c +++ b/drivers/mtd/nand/raw/mxc_nand.c @@ -4,6 +4,7 @@ * Copyright 2008 Sascha Hauer, kernel@pengutronix.de */ =20 +#include #include #include #include @@ -1714,7 +1715,14 @@ static int mxcnd_probe(struct platform_device *pdev) this->legacy.chip_delay =3D 5; =20 nand_set_controller_data(this, host); - nand_set_flash_node(this, pdev->dev.of_node); + + struct device_node *np __free(device_node) =3D + of_get_next_child_with_prefix(pdev->dev.of_node, NULL, "nand"); + + if (np) + nand_set_flash_node(this, np); + else + nand_set_flash_node(this, pdev->dev.of_node); =20 host->clk =3D devm_clk_get(&pdev->dev, NULL); if (IS_ERR(host->clk)) --=20 2.43.0 From nobody Wed Apr 8 04:41:32 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 725EB3CA481; Tue, 10 Mar 2026 19:07:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773169660; cv=none; b=WK5i4wRcQQl1dLFFJfXNAAaxilli3DBDWDnpHtf+/8d7PRNOMqAsRYQDjPBv7R0zTuojX+L58Awx+pAnuPJZR7Xm4dSyw67Y0u3jvYiHSmOASpsNVZs2kVg5gyAyLvSiGlGPUCym72uLqP/IAn433DnP7HJxMEchURxqXO2Q2ZY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773169660; c=relaxed/simple; bh=n7rqnTqHcTU+Z9n7OFWpBoqNm3TxgqssESQFtWSZ8q4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WmjJCGt6yZ92xI+9AhDMUMLSzG5sFZm6SaYFtUr7oeOEqNywyynPLzMztG9eUPbRMFtXl4wETjHJKRJef5gT0kssu7PYVr/xG74pQzBC6GV62Ha5fcsqA6A1COPqZBz9ErrSj4ad07WCajfKA6/kmEyWzIa50y7sUPzigwM/XYU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PwU48YKO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PwU48YKO" Received: by smtp.kernel.org (Postfix) with ESMTPS id 5444BC2BC87; Tue, 10 Mar 2026 19:07:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773169660; bh=n7rqnTqHcTU+Z9n7OFWpBoqNm3TxgqssESQFtWSZ8q4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=PwU48YKOp3Pg1VKaSlojDgFVscW/acfj1UOugHunURkvBTNeTZGlAQavnfEZ3BxGL ab+af7bJ57R0/f0C8Zo3MsMrueSPjXHwcLlCJVNST8Cf6wyd1Cg9KC5GkegILl4jtp LbW3k2Qdwa20tL3rXO6UAWUClgdSPM1plr6UIALfB3X1du1ztEEg3YX28UWXbXHhrQ Wzj48s1GxYFuF5H7CXibdegRDXKSw4uGa1ds2PmsNQxbIZM0JDcxwVhN5rwWd4Ymv4 J5v6XUk/ahWm7dBwEKouWj2gu+rjOZzxD0ZIVz6VcqwmlxsOudPPbkuxzYQjl7IzzI X9s+UamEU3ERw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AADEFD4F2A; Tue, 10 Mar 2026 19:07:40 +0000 (UTC) From: Frank Li via B4 Relay Date: Tue, 10 Mar 2026 15:07:39 -0400 Subject: [PATCH 3/3] mtd: rawnand: ifc: set chip->of_node to nand@0 child node if present 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 Message-Id: <20260310-gpmi_nand-v1-3-6a665151aa75@nxp.com> References: <20260310-gpmi_nand-v1-0-6a665151aa75@nxp.com> In-Reply-To: <20260310-gpmi_nand-v1-0-6a665151aa75@nxp.com> To: Han Xu , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: imx@lists.linux.dev, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Max Krummenacher , Francesco Dolcini , Frank Li X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1773169659; l=1853; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=FIv1RVBcoqzfpJswOf6h6v3Eh4uNH7jSmUjj7+1dAxc=; b=SgBvQQvJLJMzDfPgP5eRXTcA1aGwmtKBs8AGRLQPnTELvBnzgmMNZBvBP0vi5EUThIcaVGZek n1VMQPg0srWBQv/1McFma4ch70Qryj0Ns5QOXu+kXWD3c7ZCtFX7TnT X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-Endpoint-Received: by B4 Relay for Frank.Li@nxp.com/20240130 with auth_id=121 X-Original-From: Frank Li Reply-To: Frank.Li@nxp.com From: Frank Li The nand-controller.yaml binding requires a child node (e.g. nand@0) under the NAND controller. However, the driver currently assigns the controller's of_node directly to the NAND chip. Search for the first child node with the "nand" prefix and assign it to chip->of_node. This filters out properties such as "partition" that may be placed under the controller node in some older DTS files. Fall back to using the controller's of_node if no suitable child node is found to maintain backward compatibility. This issue went unnoticed because the default behavior works for most NAND chips. Signed-off-by: Frank Li --- build test only because can't find hardware to test it. but basic logic is the same as gpmi. --- drivers/mtd/nand/raw/fsl_ifc_nand.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/fsl_ifc_nand.c b/drivers/mtd/nand/raw/fsl= _ifc_nand.c index dd88b22a91bd13f1619c3061866dec22eceb55f5..fad0334f759dd5f81113e10ec04= e8bbaf490bc83 100644 --- a/drivers/mtd/nand/raw/fsl_ifc_nand.c +++ b/drivers/mtd/nand/raw/fsl_ifc_nand.c @@ -7,6 +7,7 @@ * Author: Dipen Dudhat */ =20 +#include #include #include #include @@ -863,7 +864,14 @@ static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv) =20 /* Fill in fsl_ifc_mtd structure */ mtd->dev.parent =3D priv->dev; - nand_set_flash_node(chip, priv->dev->of_node); + + struct device_node *np __free(device_node) =3D + of_get_next_child_with_prefix(priv->dev->of_node, NULL, "nand"); + + if (np) + nand_set_flash_node(chip, np); + else + nand_set_flash_node(chip, priv->dev->of_node); =20 /* fill in nand_chip structure */ /* set up function call table */ --=20 2.43.0