From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 30CD030F54C for ; Wed, 22 Oct 2025 09:02:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761123765; cv=none; b=eipwDT4IpitK6I7lMHof9zle1R9WmaEFegTi+WwK/xBXSY8O9VV640WSZJwAa0uowieQ45VLU3xImlVO2ybFufXMNi1wMhjqe1ms+pNyL2+gzuD+J9xNcHcL/uRbw5LY89opBZE082AkDjd2zczSbUzitmGjNNWcfnr06kwHnO0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761123765; c=relaxed/simple; bh=RAn9DUN+XwBeOn/ARjMhyZhD6sfiWfeYDtT/mcFMGBs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=HRCmLkvsjtYeZXk7kcCLmFcscatC4MTkYGTT/CoZJYCfxSsMmRY7C4E9ZlxVX5/JLpvZLCWfuhIAaRtMO17jciCcUQnj+mCRiQBd6whmBF4BV+ON07JC6l1hmWHo7QBSuYh6Lklw9KEzCrUUBEYZ/I/hsotJCz6e7ozavzsfZqA= 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=N3c3SpV5; arc=none smtp.client-ip=185.246.84.56 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="N3c3SpV5" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 65E831A15CD; Wed, 22 Oct 2025 09:02:41 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 36F36606DC; Wed, 22 Oct 2025 09:02:41 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 00CFE102F2424; Wed, 22 Oct 2025 11:02:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761123760; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=oDRCUkMoCDby5S/aZrDjp1VXkak+fQdoG5RdkGXcB4Y=; b=N3c3SpV57p5/GKS5PSw7jmNA1udiZ4jXASbHWVwRfwDneehJCGrqoNujIJH7dGUKy0P8SW Gwrpaj8sBhW97sO2TJlj8vA7fDjThqucjwNAkTfRgMBJkr8p00UXfw91V42W6vvZ5JfYG7 /JcxDVomjRkPhkCUi0EjhpriqPlXzOYXf7jxDf/1NgdjYTNRQTC49WHgvkdL2eG1X9H7uy AHbENFrT5qNHYN54ydrdcpWeFSohXnMloWLAIJPKC6d0LrS9ldokxcFZ5I5ZRpgMDEtssH 8QdrA8u6UmMSsYRO7b6XVxk3mYwdc6y3gp651iSnUuhM67xdB46zehcfJ1INfw== From: Miquel Raynal To: Richard Genoud Cc: Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Wentao Liang , Johan Hovold , Maxime Ripard , Thomas Petazzoni , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 05/15] mtd: rawnand: sunxi: rework pattern found registers In-Reply-To: <20251020101311.256819-6-richard.genoud@bootlin.com> (Richard Genoud's message of "Mon, 20 Oct 2025 12:13:01 +0200") References: <20251020101311.256819-1-richard.genoud@bootlin.com> <20251020101311.256819-6-richard.genoud@bootlin.com> User-Agent: mu4e 1.12.7; emacs 30.2 Date: Wed, 22 Oct 2025 11:02:36 +0200 Message-ID: <87plaftikz.fsf@bootlin.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Hi Richard, On 20/10/2025 at 12:13:01 +02, Richard Genoud = wrote: > On H6/H616, the register ECC_PAT_FOUND is at its own address, and not > part of ECC status register. > So, introduce the pattern found register offset in sunxi_nfc_caps, along > with its mask. > > Also, introduce a non compile-time field_get() because FIELD_GET() and > u32_get_bits() don't work with non compile-time constant. > https://lore.kernel.org/lkml/cover.1739540679.git.geert+renesas@glider.be/ > > No functional change. > > Signed-off-by: Richard Genoud > --- > drivers/mtd/nand/raw/sunxi_nand.c | 36 ++++++++++++++++++++++++++----- > 1 file changed, 31 insertions(+), 5 deletions(-) > > diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sun= xi_nand.c > index 8f5d8df19e33..4cfb5d3e9c06 100644 > --- a/drivers/mtd/nand/raw/sunxi_nand.c > +++ b/drivers/mtd/nand/raw/sunxi_nand.c > @@ -29,6 +29,9 @@ > #include > #include >=20=20 > +/* non compile-time field get */ > +#define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - > 1)) I see there are already 26 users for this, let's hope it gets merged soon and this one dropped. Not a blocker for me. Miqu=C3=A8l