<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-next.git/drivers/mtd, branch master</title>
<subtitle>Linux kernel latest source</subtitle>
<id>http://mirrors.hust.edu.cn/git/linux-next.git/atom?h=master</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/linux-next.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/'/>
<updated>2026-09-04T08:54:18+00:00</updated>
<entry>
<title>mtd: spi-nor: Unprepare legacy controllers upon RWW wait interruption</title>
<updated>2026-09-04T08:54:18+00:00</updated>
<author>
<name>Miquel Raynal</name>
<email>miquel.raynal@bootlin.com</email>
</author>
<published>2026-08-11T15:56:23+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=f594a33f9721f08facd98d0a31adc14ff6da9d70'/>
<id>urn:sha1:f594a33f9721f08facd98d0a31adc14ff6da9d70</id>
<content type='text'>
All the parallel locking helpers (spi_nor_prep_and_lock(),
spi_nor_prep_and_lock_pe() and spi_nor_prep_and_lock_rd()) call
spi_nor_prep() then wait with a killable sleep. If the sleep gets
killed, we leave the controller in its prepared state.

Call -&gt;unprepare() in these cases.

Fixes: 74df43b3f626 ("mtd: spi-nor: Enhance locking to support reads while writes")
Cc: stable@vger.kernel.org
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Reviewed-by: Michael Walle &lt;mwalle@kernel.org&gt;
Acked-by: Tudor Ambarus &lt;tudor.ambarus@linaro.org&gt;
Signed-off-by: Michael Walle &lt;mwalle@kernel.org&gt;
</content>
</entry>
<entry>
<title>mtd: spi-nor: xmc: add locking to XM25QH128A</title>
<updated>2026-09-04T08:54:18+00:00</updated>
<author>
<name>Michael Walle</name>
<email>mwalle@kernel.org</email>
</author>
<published>2026-08-11T06:44:44+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=3c2464c70284eb5443a18ea7ee2f815a06d91a5b'/>
<id>urn:sha1:3c2464c70284eb5443a18ea7ee2f815a06d91a5b</id>
<content type='text'>
Add support for locking to the XM25QH128A part.

Reported-by: Wei, Takino &lt;stayer.opt1f@icloud.com&gt;
Tested-by: Wei, Takino &lt;stayer.opt1f@icloud.com&gt; # on Fedora 44 / 7.1.6-201
Reviewed-by: Takahiro Kuwano &lt;takahiro.kuwano@infineon.com&gt;
Signed-off-by: Michael Walle &lt;mwalle@kernel.org&gt;
</content>
</entry>
<entry>
<title>mtd: spi-nor: remove unused NO_OP_CHIP_ERASE flag</title>
<updated>2026-09-04T08:54:18+00:00</updated>
<author>
<name>Takahiro Kuwano</name>
<email>Takahiro.Kuwano@infineon.com</email>
</author>
<published>2026-07-31T07:57:19+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=c63c890a12c0e5959190a486f1b8409f90d35f6c'/>
<id>urn:sha1:c63c890a12c0e5959190a486f1b8409f90d35f6c</id>
<content type='text'>
NO_OP_CHIP_ERASE flag is no longer used.
Remove definition and references of the flag in core and debugfs.

Reviewed-by: Tudor Ambarus &lt;tudor.ambarus@linaro.org&gt;
Signed-off-by: Takahiro Kuwano &lt;Takahiro.Kuwano@infineon.com&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Reviewed-by: Michael Walle &lt;mwalle@kernel.org&gt;
[mw: rebased onto spi-nor/next]
Signed-off-by: Michael Walle &lt;mwalle@kernel.org&gt;
</content>
</entry>
<entry>
<title>mtd: spi-nor: sfdp: check the length of the SCCR map</title>
<updated>2026-09-04T08:30:06+00:00</updated>
<author>
<name>HyeongJun An</name>
<email>sammiee5311@gmail.com</email>
</author>
<published>2026-07-20T14:11:04+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=1413f38f37194673502e61cd3749e091c031370b'/>
<id>urn:sha1:1413f38f37194673502e61cd3749e091c031370b</id>
<content type='text'>
The spi_nor_parse_sccr() sizes its buffer from the table length the
flash reports in the SFDP parameter header. But it then reads DWORD1
and DWORD22 without ever checking the table is that long.

So if a flash reports a length of one, the buffer is only four bytes
while DWORD22 sits at byte offset 84. With a length of zero kmalloc()
returns ZERO_SIZE_PTR rather than an error, so the NULL check doesn't
catch it and the first read dereferences it.

To fix this, reject a table that's too short for the highest DWORD the
parser reads, the way spi_nor_parse_4bait() already does. The table is
optional, so this isn't fatal. The spi_nor_parse_sfdp() warns and
carries on.

The spi_nor_parse_sccr_mc() doesn't need the same check. It works out
the number of dice from the length it allocated with, so its highest
index stays inside the buffer.

Fixes: 7ab8b810757a ("mtd: spi-nor: sfdp: Add support for SCCR map for multi-chip device")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: HyeongJun An &lt;sammiee5311@gmail.com&gt;
Signed-off-by: Michael Walle &lt;mwalle@kernel.org&gt;
</content>
</entry>
<entry>
<title>mtd: spi-nor: sfdp: check the length of the xSPI Profile 1.0 table</title>
<updated>2026-09-04T08:30:01+00:00</updated>
<author>
<name>HyeongJun An</name>
<email>sammiee5311@gmail.com</email>
</author>
<published>2026-07-20T14:11:03+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=b9f34a95a81021fa1f3c9cb8cfd458e66824cad6'/>
<id>urn:sha1:b9f34a95a81021fa1f3c9cb8cfd458e66824cad6</id>
<content type='text'>
The spi_nor_parse_profile1() sizes its buffer from the table length the
flash reports in the SFDP parameter header. But it then reads DWORD1,
DWORD4 and DWORD5 without ever checking the table is that long.

So if a flash reports a length of one, the buffer is only four bytes
while DWORD4 and DWORD5 sit at byte offsets 12 and 16. With a length of
zero kmalloc() returns ZERO_SIZE_PTR rather than an error, so the NULL
check doesn't catch it and the first read dereferences it. And the value
doesn't just get thrown away. It ends up as the dummy cycle count for
8D-8D-8D fast reads.

To fix this, reject a table that's too short for the highest DWORD the
parser reads, the way spi_nor_parse_4bait() already does. The table is
optional, so this isn't fatal. The spi_nor_parse_sfdp() warns and
carries on.

Fixes: fb27f198971a ("mtd: spi-nor: sfdp: parse xSPI Profile 1.0 table")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: HyeongJun An &lt;sammiee5311@gmail.com&gt;
Signed-off-by: Michael Walle &lt;mwalle@kernel.org&gt;
</content>
</entry>
<entry>
<title>mtd: spi-nor: rework flash parameter initialization</title>
<updated>2026-09-04T08:29:57+00:00</updated>
<author>
<name>Michael Walle</name>
<email>mwalle@kernel.org</email>
</author>
<published>2026-07-13T09:11:46+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=90a8ed3c63b905dcd375585da6f4851d88cc343d'/>
<id>urn:sha1:90a8ed3c63b905dcd375585da6f4851d88cc343d</id>
<content type='text'>
Rework how the flash parameters are initialized. It used to make a
difference whether a flash is in the in-kernel database, whether it
supports multi I/O and so on. Recently, that makes more and more
problems because flash IDs are reused among legacy flashes (w/o SFDP
support) and newer flashes [1,2,3,4].

Simplify the whole parameter initialization, by starting with the
parameters we have in the in-kernel database and the try to parse SFDP
(and let it override any settings).

This has the consequence that all the flashes now get a RDSFPD opcode
which might be an unknown opcode from the perspective of the flash. With
the generic SPI NOR flash driver, this was already the case for any
flashes not listed in the in-kernel database. So far, there was not a
single complaint.

[1] https://lore.kernel.org/linux-mtd/CAAyq3SYX9UPwhC_Ume_S2yxhQwimRvB=Y6O_+FFqokhNmw7jQg@mail.gmail.com/
[2] https://lore.kernel.org/linux-mtd/DGB4745HRCFI.1DRYTHXURWZJO@kernel.org/
[3] https://lore.kernel.org/linux-mtd/DD10GE4EOCD7.CPTN7198QFUV@kernel.org/
[4] https://lore.kernel.org/linux-mtd/DD6SI06QNEE4.2YCRTWJHEAAQM@kernel.org/

Tested-by: Cheng Ming Lin &lt;chengminglin@mxic.com.tw&gt;
Tested-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt; # w/ W25Q02JVFIM
Tested-by: Takahiro Kuwano &lt;takahiro.kuwano@infineon.com&gt; # w/ s25fl128s0, s25fl128s1, s25fl256s0
Signed-off-by: Michael Walle &lt;mwalle@kernel.org&gt;
</content>
</entry>
<entry>
<title>mtd: spi-nor: push the rollback mechanism into the sfdp module</title>
<updated>2026-09-04T08:29:55+00:00</updated>
<author>
<name>Michael Walle</name>
<email>mwalle@kernel.org</email>
</author>
<published>2026-07-13T09:11:45+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=d20029474a76a06a2a92427453c2326cc3e98dfa'/>
<id>urn:sha1:d20029474a76a06a2a92427453c2326cc3e98dfa</id>
<content type='text'>
Right now, the core is handling the rollback of the parameters. But it
doesn't have the knowledge what has to be rolled back. And in fact,
havent rolled back everything. Push it down to the called function and
make it mandatory, that this function has no side effects if it fails.

Funny enough, there is a comment in the SFDP table handling code that
each table parser is responsible to roll back any changes. But none of
them did. So while add it, expand the logic to that and roll it back for
them. There is one simple rule though:

  SFDP parsing and fixups may only modify the spi_nor_flash_parameters.

Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Signed-off-by: Michael Walle &lt;mwalle@kernel.org&gt;
</content>
</entry>
<entry>
<title>mtd: spi-nor: spansion: s25fs256t: move ARCFN check into .late_init</title>
<updated>2026-09-04T08:29:53+00:00</updated>
<author>
<name>Michael Walle</name>
<email>mwalle@kernel.org</email>
</author>
<published>2026-07-13T09:11:44+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=d395d4b8e76b1dfdb2f46b29c62e7f1f4850c9b2'/>
<id>urn:sha1:d395d4b8e76b1dfdb2f46b29c62e7f1f4850c9b2</id>
<content type='text'>
The SFPD parsing is optional. It not meant to fail if something is wrong
with the chip (except for the SFDP itself). Thus it doesn't make any
sense to return -ENODEV.

Move that check to late_init(), which might fail and abort the flash
probing.

Tested-by: Takahiro Kuwano &lt;takahiro.kuwano@infineon.com&gt;
Signed-off-by: Michael Walle &lt;mwalle@kernel.org&gt;
</content>
</entry>
<entry>
<title>mtd: spi-nor: move spi_nor_post_bfpt_fixups() into sfdp</title>
<updated>2026-09-04T08:29:51+00:00</updated>
<author>
<name>Michael Walle</name>
<email>mwalle@kernel.org</email>
</author>
<published>2026-07-13T09:11:43+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=69d9d7dabbebd91cd8aba4e23caabe9b34d2722c'/>
<id>urn:sha1:69d9d7dabbebd91cd8aba4e23caabe9b34d2722c</id>
<content type='text'>
Move spi_nor_post_bfpt_fixups() into the sfdp module because it's
really only needed there. While at it, add some documentation.

Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Signed-off-by: Michael Walle &lt;mwalle@kernel.org&gt;
</content>
</entry>
<entry>
<title>mtd: spi-nor: move flags into spi_nor_flash_parameter</title>
<updated>2026-09-04T08:29:50+00:00</updated>
<author>
<name>Michael Walle</name>
<email>mwalle@kernel.org</email>
</author>
<published>2026-07-13T09:11:42+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/linux-next.git/commit/?id=0ede46b4f5b38cb43225927abbf088dd568db54e'/>
<id>urn:sha1:0ede46b4f5b38cb43225927abbf088dd568db54e</id>
<content type='text'>
Right now the SFDP parsing code is modifying both members of
struct spi_nor_flash_parameter and struct spi_nor. This may lead to
inconsistencies if the parsing fails because only the flash parameters
are rolled back.

To fix this, move the flags into the struct spi_nor_flash_parameter.

Reported-by: Sashiko &lt;sashiko-bot@kernel.org&gt;
Closes: https://sashiko.dev/#/patchset/20260601125438.3481722-1-mwalle%40kernel.org?part=3
Signed-off-by: Michael Walle &lt;mwalle@kernel.org&gt;
</content>
</entry>
</feed>
