Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C3BC7C5CFCF for ; Tue, 11 Aug 2026 16:14:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IBa5pvalG6aiHm1qNbDnJQ3eqvCrEsB3ldWcxjRMO54=; b=hs1MfaE14upUrU dxhTd6fNNZoptxsfn3F+K2odjL/7LsLuqbmNQtjArCA+fgkjaEGvyDvep2Y8CcUwVz8ZNCgjH4LGL lQE95sWqCCXK1fKv25DGHO+adfsSBiyNK035yTSbm+W9x167wWDa9Tb3Yi4kvcv6kGHvCr2qn+HX/ dv2BEIYWCy2UFJ4w7S6+1AxeRK7eQ+e/Xo+8aRWu+pa0P/bqw3Q+iqh5S/vqnPrZ+jx7S+ET6BAFP 3rrrCA4k/ia0150HoDiGfv91Eu9dG0R7l9zwNoMxxL+wSjkAhR59CAKN3dEl06exZKTI0DysxFEsc BwYkY3srT1PpLr+25CKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wtp76-0000000ESNF-1zdQ; Tue, 11 Aug 2026 16:14:04 +0000 Received: from mail.fris.de ([116.203.77.234]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wtp72-0000000ESIx-0tJA for linux-mtd@lists.infradead.org; Tue, 11 Aug 2026 16:14:02 +0000 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260811_091400_402982_1121D2A0 X-CRM114-Status: UNSURE ( 9.47 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org 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 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/