From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 7A75D43802D; Mon, 17 Aug 2026 14:46:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786978014; cv=none; b=uNG7S9HwmH34bpRVuZuecb0SEZb4NXz4B6Z6Ij9vbWYTmOxlE7FrQnwpQnNCOomRAvjJNuo0O9DkBwTUlTkHZkrYZNC2pLZJBCC07VDsiRIlAyYbx3vpSfvf2YJECHazltZwstzB4z3RmnJMu+7zJeL6SLVDC50+bQCN7rdtCmg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786978014; c=relaxed/simple; bh=zF2M+qZhSROUVWyVPoKBfUnjLLSzujwtXOpvDnTa2WU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TndFyh1naQ+aKGVJiaMGtgQqgp3mBEJR0vtIEZkKJQ0lL3fQ9eWd9YYu+kAVAEMWD/Iizp3uQ55DnLSBALWi6jM4/n31a8634PG7TnGNoC1pSu30H7FvVJtpwlakM39g4SeJEzotZSiKGR9cL/mPZ674yzsQVLnLJqk/uS4t5FI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GEZ+MeAg; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="GEZ+MeAg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6F281F000E9; Mon, 17 Aug 2026 14:46:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786978013; bh=2kA5lv+p8LrmoS+tNljHUJc2wvCh/x3ebKRMYDYN1Cs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GEZ+MeAg9+PMZ0oqCzcT8fWLHf1XFp7JeSLvPLsanVnAa9GIWAa0D2G+Bf5SVb5Sq IvQEXeCAg3IapZB6B0F/pkZAuv2bTO8FV6gCJjcbXnxh7d3p0brVzCyqiRptzgRwUq vCrUHrsQ49U6dWxrtWWRjtWEmJZMx7XKtBgvjSYA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mikhail Kshevetskiy , Miquel Raynal , Frieder Schrempf , Sasha Levin Subject: [PATCH 6.12 070/181] mtd: spinand: fix direct mapping creation sizes Date: Mon, 17 Aug 2026 15:32:44 +0200 Message-ID: <20260817132538.196145296@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260817132535.394764707@linuxfoundation.org> References: <20260817132535.394764707@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: Mikhail Kshevetskiy [ Upstream commit e4a0cf9f1d90e6888e5373da3314f761024f6c97 ] Continuous mode is only supported for data reads, thus writing requires only single flash page mapping. Cc: stable@vger.kernel.org Signed-off-by: Mikhail Kshevetskiy Signed-off-by: Miquel Raynal Signed-off-by: Frieder Schrempf Signed-off-by: Sasha Levin --- drivers/mtd/nand/spi/core.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index 48ac009cbaad2..a480243385e2e 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -1036,18 +1036,13 @@ static int spinand_create_dirmap(struct spinand_device *spinand, unsigned int plane) { struct nand_device *nand = spinand_to_nand(spinand); - struct spi_mem_dirmap_info info = { - .length = nanddev_page_size(nand) + - nanddev_per_page_oobsize(nand), - }; + struct spi_mem_dirmap_info info = { 0 }; struct spi_mem_dirmap_desc *desc; - if (spinand->cont_read_possible) - info.length = nanddev_eraseblock_size(nand); - /* The plane number is passed in MSB just above the column address */ info.offset = plane << fls(nand->memorg.pagesize); + info.length = nanddev_page_size(nand) + nanddev_per_page_oobsize(nand); info.op_tmpl = *spinand->op_templates.update_cache; desc = devm_spi_mem_dirmap_create(&spinand->spimem->spi->dev, spinand->spimem, &info); @@ -1056,6 +1051,8 @@ static int spinand_create_dirmap(struct spinand_device *spinand, spinand->dirmaps[plane].wdesc = desc; + if (spinand->cont_read_possible) + info.length = nanddev_eraseblock_size(nand); info.op_tmpl = *spinand->op_templates.read_cache; desc = devm_spi_mem_dirmap_create(&spinand->spimem->spi->dev, spinand->spimem, &info); @@ -1071,6 +1068,7 @@ static int spinand_create_dirmap(struct spinand_device *spinand, return 0; } + info.length = nanddev_page_size(nand) + nanddev_per_page_oobsize(nand); info.op_tmpl = *spinand->op_templates.update_cache; info.op_tmpl.data.ecc = true; desc = devm_spi_mem_dirmap_create(&spinand->spimem->spi->dev, @@ -1080,6 +1078,8 @@ static int spinand_create_dirmap(struct spinand_device *spinand, spinand->dirmaps[plane].wdesc_ecc = desc; + if (spinand->cont_read_possible) + info.length = nanddev_eraseblock_size(nand); info.op_tmpl = *spinand->op_templates.read_cache; info.op_tmpl.data.ecc = true; desc = devm_spi_mem_dirmap_create(&spinand->spimem->spi->dev, -- 2.53.0