From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.fris.de (mail.fris.de [116.203.77.234]) (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 A69B244C657; Tue, 11 Aug 2026 16:22:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=116.203.77.234 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786465380; cv=none; b=K0bnJgrMyWqNghXT1MXO/vm4yUBSiASHGPGJiNpxu5Zk6LCNXhY/ZHjKGvYznhmaDdPoDOXwF6y4t2yKXWRq9bQ0pcjooMosTq252AgIa7p06nxTNMQBqat9JI5nUPor9y33FHlL1hQZdlddh6Wj3r6uGLEwNZr3t1L7hshMzCM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786465380; c=relaxed/simple; bh=BfZqAzvxhZmc0IKOFPXFz0YHHCiMhHvyiJmAZ4TsNng=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AHzUjyaWYma/hDjsMrguZdnAFVTPjdFHWB3svBaPX8/XJTwZY7cJPP28US9BBOgTlMcnVDhGOzU51mTkLPZjVhatQrX14Pfny9jLD3UWcgvlCPx9lBcZJOAmuYPDh3hKoI4ZTk82O6EUA9Nmn7r8Cr4uHYdiWRX3HyUESb/Gwlc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fris.de; spf=pass smtp.mailfrom=fris.de; dkim=pass (2048-bit key) header.d=fris.de header.i=@fris.de header.b=1WHHUG6x; arc=none smtp.client-ip=116.203.77.234 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fris.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fris.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fris.de header.i=@fris.de header.b="1WHHUG6x" From: Frieder Schrempf DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fris.de; s=mail; t=1786464835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RIpDx1Ttmz3Npv9FiPzjlhwVqmLLeI+zGyViDkfASDU=; b=1WHHUG6x5waiMagWbnmIgclFpEYeWoo5RmcPmN4ZUdBc2bMsqLbeZPT+WV1WNUHTDPrh+C 5RTYHYLuDJdv0/rk8mLiHlnFM14fFKgNMo2CG1dNgvyJjuCmFlo0HivnsbcHm3VkJkqRbi SZajrWk9XMNZ7ODIuHyarUmpxtXiHaZI/AfxZMfsm2KQxYYUAlAwn9mZx5EoZ59ilIax1a hR6DRxZzXQVLuAt1QjKVze9TZhSxsyO4Ao4yNcansxHnHH/jaYYdOYHf9J6LGD1Ak6Il8T 6KU1daTof2nPNeUuItBa8F4qybdFyvJbgpcgF0hSDcfjr//cKm0nPxKrX76uCw== To: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Mikhail Kshevetskiy , stable@vger.kernel.org, Frieder Schrempf , David LaPorte , Gabor Juhos , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH 6.12.y 1/3] mtd: spinand: fix direct mapping creation sizes Date: Tue, 11 Aug 2026 18:13:36 +0200 Message-ID: <20260811161342.533280-2-frieder@fris.de> In-Reply-To: <20260811161342.533280-1-frieder@fris.de> References: <20260811161342.533280-1-frieder@fris.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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.55.0