| Message ID | 20261105-submit-sunxi-nand-vendor-oob-layout-v1-v10-4-dca1f6ed29a8@gmail.com (mailing list archive) |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-sunxi+bounces-27262-sunxi=pue.re@lists.linux.dev>
X-Original-To: noreply@patchwork.local
Delivered-To: noreply@patchwork.local
Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mxe881.netcup.net (Postfix) with ESMTPS id CE7191C53B3
for <noreply@patchwork.local>; Thu, 5 Nov 2026 19:55:44 +0100 (CET)
Authentication-Results: mxe881;
dkim=pass header.d=gmail.com;
spf=pass (sender IP is 172.105.105.114)
smtp.mailfrom=linux-sunxi+bounces-27262-noreply=patchwork.local@lists.linux.dev
smtp.helo=tor.lore.kernel.org
Received-SPF: pass (mxe881: domain of lists.linux.dev designates
172.105.105.114 as permitted sender) client-ip=172.105.105.114;
envelope-from=linux-sunxi+bounces-27262-noreply=patchwork.local@lists.linux.dev;
helo=tor.lore.kernel.org;
Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org
[100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id 96C6E27A01
for <noreply@patchwork.local>; Thu, 5 Nov 2026 18:55:37 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1793904937;
b=zwhBnq0GI3+/iTGH9/STzuzE7Xy5zuK/3PmBOjlScCZ66lX4KHznvjjU6NZFJSvBFNq+
Y0KmGBkUNnj5PcBtXyO+vtv2keGoWkqJQtsujX8P7qS/puIcO6UJOHAiH8paE/vp5bc8M
TKO2aJPGRYnnxG/wrw+CTRZsyc989pOYZ4JHtriRQwH8UhSX6E3gdAPQ4QGo0nIGXVZlX
Oad2tkDZwzJ+q0vcmIT58Moh3Viq9EUO8yT/iz7o8HGdOTE7E702pG5DuXFTpb/aOrvnn
81QNTjOMTUOBpryRUEoH8WtKF39+MiL9e9iiu4AXqAW1CNl+NG+ThhWH7R6L2Eeo2dg==
ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793904937;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:Received:From:Date:Subject:X-Mailing-List:List-Id:
List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding:
Message-Id:References:In-Reply-To:To:Cc:X-Mailer;
bh=3diKjpt3Hplj9bun3k4VWxlSuPRXvr0bzFEfcX1wVKA=;
b=sN0NGORXrXLiLxnuqEvIKYDwYXdNbem+ADL0Glly/nd4ETz9SwMdXmRKDLi7v9Ae/Mtw
k84hTN8XqHGkYFWpP1XWsvf8BlNZWXIcEzKBQ51KLW56FQW8iXouebHc/vHcdlh0HBtnS
6U7fWcsKcVH4n7i1DPF9B6TkzKaFmmHQN+rK2g1QO1bZ+gOwSn2+0OrLpaBZVQXboOjKZ
yeCIPKhw/7+GCLKjSRWdXaeP3hOkHiZkHrVo4fsh0d62K2Bn0jVlUb6ySC329tiiA/Ur8
p1Wnp83iZaU6EMjJSvJt9Kl2RqUEaZkvnjK1uiUd7r+mt+GMJtfrxC47keZfr13M3DQ==
ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256
header.s=20260707 header.b=tCrfKKod;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 40F5C606A33E;
Thu, 5 Nov 2026 18:55:37 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key,
unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256
header.s=20260707 header.b=tCrfKKod
X-Original-To: linux-sunxi@lists.linux.dev
Authentication-Results: smtp.subspace.kernel.org;
arc=none smtp.remote-ip=209.85.161.50
ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1793904937;
b=mkWBnhkdCwvBLpPsFeLZbusYqxxB2xvH0IRXQIcGH6/9N2AZq4iL0bP9o5xZdJ8qM9wA
QosPtkktpbfS1QWVZr7AoSDxHBj5GEy++o1Ue6OtjOSG9FgxjCB9xqwfZ9H9lPZNDvSsr
Bk5n/redM+Gxt0aJ8AVMSkjJ0Z/ccomf3Q11zWtmPHmTXOsgB3xkDtXlzQc6hCXQEuBvz
MYMC8LVkVEcgC10Ao2R+n1DAEkMaxah3Iadf5WdF6fh3Z1lD524kF+0P4GOinJoocPnjE
lWJwX3d8Hd1bF/jx72USBzUn0mpgpp9QBH73xGk7rs8YK/pQKBC3wKxnN4n0LBEivEw==
ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793904937;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:
Message-Id:References:In-Reply-To:To:Cc:X-Mailer;
bh=3diKjpt3Hplj9bun3k4VWxlSuPRXvr0bzFEfcX1wVKA=;
b=DtMlbZNb6cICzFwJq3ecx1wJI5ifWpTL70t1hpRLokqYdWAl6wAaE5Hg+Jq1xNMss0IM
ViKNYwiJHbobqjtG8hJcbbBvOkdmPDr+u1hcxSR5/er9HOuilpl+OkNYrK6tSo5aqKozK
9+JjjMDrKbQr7hoP5mxbH+yqSB3DE/xRmzrYiXgnVu73SgQIRaoyVcvgIVda9Y2ar7+yG
R4NDXGm4Ezm/vjOBp0eorTX/WXtTU4ps4LRrZhO3Jyqvty5duM3cgHrqY0iDiyO3MmqyW
HOXNxfYv8/oU0KyKhmDxxMtveCMqyhr/YXxBojAcCEN04kxjt/z4zAK3oQfG9eZyzQg==
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256
header.s=20260707 header.b=tCrfKKod;
arc=none smtp.remote-ip=209.85.161.50
Received: from mail-oo1-f50.google.com (mail-oo1-f50.google.com
[209.85.161.50])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest
SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id C614E606A326
for <linux-sunxi@lists.linux.dev>; Thu, 5 Nov 2026 18:55:36 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C614E606A326
Authentication-Results: smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=gmail.com
Authentication-Results: smtp.subspace.kernel.org;
spf=pass smtp.mailfrom=gmail.com
Received: by mail-oo1-f50.google.com with SMTP id
006d021491bc7-704597ef1d8so982320eaf.3
for <linux-sunxi@lists.linux.dev>;
Thu, 05 Nov 2026 10:55:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1793904936; x=1794509736;
darn=lists.linux.dev;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:content-type:mime-version:subject:date:from:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=3diKjpt3Hplj9bun3k4VWxlSuPRXvr0bzFEfcX1wVKA=;
b=tCrfKKod4VfzUiFz3JbY2ZmVXQJcOHZYSDyOh+Ud7QHp5CteWXLGuOi1o171eqDFM1
8dP6NXqOh+v9OrWjM9vaUr5bdBwTt4/3j0b2dAqfNYocE0bZ0bzZ9+L4GToMt+ntF2rC
tdRc+Z5pmMwHcqD1as1jtQ1wIIg1vnagmVPQ3lQJYgcHWvNpl8aDTbcDTLiW4oq0JGY8
Z+czamxHriSexWJqV5zXzkuFRPM449C6CohBPa/XpUDvhG+cKecHjq3FV5SJ9FFSaokA
u6uFj9CwUDLe2Wd1vZ3+nZYc4Rv4avcizf/lD6Y2NHkuZPmMkEmrBbwP9MzRljnEmVMe
oJ8g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1793904936; x=1794509736;
h=cc:to:in-reply-to:references:message-id:content-transfer-encoding
:content-type:mime-version:subject:date:from:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=3diKjpt3Hplj9bun3k4VWxlSuPRXvr0bzFEfcX1wVKA=;
b=YeeyCqSyGh1cJptv+235t9K8Z308ZmPrRjp2ReRYYJba0Y+Q2/rwNJ8/BWcNh3A8si
jBM0NhG1fWcP4oxo0qRSRua8JG8i23eGBUSf5emZx5bZW0RydbbdPg2nvYN3GnE2sWGC
PihRZpuaIvo6rb7fOIHVfdB5TGTC8dgN+FPiuwQcyssLXrh6OuXZpEikfawef2i5OAPd
4ortnw9h0ZBWrhRfMl9/fusgL61qmPpyXpu7aVS2ZIq2EYsninfbv5lJmruvHZbLNX5t
qKzE0rjjLuO+fghSuAtqc8d0iEb2S8vb6kFbfytcXO8i6j2TQmg1+kY1bkCcxmx7gndL
0uYw==
X-Forwarded-Encrypted: i=1;
AKwUvBzNPMh841tp3OvX1gN0VIK38mTULhZR3RJvfPxFnVEBb7OHrvHl3jrUXdt4KHMdp3VwpKR92vOoO6B/fQ==@lists.linux.dev
X-Gm-Message-State: APuU4Z+d1AqOT6uDvEE1wXLFvCa2UsU95bVWd56GVCGxZUGik7r+lUwY
jIA9du6N/GxcEFlpFtAKf3eCQWZbGEQkbBP7dUlT2/ea9+Wrpz+yfzJF
X-Gm-Gg: AYBFou0XmTFPIfL6bwQsSFdEF8DT3IFFbhSolF4vKb9Z81mwxkhsKhswfHVbMEZ6FVX
8grtoghST20ixzjRu7jJ/mR3Z6/DNdGI+pRB1sNSbed6KEJFxnX3ZXrjLSUUv55fVF86jDSTvjT
7siosgUB2zUpuMzoZDyy7xN/66Ulj17GmoaeET8CY2MqIaKmXSXzoWzDOBLRYBaly9a+LJBQgN2
JXXyfpHIs46yKDCeqnTlq5rBU1htZ+VvTB+sip8PQgxos3qJ2nqn/wtLXdPOQan8RQDq8Ozm/63
GaNBwGJl/k9pIu8YAKm3Vqr5qdfeTcAmudiG+KdWQA0MDisMO2pRV2BCHCnPSL8tFaEdJf6AhRu
UrnIyAHT0/6JBoX+/lCobYKkHIKGJAZ28/wghCo64Iv6jfjPYUy4y0LzXjeVL8Giz3Hi2xi1H6z
aADiUBf5liZMU3di4HW0nfAJWzpMFfiKv+zDSiIIiQGHalU8umPj5zRdftWG8essM7WRhkPwyeA
19CRGL6lGamXcoYXoc8/JlBPJE1ECveYxcNFfFtuLemCgWO+09VxkA9nLjVhZWvf+N6XKo0+i33
4FcEkC7hbgt4s10GhG0eLtwMB+pRoJYQU/pUjTiMVhH0nBfxJUOEuVuyU5Y7kuskfxh+tWMvgR9
vVCAzP5kdfMGY21/grLiODlPF11Llf2z645Rh1SnUzdU75C1Kx5ZoR1lvdZnu9bbE5xg8q23hCQ
f3H9PabP7F7AJSiSHJ75LcFlkTSwOD/3EW4bLQqvmH6Nm4LYiVr14b
X-Received: by 2002:a05:6820:7408:b0:6d9:8a4a:7114 with SMTP id
006d021491bc7-716e790c5fdmr232093eaf.48.1793904935633;
Thu, 05 Nov 2026 10:55:35 -0800 (PST)
Received: from [127.0.1.1] (174-29-1-49.hlrn.qwest.net. [174.29.1.49])
by smtp.gmail.com with ESMTPSA id
006d021491bc7-716e99465dbsm115897eaf.0.2026.11.05.10.55.33
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 05 Nov 2026 10:55:34 -0800 (PST)
From: James Hilliard <james.hilliard1@gmail.com>
Date: Thu, 05 Nov 2026 11:55:20 -0700
Subject: [PATCH v10 04/26] mtd: rawnand: sunxi: reject pages exceeding the
ECC step limit
X-Mailing-List: linux-sunxi@lists.linux.dev
List-Id: <linux-sunxi.lists.linux.dev>
List-Post: <mailto:linux-sunxi@lists.linux.dev>
List-Help: <mailto:linux-sunxi+help@lists.linux.dev>
List-Subscribe: <mailto:linux-sunxi+subscribe@lists.linux.dev>
List-Unsubscribe: <mailto:linux-sunxi+unsubscribe@lists.linux.dev>
List-Owner: <mailto:linux-sunxi+owner@lists.linux.dev>
Precedence: list
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id:
<20261105-submit-sunxi-nand-vendor-oob-layout-v1-v10-4-dca1f6ed29a8@gmail.com>
References:
<20261105-submit-sunxi-nand-vendor-oob-layout-v1-v10-0-dca1f6ed29a8@gmail.com>
In-Reply-To:
<20261105-submit-sunxi-nand-vendor-oob-layout-v1-v10-0-dca1f6ed29a8@gmail.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>, Vignesh Raghavendra <vigneshr@ti.com>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Clark Williams <clrkwllms@kernel.org>, Steven Rostedt <rostedt@goodmis.org>,
Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, Philipp Zabel <p.zabel@pengutronix.de>,
James Hilliard <james.hilliard1@gmail.com>
Cc: Chen-Yu Tsai <wens@kernel.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>, Maxime Ripard <mripard@kernel.org>,
Richard Genoud <richard.genoud@bootlin.com>,
Boris Brezillon <bbrezillon@kernel.org>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Brian Norris <computersforpeace@gmail.com>, linux-mtd@lists.infradead.org,
linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev,
linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev,
devicetree@vger.kernel.org, Sashiko <sashiko-bot@kernel.org>
X-Mailer: b4 0.15.2
X-Rspamd-Server: rspamd-worker-8404
X-Spamd-Result: default: False [-1.19 / 15.00];
BAYES_HAM(-5.50)[100.00%];
RBL_SENDERSCORE(2.00)[172.105.105.114:from];
SUSPICIOUS_RECIPS(1.50)[];
DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed),
No valid DKIM,none];
MAILLIST(-0.18)[generic];
BAD_REP_POLICIES(0.10)[];
MIME_GOOD(-0.10)[text/plain];
HAS_LIST_UNSUB(-0.01)[];
FORGED_SENDER_MAILLIST(0.00)[];
ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2];
FROM_HAS_DN(0.00)[];
RCPT_COUNT_TWELVE(0.00)[26];
FORGED_RECIPIENTS_MAILLIST(0.00)[];
FREEMAIL_CC(0.00)[kernel.org,gmail.com,sholland.org,bootlin.com,socionext.com,lists.infradead.org,lists.linux.dev,vger.kernel.org];
TAGGED_RCPT(0.00)[dt];
DBL_BLOCKED_OPENRESOLVER(0.00)[tor.lore.kernel.org:helo,tor.lore.kernel.org:rdns];
RCVD_COUNT_FIVE(0.00)[6];
ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG];
R_SPF_ALLOW(0.00)[+ip4:172.105.105.114:c];
FREEMAIL_FROM(0.00)[gmail.com];
TO_DN_SOME(0.00)[];
RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.105.105.114:from];
RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[100.77.114.92:received];
FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev];
FREEMAIL_TO(0.00)[bootlin.com,nod.at,ti.com,linutronix.de,kernel.org,goodmis.org,pengutronix.de,gmail.com];
MIME_TRACE(0.00)[0:+];
TAGGED_FROM(0.00)[bounces-27262-noreply=patchwork.local];
RECEIVED_SPAMHAUS_PBL(0.00)[174.29.1.49:received];
MID_RHS_MATCH_FROM(0.00)[];
RCVD_TLS_LAST(0.00)[];
RCVD_VIA_SMTP_AUTH(0.00)[]
X-Rspamd-Queue-Id: CE7191C53B3
X-MORS-Enabled: yes
X-MORS-DOMAIN: patchwork.local
X-MORS-HOSTING: hosting172546
X-MORS-USER: hosting172546
X-getmail-retrieved-from-mailbox: INBOX
|
| Series |
mtd: rawnand: sunxi: fix transfers and support randomized OOB
|
|
Commit Message
James Hilliard
Nov. 5, 2026, 6:55 p.m. UTC
The controller has 16 ECC status slots on A10/A23 and 32 on H6/H616.
Hardware-ECC setup checks the strength and available OOB space, but does
not check that the page fits those slots. NAND identification can supply
a larger page size, and the NAND core does not enforce this
controller-specific limit.
If enough OOB space is available, an unsupported geometry can pass attach
and reach DMA code that indexes status and user-data registers by ECC
step. H6/H616 also represent enabled data blocks with a 32-bit mask. The
number of steps must fit the controller even when their user data fits
the register bank.
Reject excessive step counts before allocating user-data lengths or
installing the hardware-ECC callbacks. Check the final step size, after
strength maximization and the conversion from 512-byte to 1-KiB steps,
so valid geometries retain their existing layout. This also keeps PIO
fallback from accepting a page that the controller cannot handle.
Fixes: 1fef62c1423b ("mtd: nand: add sunxi NAND flash controller support")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/r/sashiko-outbox-173724@kernel.org
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
drivers/mtd/nand/raw/sunxi_nand.c | 5 +++++
1 file changed, 5 insertions(+)
Comments
On 05/11/2026 at 11:55:20 -07, James Hilliard <james.hilliard1@gmail.com> wrote: > The controller has 16 ECC status slots on A10/A23 and 32 on H6/H616. > Hardware-ECC setup checks the strength and available OOB space, but does > not check that the page fits those slots. NAND identification can supply > a larger page size, and the NAND core does not enforce this > controller-specific limit. > > If enough OOB space is available, an unsupported geometry can pass attach > and reach DMA code that indexes status and user-data registers by ECC > step. H6/H616 also represent enabled data blocks with a 32-bit mask. The > number of steps must fit the controller even when their user data fits > the register bank. > > Reject excessive step counts before allocating user-data lengths or > installing the hardware-ECC callbacks. Check the final step size, after > strength maximization and the conversion from 512-byte to 1-KiB steps, > so valid geometries retain their existing layout. This also keeps PIO > fallback from accepting a page that the controller cannot handle. > > Fixes: 1fef62c1423b ("mtd: nand: add sunxi NAND flash controller support") > Reported-by: Sashiko <sashiko-bot@kernel.org> > Closes: https://lore.kernel.org/r/sashiko-outbox-173724@kernel.org > Signed-off-by: James Hilliard <james.hilliard1@gmail.com> > --- > drivers/mtd/nand/raw/sunxi_nand.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c > index 662d96fc2535..1a61f608ad91 100644 > --- a/drivers/mtd/nand/raw/sunxi_nand.c > +++ b/drivers/mtd/nand/raw/sunxi_nand.c > @@ -2223,6 +2223,11 @@ static int sunxi_nand_hw_ecc_ctrl_init(struct nand_chip *nand, > ecc->bytes = ALIGN(ecc->bytes, 2); > > nsectors = mtd->writesize / ecc->size; > + if (nsectors > nfc->caps->max_ecc_steps) { > + dev_err(nfc->dev, "unsupported number of ECC steps: %d (max %u)\n", > + nsectors, nfc->caps->max_ecc_steps); > + return -EINVAL; > + } I'm fine with this patch, but if your manual says that the controller support chips with pages up to 32k and you wire a chip -that does not exist on earth yet- with a larger page size, screw you? This is again one of those over defensive approaches...
diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c index 662d96fc2535..1a61f608ad91 100644 --- a/drivers/mtd/nand/raw/sunxi_nand.c +++ b/drivers/mtd/nand/raw/sunxi_nand.c @@ -2223,6 +2223,11 @@ static int sunxi_nand_hw_ecc_ctrl_init(struct nand_chip *nand, ecc->bytes = ALIGN(ecc->bytes, 2); nsectors = mtd->writesize / ecc->size; + if (nsectors > nfc->caps->max_ecc_steps) { + dev_err(nfc->dev, "unsupported number of ECC steps: %d (max %u)\n", + nsectors, nfc->caps->max_ecc_steps); + return -EINVAL; + } ret = sunxi_nand->oob_ops->init_user_data(nand, nsectors); if (ret)