Home
last modified time | relevance | path

Searched +full:wear +full:- +full:leveling (Results 1 – 22 of 22) sorted by relevance

/linux-6.12.1/drivers/mtd/ubi/
Dwl.c1 // SPDX-License-Identifier: GPL-2.0-or-later
9 * UBI wear-leveling sub-system.
11 * This sub-system is responsible for wear-leveling. It works in terms of
13 * eraseblocks, volumes, etc. From this sub-system's perspective all physical
14 * eraseblocks are of two types - used and free. Used physical eraseblocks are
21 * When physical eraseblocks are returned to the WL sub-system by means of the
23 * done asynchronously in context of the per-UBI device background thread,
24 * which is also managed by the WL sub-system.
26 * The wear-leveling is ensured by means of moving the contents of used
30 * If the WL sub-system fails to erase a physical eraseblock, it marks it as
[all …]
DKconfig1 # SPDX-License-Identifier: GPL-2.0-only
3 tristate "Enable UBI - Unsorted block images"
6 UBI is a software layer above MTD layer which admits use of LVM-like
8 flash chips like wear and bad blocks and provides some other useful
10 (www.linux-mtd.infradead.org).
15 int "UBI wear-leveling threshold"
22 wear leveling by means of moving data from eraseblock with low erase
26 other flashes which have eraseblock life-cycle 100000 or more.
28 life-cycle less than 10000, the threshold should be lessened (e.g.,
44 as "1024 * (1 - MinNVB / MaxNVB)", which gives 20 for most NANDs
[all …]
Dubi-media.h1 /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
10 * This file defines the layout of UBI headers and all the other UBI on-flash
47 * @UBI_VTBL_AUTORESIZE_FLG: auto-resize this volume
51 * check. Main use-case for this flag is
52 * boot-time reduction
55 * table. UBI automatically re-sizes the volume which has this flag and makes
66 * The auto-resize feature is useful for device production purposes. For
75 * which will store the root file system) is marked as "auto-resizable", and
79 * eraseblock handling, and then re-sizes the volume, not vice-versa. This
92 * @UBI_COMPAT_RO: attach this device in read-only mode
[all …]
Dfastmap-wl.c1 // SPDX-License-Identifier: GPL-2.0-only
9 * update_fastmap_work_fn - calls ubi_update_fastmap from a work queue
17 spin_lock(&ubi->wl_lock); in update_fastmap_work_fn()
18 ubi->fm_work_scheduled = 0; in update_fastmap_work_fn()
19 spin_unlock(&ubi->wl_lock); in update_fastmap_work_fn()
23 * find_anchor_wl_entry - find wear-leveling entry to used as anchor PEB.
24 * @root: the RB-tree where to look for
33 if (e->pnum < UBI_FM_MAX_START && e->ec < max_ec) { in find_anchor_wl_entry()
35 max_ec = e->ec; in find_anchor_wl_entry()
45 wl_tree_add(e, &ubi->free); in return_unused_peb()
[all …]
Dubi.h1 /* SPDX-License-Identifier: GPL-2.0-or-later */
31 #include "ubi-media.h"
57 * This marker in the EBA table means that the LEB is um-mapped.
60 #define UBI_LEB_UNMAPPED -1
64 * returning error. The below constant defines how many times UBI re-tries.
70 * number of (global) erase cycles PEBs are protected from the wear-leveling
76 #define UBI_UNKNOWN -1
89 * Error codes returned by the I/O sub-system.
99 * UBI_IO_BITFLIPS: bit-flips were detected and corrected
101 * Note, it is probably better to have bit-flip and ebadmsg as flags which can
[all …]
Ddebug.h1 /* SPDX-License-Identifier: GPL-2.0-or-later */
20 __func__, __LINE__, current->pid); \
29 pr_debug("UBI DBG " type " (pid %d): " fmt "\n", current->pid, \
34 /* Messages from the eraseblock association sub-system */
36 /* Messages from the wear-leveling sub-system */
38 /* Messages from the input/output sub-system */
56 * The following function is a legacy implementation of UBI fault-injection
64 if (ubi->dbg.emulate_bitflips) in ubi_dbg_bitflip()
71 if (ubi->dbg.emulate_io_failures) in ubi_dbg_write_failure()
78 if (ubi->dbg.emulate_io_failures) in ubi_dbg_erase_failure()
[all …]
Dattach.c1 // SPDX-License-Identifier: GPL-2.0-or-later
9 * UBI attaching sub-system.
11 * This sub-system is responsible for attaching MTD devices and it also
16 * objects which are kept in volume RB-tree with root at the @volumes field.
17 * The RB-tree is indexed by the volume ID.
20 * objects are kept in per-volume RB-trees with the root at the corresponding
21 * &struct ubi_ainf_volume object. To put it differently, we keep an RB-tree of
22 * per-volume objects and each of these objects is the root of RB-tree of
23 * per-LEB objects.
32 * UBI protects EC and VID headers with CRC-32 checksums, so it can detect
[all …]
Dbuild.c1 // SPDX-License-Identifier: GPL-2.0-or-later
38 /* Maximum number of comma-separated items in the 'mtd=' parameter */
51 * struct mtd_dev_param - MTD device parameter description data structure.
57 * @enable_fm: enable fastmap when value is non-zero
58 * @need_resv_pool: reserve pool->max_size pebs when value is none-zero
75 /* UBI module parameter to enable fastmap automatically on non-fastmap images */
80 /* Slab cache for wear-leveling entries */
96 /* Protects @ubi_devices, @ubi->ref_count and @ubi->is_dead */
150 * ubi_volume_notify - send a volume change notification.
156 * change event (creation, removal, re-sizing, re-naming, updating). Returns
[all …]
/linux-6.12.1/Documentation/devicetree/bindings/mtd/partitions/
Dlinux,ubi.yaml1 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
3 ---
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
12 physical flash device and spreads the I/O load (i.e wear-leveling)
16 - Daniel Golle <daniel@makrotopia.org>
19 - $ref: partition.yaml#
30 "^ubi-volume-.*$":
31 $ref: /schemas/mtd/partitions/ubi-volume.yaml#
36 - compatible
41 - |
[all …]
/linux-6.12.1/Documentation/filesystems/
Dubifs.rst1 .. SPDX-License-Identifier: GPL-2.0
10 UBIFS file-system stands for UBI File System. UBI stands for "Unsorted
13 is completely different to any traditional file-system in Linux, like
14 Ext2, XFS, JFS, etc. UBIFS represents a separate class of file-systems
16 file-system of this class is JFFS2.
24 2 MTD devices support 3 main operations - read from some offset within an
26 eraseblock. Block devices support 2 main operations - read a whole
29 re-write its contents. Blocks may be just re-written.
30 4 Eraseblocks become worn out after some number of erase cycles -
31 typically 100K-1G for SLC NAND and NOR flashes, and 1K-10K for MLC
[all …]
Dubifs-authentication.rst1 .. SPDX-License-Identifier: GPL-2.0
24 binary to perform a malicious action when executed [DMC-CBC-ATTACK]. Since
28 Other full disk encryption systems like dm-crypt cover all filesystem metadata,
31 time. For dm-crypt and other filesystems that build upon the Linux block IO
32 layer, the dm-integrity or dm-verity subsystems [DM-INTEGRITY, DM-VERITY]
34 These can also be combined with dm-crypt [CRYPTSETUP2].
44 ----------------
50 addition, it deals with flash-specific wear-leveling and transparent I/O error
54 UBIFS is a filesystem for raw flash which operates on top of UBI. Thus, wear
55 leveling and some flash specifics are left to UBI, while UBIFS focuses on
[all …]
/linux-6.12.1/drivers/mtd/
DKconfig65 This allows you to mount read-only file systems (such as cramfs)
81 is part of the PCMCIA specification. It uses a kind of pseudo-
83 512-byte sectors, on top of which you put a 'normal' file system.
87 legal - in the USA you are only permitted to use this on PCMCIA
98 used on M-Systems' DiskOnChip devices. It uses a kind of pseudo-
100 512-byte sectors, on top of which you put a 'normal' file system.
104 legal - in the USA you are only permitted to use this on DiskOnChip
122 Layer which is used on M-Systems' newer DiskOnChip devices. It
123 uses a kind of pseudo-file system on a flash device to emulate
124 a block device with 512-byte sectors, on top of which you put
[all …]
Dmtdswap.c1 // SPDX-License-Identifier: GPL-2.0-only
4 * Turns an MTD device into a swap device with block wear leveling
11 * support and lock-less operation written by Adrian Hunter.
43 * Wear level cost amortization. We want to do wear leveling on the background
46 * on the biggest wear difference rather than the biggest dirtiness.
59 #define BLOCK_ERROR (UINT_MAX - 1)
60 #define BLOCK_MAX (UINT_MAX - 2)
80 rb)->erase_count)
82 rb)->erase_count)
153 * page from the current block and is then pre-empted by the GC
[all …]
Dnftlmount.c1 // SPDX-License-Identifier: GPL-2.0-or-later
7 * Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org>
31 struct NFTLMediaHeader *mh = &nftl->MediaHdr; in find_boot_record()
32 struct mtd_info *mtd = nftl->mbd.mtd; in find_boot_record()
40 nftl->EraseSize if there were any point in doing so. */ in find_boot_record()
41 nftl->EraseSize = nftl->mbd.mtd->erasesize; in find_boot_record()
42 nftl->nb_blocks = (u32)nftl->mbd.mtd->size / nftl->EraseSize; in find_boot_record()
44 nftl->MediaUnit = BLOCK_NIL; in find_boot_record()
45 nftl->SpareMediaUnit = BLOCK_NIL; in find_boot_record()
48 for (block = 0; block < nftl->nb_blocks; block++) { in find_boot_record()
[all …]
Dftl.c1 /* This version ported to the Linux-MTD system by dwmw2@infradead.org
4 * - fixes some leaks on failure in build_maps and ftl_notify_add, cleanups
12 This driver implements a disk-like block device driver with an
42 LEGAL NOTE: The FTL format is patented by M-Systems. They have
45 "M-Systems grants a royalty-free, non-exclusive license under
46 any presently existing M-Systems intellectual property rights
47 necessary for the design and development of FTL-compatible
52 Use of the FTL format for non-PCMCIA applications may be an
54 contact M-Systems directly. M-Systems since acquired by Sandisk.
105 /* Sector size -- shouldn't need to change */
[all …]
/linux-6.12.1/drivers/mtd/nand/spi/
Dwinbond.c1 // SPDX-License-Identifier: GPL-2.0
40 return -ERANGE; in w25m02gv_ooblayout_ecc()
42 region->offset = (16 * section) + 8; in w25m02gv_ooblayout_ecc()
43 region->length = 8; in w25m02gv_ooblayout_ecc()
52 return -ERANGE; in w25m02gv_ooblayout_free()
54 region->offset = (16 * section) + 2; in w25m02gv_ooblayout_free()
55 region->length = 6; in w25m02gv_ooblayout_free()
72 spinand->scratchbuf, in w25m02gv_select_target()
75 *spinand->scratchbuf = target; in w25m02gv_select_target()
76 return spi_mem_exec_op(spinand->spimem, &op); in w25m02gv_select_target()
[all …]
Dtoshiba.c1 // SPDX-License-Identifier: GPL-2.0
45 return -ERANGE; in tx58cxgxsxraix_ooblayout_ecc()
47 region->offset = mtd->oobsize / 2; in tx58cxgxsxraix_ooblayout_ecc()
48 region->length = mtd->oobsize / 2; in tx58cxgxsxraix_ooblayout_ecc()
57 return -ERANGE; in tx58cxgxsxraix_ooblayout_free()
60 region->offset = 2; in tx58cxgxsxraix_ooblayout_free()
61 region->length = (mtd->oobsize / 2) - 2; in tx58cxgxsxraix_ooblayout_free()
76 struct spi_mem_op op = SPINAND_GET_FEATURE_OP(0x30, spinand->scratchbuf); in tx58cxgxsxraix_ecc_get_status()
83 return -EBADMSG; in tx58cxgxsxraix_ecc_get_status()
89 * in order to avoid forcing the wear-leveling layer to move in tx58cxgxsxraix_ecc_get_status()
[all …]
Dmacronix.c1 // SPDX-License-Identifier: GPL-2.0
45 return -ERANGE; in mx35lfxge4ab_ooblayout_ecc()
52 return -ERANGE; in mx35lfxge4ab_ooblayout_free()
54 region->offset = 2; in mx35lfxge4ab_ooblayout_free()
55 region->length = mtd->oobsize - 2; in mx35lfxge4ab_ooblayout_free()
67 struct macronix_priv *priv = spinand->priv; in macronix_get_eccsr()
73 int ret = spi_mem_exec_op(spinand->spimem, &op); in macronix_get_eccsr()
82 if (!priv->cont_read) in macronix_get_eccsr()
101 return -EBADMSG; in macronix_ecc_get_status()
106 * in order to avoid forcing the wear-leveling layer to move in macronix_ecc_get_status()
[all …]
Dcore.c1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2016-2017 Micron Technology, Inc.
10 #define pr_fmt(fmt) "spi-nand: " fmt
21 #include <linux/spi/spi-mem.h>
26 spinand->scratchbuf); in spinand_read_reg_op()
29 ret = spi_mem_exec_op(spinand->spimem, &op); in spinand_read_reg_op()
33 *val = *spinand->scratchbuf; in spinand_read_reg_op()
40 spinand->scratchbuf); in spinand_write_reg_op()
42 *spinand->scratchbuf = val; in spinand_write_reg_op()
43 return spi_mem_exec_op(spinand->spimem, &op); in spinand_write_reg_op()
[all …]
/linux-6.12.1/drivers/mtd/parsers/
Dsharpslpart.c2 * sharpslpart.c - MTD partition parser for NAND flash using the SHARP FTL
10 * linux/include/asm-arm/sharp_nand_logical.h
57 * struct sharpsl_ftl - Sharp FTL Logical Table
59 * @log2phy: the logical-to-physical table
61 * Structure containing the logical-to-physical translation table
89 freebytes |= BIT(i - 8); in sharpsl_nand_check_ooblayout()
95 return -ENOTSUPP; in sharpsl_nand_check_ooblayout()
104 ops.ooblen = mtd->oobsize; in sharpsl_nand_read_oob()
108 if (ret != 0 || mtd->oobsize != ops.oobretlen) in sharpsl_nand_read_oob()
109 return -1; in sharpsl_nand_read_oob()
[all …]
/linux-6.12.1/drivers/mtd/devices/
Ddocg3.c1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Handles the M-Systems DiskOnChip G3 chip
32 * As no specification is available from M-Systems/Sandisk, this drivers lacks
34 * - IPL write
40 * - a 1 byte Hamming code stored in the OOB for each page
41 * - a 7 bytes BCH code stored in the OOB for each page
43 * - BCH is in GF(2^14)
44 * - BCH is over data of 520 bytes (512 page + 7 page_info bytes
46 * - BCH can correct up to 4 bits (t = 4)
47 * - BCH syndroms are calculated in hardware, and checked in hardware as well
[all …]
/linux-6.12.1/mm/
Dswapfile.c1 // SPDX-License-Identifier: GPL-2.0-only
22 #include <linux/blk-cgroup.h>
31 #include <linux/backing-dev.h>
77 static int least_priority = -1;
101 * swap_info_struct changes between not-full/full, it needs to
102 * add/remove itself to/from this list, but the swap_info_struct->lock
104 * before any swap_info_struct->lock.
147 unsigned char *map = si->swap_map + offset; in swap_is_has_cache()
162 unsigned char *map = si->swap_map + offset; in swap_is_last_map()
186 swp_entry_t entry = swp_entry(si->type, offset); in __try_to_reclaim_swap()
[all …]