]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mtd: spinand: Enhance the logic when picking a variant
authorMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 10 Jan 2025 14:45:25 +0000 (15:45 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 15 Jan 2025 18:23:56 +0000 (19:23 +0100)
commit666c299be696f02c3354da104295fb94b8f65d25
tree67d1dddbc5edbd7b49daf3ddfd091bff7a02b697
parent7ce0d16d5802bfde4209e52ee8ad644ca1eab423
mtd: spinand: Enhance the logic when picking a variant

Currently the best variant picked in the first one in the list provided
in the manufacturer driver. This worked well while all operations where
performed at the same speed, but with the introduction of DTR transfers
and per operation maximum frequencies, this no longer works correctly.

Let's continue iterating over all the alternatives, even if we find a
match, keeping a reference over the theoretically fastest
operation. Only at the end we can tell which variant is the best.

This logic happening only once at boot, the extra computing needed
compared to the previous version is acceptable wrt. the expected
improvements.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/spi/core.c