From: "Michael Walle" <mwalle@kernel.org>
To: "Chen Minqiang" <ptpt52@gmail.com>,
"Pratyush Yadav" <pratyush@kernel.org>,
"Miquel Raynal" <miquel.raynal@bootlin.com>,
"Richard Weinberger" <richard@nod.at>,
"Vignesh Raghavendra" <vigneshr@ti.com>
Cc: "Takahiro Kuwano" <takahiro.kuwano@infineon.com>,
<linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] mtd: spi-nor: allow force unlocking via DT property
Date: Fri, 11 Sep 2026 09:32:11 +0200 [thread overview]
Message-ID: <DLCB8YQF6G49.1YQJBPWBMZ6IE@kernel.org> (raw)
In-Reply-To: <20260806113733.31042-1-ptpt52@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1412 bytes --]
On Thu Aug 6, 2026 at 1:37 PM CEST, Chen Minqiang wrote:
> Some SPI NOR flash chips (such as generic or unlisted chips used in vendor
> devices like Tenda AX12L Pro) have Block Protection (BP) bits set in the
> Status Register by bootloaders or factory settings, locking flash blocks.
>
> Because vendors frequently switch between various generic SPI NOR flash
> chips ("Flash Lottery"), it is impractical to upstream explicit chip ID
> flags (SNOR_F_HAS_LOCK) for every possible generic chip variant.
>
> This patch introduces support for the "linux,force-sr-unlock" Device Tree
> property:
> 1. In spi_nor_init_flags(), set the SNOR_F_HAS_LOCK flag on the flash
> instance if "linux,force-sr-unlock" is present in the flash DT node. This
> allows spi_nor_late_init_params() to automatically populate default
> locking_ops without altering swp.c.
> 2. In spi_nor_init(), trigger spi_nor_try_unlock_all() if "linux,force-sr-unlock"
> is set, invoking Linux kernel's native spi_nor_unlock() mechanism.
>
> Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
> ---
> v1 -> v2:
> - Set SNOR_F_HAS_LOCK in spi_nor_init_flags() when "linux,force-sr-unlock"
> is present in DT, allowing spi_nor_late_init_params() to set default
> locking_ops automatically without modifying swp.c.
I've given you feedback on the v1, there was no reply, so I'm going
to ignore this.
-michael
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]
prev parent reply other threads:[~2026-09-11 7:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2026-08-05171214.2934-1-ptpt52@gmail.com>
2026-08-06 11:24 ` [PATCH] " Chen Minqiang
2026-08-10 6:30 ` Michael Walle
2026-08-06 11:37 ` [PATCH v2] " Chen Minqiang
2026-09-11 7:32 ` Michael Walle [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DLCB8YQF6G49.1YQJBPWBMZ6IE@kernel.org \
--to=mwalle@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=pratyush@kernel.org \
--cc=ptpt52@gmail.com \
--cc=richard@nod.at \
--cc=takahiro.kuwano@infineon.com \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®