From mboxrd@z Thu Jan 1 00:00:00 1970 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 8F5C1330B2D; Fri, 17 Oct 2025 15:54:23 +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=1760716463; cv=none; b=h3ahGxd0sQ02QNpGqE3JtxySs4G4aVwOwn8UilHf/EiRBWq8Xv24SsHsj6mXd2v1ZtRNUN+1Bv2OEBYGudwCk/Y8NG9SHMyPrZLtvJUhsltLTtRSXIpxy2Fh2l2VkPUkIRDImsTgF8sE2360lspNyd3pXegDIsW8zN1JBqGoRSk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760716463; c=relaxed/simple; bh=cG70Y07hC+t2HoRt4dz1tKwKtblgJxhzn1YejkL5dd8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BGKkRT29T8yY2JOhIlI101q+GMvtdCvHX7rhAFUU7DW4Rla2gnSOFC5+iq3/SJuETbqnbdz1u98MJXybSi1N3XUEt88AlYcWNcLM1oyICZt7s6gtAZrdotYYqyPxCkPSnnNZF+t8igMgG+/T4po38PacrZGriitJDP69O5aEaMk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cMjh3U+t; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="cMjh3U+t" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C4D5C4CEE7; Fri, 17 Oct 2025 15:54:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1760716463; bh=cG70Y07hC+t2HoRt4dz1tKwKtblgJxhzn1YejkL5dd8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cMjh3U+tJQtWGE099aWcK/GzPs8PPOg5wB5Vg8buvHbxUfX2pIDwre4yVFpYvEWwd nTjJoao2rrwnkhr9Wk/mkzq8OlwZOD1Gw6jox/p8IOsljJRAhBvHBRe2hzbBs76T7g po+GArptfdqKiGn2dy9yz27Pn8t56y/cdrvaBhPc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Linus Walleij , Miquel Raynal Subject: [PATCH 5.15 199/276] mtd: rawnand: fsmc: Default to autodetect buswidth Date: Fri, 17 Oct 2025 16:54:52 +0200 Message-ID: <20251017145149.735402175@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251017145142.382145055@linuxfoundation.org> References: <20251017145142.382145055@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Linus Walleij commit b8df622cf7f6808c85764e681847150ed6d85f3d upstream. If you don't specify buswidth 2 (16 bits) in the device tree, FSMC doesn't even probe anymore: fsmc-nand 10100000.flash: FSMC device partno 090, manufacturer 80, revision 00, config 00 nand: device found, Manufacturer ID: 0x20, Chip ID: 0xb1 nand: ST Micro 10100000.flash nand: bus width 8 instead of 16 bits nand: No NAND device found fsmc-nand 10100000.flash: probe with driver fsmc-nand failed with error -22 With this patch to use autodetection unless buswidth is specified, the device is properly detected again: fsmc-nand 10100000.flash: FSMC device partno 090, manufacturer 80, revision 00, config 00 nand: device found, Manufacturer ID: 0x20, Chip ID: 0xb1 nand: ST Micro NAND 128MiB 1,8V 16-bit nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 fsmc-nand 10100000.flash: Using 1-bit HW ECC scheme Scanning device for bad blocks I don't know where or how this happened, I think some change in the nand core. Cc: stable@vger.kernel.org Signed-off-by: Linus Walleij Signed-off-by: Miquel Raynal Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/raw/fsmc_nand.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/mtd/nand/raw/fsmc_nand.c +++ b/drivers/mtd/nand/raw/fsmc_nand.c @@ -876,10 +876,14 @@ static int fsmc_nand_probe_config_dt(str if (!of_property_read_u32(np, "bank-width", &val)) { if (val == 2) { nand->options |= NAND_BUSWIDTH_16; - } else if (val != 1) { + } else if (val == 1) { + nand->options |= NAND_BUSWIDTH_AUTO; + } else { dev_err(&pdev->dev, "invalid bank-width %u\n", val); return -EINVAL; } + } else { + nand->options |= NAND_BUSWIDTH_AUTO; } if (of_get_property(np, "nand-skip-bbtscan", NULL))