From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 6EE374CA286 for ; Thu, 23 Jul 2026 13:41:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784814083; cv=none; b=sTqotYjuPfJ1J4GDMX66jSFhwLlLFaPs3h0eU18zVUlP2vzvzEqaIPjTrRhLO4fqpzD6PcCbu9hpIfR3n5rKdSwWs4HCnMQUP3Eaf+Dhn1SJFu1mgOgppNUEM6y4qZpEykD/otE1egmmedi4S+SJozODRH8Mw03Gx5Xjd3QDTxg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784814083; c=relaxed/simple; bh=6Hz6Ib7becZ9NbcVgVjfycKGK/IUtNojfGwQSPs54cs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=absM5gIjtW9NkyAZUOonL655czJiGJpPASX0/BJ1higaP/+ue4zqcasQcenW2Rg4BguXzm7N1dEexAESl85FSfqL7NZhX/FvNcOfK8daYTK4C5JyjtxOqZx+pOodMt7EoOgfvbSPCgi01JeAMYRe5qgELF+kEzrj+eq7GmmkKSw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Oan5aCAz; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Oan5aCAz" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id B9C624E40EBE; Thu, 23 Jul 2026 13:41:10 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 8ED96602B8; Thu, 23 Jul 2026 13:41:10 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C68F511C10E96; Thu, 23 Jul 2026 15:41:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1784814069; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=XWe+Pt54+26aQCE30XaKKDodsWuXQQjhkt3Geccg33s=; b=Oan5aCAzlTDX987vYi/UkPlQpdAHJQimS4Kk1sKKU82Dg6o474a9qGN/ab/2qDP9VQ/rs4 bXumAwdjL4V8sSGHRqsS6s2GOW6lDWnQ8j+uKPr0E0481iS8GczCvvnQd2fNGi/hKCDsp8 Dvo9q8w+0exCvFi9J3+7pdZQR1CW9Vp1mJTVIIf3fcZiom7UixAB94D2jB1jzK7TK8T+SM hQSqJe4dBEC7A5ZbjFkfT08MymdV1NlS92WwwMVE+3BQVgg58xjBUvuG+WZT7NCaN3Zehq Mt5stZE9d+f8oWNJ0ji3+UVvAwFm2ndxSB+J5axLcz0AumXGnWSVJCREAMQ/8Q== From: Bastien Curutchet Date: Thu, 23 Jul 2026 15:41:03 +0200 Subject: [PATCH 3/4] rawnand: base: Export nand_read_page_swecc Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260723-mix-ecc-v1-3-7361c3baeb07@bootlin.com> References: <20260723-mix-ecc-v1-0-7361c3baeb07@bootlin.com> In-Reply-To: <20260723-mix-ecc-v1-0-7361c3baeb07@bootlin.com> To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Michal Simek Cc: Thomas Petazzoni , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Bastien Curutchet X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 nand_read_page_swecc() isn't exported while it could be used from the drivers for the mixed case where ECC writes are done by the hardware and ECC reads are done by software. Export nand_read_page_swecc() to make it usable by drivers. Signed-off-by: Bastien Curutchet --- drivers/mtd/nand/raw/nand_base.c | 5 +++-- drivers/mtd/nand/raw/pl35x-nand-controller.c | 1 + include/linux/mtd/rawnand.h | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index c04c3e74f661..950c079aa27b 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -2941,8 +2941,8 @@ static int nand_read_page_raw_syndrome(struct nand_chip *chip, uint8_t *buf, * @oob_required: caller requires OOB data read to chip->oob_poi * @page: page number to read */ -static int nand_read_page_swecc(struct nand_chip *chip, uint8_t *buf, - int oob_required, int page) +int nand_read_page_swecc(struct nand_chip *chip, uint8_t *buf, + int oob_required, int page) { struct mtd_info *mtd = nand_to_mtd(chip); int i, eccsize = chip->ecc.size, ret; @@ -2979,6 +2979,7 @@ static int nand_read_page_swecc(struct nand_chip *chip, uint8_t *buf, } return max_bitflips; } +EXPORT_SYMBOL_GPL(nand_read_page_swecc); /** * nand_read_subpage - [REPLACEABLE] ECC based sub-page read function diff --git a/drivers/mtd/nand/raw/pl35x-nand-controller.c b/drivers/mtd/nand/raw/pl35x-nand-controller.c index bd89aaadd1b2..d61eba938311 100644 --- a/drivers/mtd/nand/raw/pl35x-nand-controller.c +++ b/drivers/mtd/nand/raw/pl35x-nand-controller.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index 3658315752bf..5539e96b2cac 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h @@ -1578,6 +1578,8 @@ int nand_write_data_op(struct nand_chip *chip, const void *buf, unsigned int len, bool force_8bit); int nand_read_page_hwecc_oob_first(struct nand_chip *chip, uint8_t *buf, int oob_required, int page); +int nand_read_page_swecc(struct nand_chip *chip, uint8_t *buf, + int oob_required, int page); /* Scan and identify a NAND device */ int nand_scan_with_ids(struct nand_chip *chip, unsigned int max_chips, -- 2.55.0