From patchwork Mon Jun 19 09:28:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 1796409 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=wtdL4t3I; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=gm1 header.b=OAy1t10c; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Ql4HF0MS2z20XZ for ; Mon, 19 Jun 2023 19:30:01 +1000 (AEST) 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: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:In-Reply-To:References: List-Owner; bh=wrcD3z5X4s6NXJbfBkzBuEVxpkMfSashe2SN4BCaY3w=; b=wtdL4t3IlhVeXZ E272ipH0o1yts3cwClQYEJsn/g7hVfYuxTRoH4RC4sR8Qw/3ScfivHPYuB/a9OOvUDB2A/se1aNRC Tiev+Xn5h9wdDybQTrFlyBV+reOHdbrNZladrGWaECnVtthVkHOR0teg7rxorFJje6tEQNOhBuJr4 OklCccgU8HLP4ILWdWStLt/l1EMZ8b/g5BzXSAAT2Aab3KsvjLWp5RVai4u7CUszChAX1x8wKOY4I C4Vo+fpFhm+yzyu8HppEuecQn/5wNNPwYAekM5KTXY8WhYswulBS1sZmEC3m0E6SvBP2UgPF6Fk5g itiE/ti5WAjeRLGPDrTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qBBCS-0080Qv-2Y; Mon, 19 Jun 2023 09:29:28 +0000 Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qBBCO-0080O4-1Z for linux-mtd@lists.infradead.org; Mon, 19 Jun 2023 09:29:26 +0000 X-GND-Sasl: miquel.raynal@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1687166961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hzm+wyXnQnXoG7AF86SFOyQilabBBm30tZrluvS3Mxw=; b=OAy1t10cbWqn87umkXPZKI8KjwiCGlHD/GvvBRPSzPr3gq3ZdC9FsL9EfP6lEuOTA6rJ2C ja70LU3Oz/TXbsTgFvbUEQf8U7pkcWiYdsIJo418LrHtEFhL0FAnqKWuZHGmJWxlfgcg2g Gu6c/eBSxpuZdx188VJ2a9+BpOJIg2Mt6vXlo2jRWMIm5HgmkDE2c3wE7FXGOdwAE2DUFs jf6l99XS/XPyZh8gpvXLHt1Cv/D0DqDZoJQ4888SE2IyYw7SmJOJ8M+FwAk5YokvS/ths5 HjYV3lM1mgpw9pJr5LqhtmhmVFDuxp4MS9XtDAyuf4HZfJOJZVMTLphzwOg2ZA== X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 1F21B1BF205; Mon, 19 Jun 2023 09:29:16 +0000 (UTC) From: Miquel Raynal To: Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Cc: Richard Weinberger , Vignesh Raghavendra , Tudor Ambarus , Pratyush Yadav , Michael Walle , , Chris Packham , Thomas Petazzoni , Miquel Raynal , Alexandre Torgue , AngeloGioacchino Del Regno , Brian Norris , Chen-Yu Tsai , Christophe Kerello , Heiko Stuebner , Jernej Skrabec , Kamal Dasu , Liang Yang , Manivannan Sadhasivam , Masahiro Yamada , Matthias Brugger , Maxime Coquelin , Maxime Ripard , Paul Cercueil , Samuel Holland , Vadivel Murugan , Xiangsheng Hou Subject: [PATCH v3 00/17] Prevent NAND chip unevaluated properties Date: Mon, 19 Jun 2023 11:28:59 +0200 Message-Id: <20230619092916.3028470-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230619_022924_939021_08423330 X-CRM114-Status: GOOD ( 16.24 ) X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: As discussed with Krzysztof and Chris, it seems like each NAND controller binding should actually restrain the properties allowed in the NAND chip node with its own "unevaluatedProperties: false". Thi [...] Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.183.201 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [217.70.183.201 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org As discussed with Krzysztof and Chris, it seems like each NAND controller binding should actually restrain the properties allowed in the NAND chip node with its own "unevaluatedProperties: false". This only works if we reference a yaml schema which contains all the possible properties *in the NAND chip node*. Indeed, the NAND controller yaml schema contains properties for the NAND chip which are not evaluated with this construction. Link: https://lore.kernel.org/all/a23dd485-a3d9-e31f-be3e-0ab293fcfc4a@linaro.org/ While converting Marvell controller bindings, Chris explicitly pointed similar bindings which would also trigger errors when using "unevaluatedProperties: false" because of the problem mentioned above. Here is an attempt at making this logic more robust: * All NAND chip properties which are specific to the raw NAND world are moved into a raw-nand-chip.yaml file. * raw-nand-chip.yaml is referenced by all NAND controller bindings when the NAND chip must be further constrained. * raw-nand-chip.yaml and spi-nand.yaml reference nand-chip.yaml. These change made me realize the qcom,boot-partition property description was broken, and a few other descriptions needed small updates. Here is a batch of updates to fix all these. Thanks, Miquèl Changes in v3: * I'm not sure what happened with v2 but there were some leftovers from "previous" kernels, anyway this version of the series does not seem to be affected. * I also removed the remaining quotes which are not needed anymore. * Collected all tags. Miquel Raynal (17): dt-bindings: mtd: Accept nand related node names dt-bindings: mtd: Create a file for raw NAND chip properties dt-bindings: mtd: Mark nand-ecc-placement deprecated dt-bindings: mtd: Describe nand-ecc-mode dt-bindings: mtd: qcom: Fix a property position dt-bindings: mtd: qcom: Prevent NAND chip unevaluated properties dt-bindings: mtd: ingenic: Prevent NAND chip unevaluated properties dt-bindings: mtd: sunxi: Prevent NAND chip unevaluated properties dt-bindings: mtd: meson: Prevent NAND chip unevaluated properties dt-bindings: mtd: brcmnand: Prevent NAND chip unevaluated properties dt-bindings: mtd: denali: Prevent NAND chip unevaluated properties dt-bindings: mtd: intel: Prevent NAND chip unevaluated properties dt-bindings: mtd: rockchip: Prevent NAND chip unevaluated properties dt-bindings: mtd: stm32: Prevent NAND chip unevaluated properties dt-bindings: mtd: mediatek: Reference raw-nand-chip.yaml dt-bindings: mtd: mediatek: Prevent NAND chip unevaluated properties dt-bindings: mtd: ti,am654: Prevent unevaluated properties .../mtd/allwinner,sun4i-a10-nand.yaml | 5 +- .../bindings/mtd/amlogic,meson-nand.yaml | 3 + .../bindings/mtd/brcm,brcmnand.yaml | 3 + .../devicetree/bindings/mtd/denali,nand.yaml | 9 +- .../devicetree/bindings/mtd/ingenic,nand.yaml | 4 + .../bindings/mtd/intel,lgm-ebunand.yaml | 5 +- .../bindings/mtd/mediatek,mtk-nfc.yaml | 3 +- .../devicetree/bindings/mtd/mtd.yaml | 2 +- .../bindings/mtd/nand-controller.yaml | 85 +------------- .../devicetree/bindings/mtd/qcom,nandc.yaml | 45 ++++--- .../bindings/mtd/raw-nand-chip.yaml | 111 ++++++++++++++++++ .../mtd/rockchip,nand-controller.yaml | 3 + .../bindings/mtd/st,stm32-fmc2-nand.yaml | 3 + .../bindings/mtd/ti,am654-hbmc.yaml | 2 + 14 files changed, 172 insertions(+), 111 deletions(-) create mode 100644 Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml