linux/drivers/mtd/ubi
Ran Hongyun a5e0055eac UBI: support per-device wear-leveling threshold
The UBI wear-leveling threshold (CONFIG_MTD_UBI_WL_THRESHOLD) is
currently a compile-time constant shared by all UBI devices. When a
single kernel image must support multiple NAND flashes with different
erase lifetimes, one global threshold cannot suit all devices.

Add a per-device configurable wl_threshold parameter:

  - UAPI: add __s32 wl_threshold to struct ubi_attach_req, carved
    from the existing padding.

  - Module parameter: ubi.mtd gains a new optional token
    "wl_threshold":
      ubi.mtd=0,0,0,0,0,0,256  ubi.mtd=1,0,0,0,0,0,4096

0 means "use the kernel default", the accepted range is
2-65536.

Signed-off-by: Ran Hongyun <ranhongyun1@huawei.com>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2026-08-12 00:08:54 +02:00
..
attach.c UBI: Preserve torture flag when rescheduling failed erasures 2026-08-11 23:33:18 +02:00
block.c block: switch numa_node to int in blk_mq_hw_ctx and init_request 2026-05-26 11:01:55 -06:00
build.c UBI: support per-device wear-leveling threshold 2026-08-12 00:08:54 +02:00
cdev.c UBI: support per-device wear-leveling threshold 2026-08-12 00:08:54 +02:00
debug.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
debug.h ubi: Add six fault injection type for testing 2024-01-06 23:41:40 +01:00
eba.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
fastmap-wl.c UBI: support per-device wear-leveling threshold 2026-08-12 00:08:54 +02:00
fastmap.c UBI: fastmap: Pass to_be_tortured when reusing old fastmap PEBs 2026-08-11 23:33:18 +02:00
gluebi.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
io.c UBI: Preserve torture flag when rescheduling failed erasures 2026-08-11 23:33:18 +02:00
kapi.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig mtd: ubi: provide NVMEM layer over UBI volumes 2024-02-25 22:42:23 +01:00
Makefile mtd: ubi: provide NVMEM layer over UBI volumes 2024-02-25 22:42:23 +01:00
misc.c ubi: use correct names in function kernel-doc comments 2023-02-05 22:36:39 +01:00
nvmem.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ubi-media.h ubi: ubi-media.h: Fix comment typo 2022-09-21 11:12:18 +02:00
ubi.h UBI: support per-device wear-leveling threshold 2026-08-12 00:08:54 +02:00
upd.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
vmt.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vtbl.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
wl.c UBI: support per-device wear-leveling threshold 2026-08-12 00:08:54 +02:00
wl.h ubi: fastmap: wl: Schedule fm_work if wear-leveling pool is empty 2024-11-14 17:48:28 +01:00