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 84C0F3BB5A; Fri, 17 Oct 2025 15:21:47 +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=1760714507; cv=none; b=fTuYPaE+F+91C/KtWa5gvGu+HPOMG7yNFzl+W8yVOya2xlTN+CSIhVSRL5Y3vUWfLSLoYEp5/E/AAjwEV1kCESfZzWHyiGrFFbB2Pvlssfsi6IEsy8lTyBBAEd46hM6Kbj2nH1N8u7xGg2jvNhC/l4dJOxekdfooNHI8UJvHqME= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760714507; c=relaxed/simple; bh=6m16LFR3Icu5YkTJaUKqzEg+RHG9Hp7VfcyRp/t8OZE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MqQAhM2R9hKkIumKYmVCNoXlsb9Narui476zA85MMwqJqMkceCBGtCdZXS0qzH9lzMtM3PYF801oYdCDvveHu0Jv7onC9BhaswZ4aVqCLupnsSECjK2qb2byMPaYVcQZFK08T9vkvYQ5Xdil4V8fIIV+KwS7k3eMUcQt/tutm5k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=szm/LXnN; 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="szm/LXnN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08F6DC4CEE7; Fri, 17 Oct 2025 15:21:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1760714507; bh=6m16LFR3Icu5YkTJaUKqzEg+RHG9Hp7VfcyRp/t8OZE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=szm/LXnN7sj12rX1ddOVnlhP0SCqrOv3Z1i+sWUqbLAxtwGyGljofS70Jtwtz3o8y goqMFS6fc+qmyN1t4M8aJduNUxsuCyH2cr+72RXHEPA3B+Tot5Z5BZDzwRYfpFes4m lgsA58quySjvBsqEgnEPOrZzdGjyakJk+XDjJhVA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Linus Walleij , Miquel Raynal Subject: [PATCH 6.12 168/277] mtd: rawnand: fsmc: Default to autodetect buswidth Date: Fri, 17 Oct 2025 16:52:55 +0200 Message-ID: <20251017145153.263599998@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251017145147.138822285@linuxfoundation.org> References: <20251017145147.138822285@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-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_property_read_bool(np, "nand-skip-bbtscan"))