| /kernel/linux/linux-6.6/drivers/mtd/ubi/ |
| D | fastmap-wl.c | 14 struct ubi_device *ubi = container_of(wrk, struct ubi_device, fm_work); in update_fastmap_work_fn() local 16 ubi_update_fastmap(ubi); in update_fastmap_work_fn() 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() 42 static inline void return_unused_peb(struct ubi_device *ubi, in return_unused_peb() argument 45 wl_tree_add(e, &ubi->free); in return_unused_peb() 46 ubi->free_count++; in return_unused_peb() 51 * @ubi: UBI device description object 54 static void return_unused_pool_pebs(struct ubi_device *ubi, in return_unused_pool_pebs() argument [all …]
|
| D | build.c | 11 * This file includes UBI initialization and building of UBI devices. 13 * When UBI is initialized, it attaches all the MTD devices specified as the 15 * specified, UBI does not attach any MTD device, but it is possible to do 16 * later using the "UBI control device". 32 #include "ubi.h" 53 * @ubi_num: UBI number 72 /* UBI module parameter to enable fastmap automatically on non-fastmap images */ 80 /* UBI control character device */ 87 /* All UBI devices in system */ 90 /* Serializes UBI devices creations and removals */ [all …]
|
| D | wl.c | 9 * UBI wear-leveling sub-system. 23 * done asynchronously in context of the per-UBI device background thread, 37 * As it was said, for the UBI sub-system all physical eraseblocks are either 92 #include "ubi.h" 125 static int self_check_ec(struct ubi_device *ubi, int pnum, int ec); 126 static int self_check_in_wl_tree(const struct ubi_device *ubi, 128 static int self_check_in_pq(const struct ubi_device *ubi, 137 * the @ubi->used and @ubi->free RB-trees. 169 * @ubi: UBI device description object 175 static void wl_entry_destroy(struct ubi_device *ubi, struct ubi_wl_entry *e) in wl_entry_destroy() argument [all …]
|
| D | vmt.c | 17 #include "ubi.h" 19 static int self_check_volumes(struct ubi_device *ubi); 24 /* Device attributes corresponding to files in '/<sysfs>/class/ubi/ubiX_Y' */ 43 * "Show" method for files in '/<sysfs>/class/ubi/ubiX_Y/'. 47 * /<sysfs>/class/ubi/ubiX_Y/reserved_ebs; 49 * C. process 1 starts reading the /<sysfs>/class/ubi/ubiX_Y/reserved_ebs file; 52 * out that the volume was removed from the @ubi->volumes array. 59 struct ubi_device *ubi = vol->ubi; in vol_attribute_show() local 61 spin_lock(&ubi->volumes_lock); in vol_attribute_show() 62 if (!ubi->volumes[vol->vol_id]) { in vol_attribute_show() [all …]
|
| D | io.c | 10 * UBI input/output sub-system. 14 * writing UBI headers. 26 * changed. For example, for different reasons (e.g., optimization) UBI may be 28 * offset. Of course, if the offset of the VID header is unaligned, UBI adds 32 * About minimal I/O units. In general, UBI assumes flash device model where 35 * @ubi->mtd->writesize field. But as an exception, UBI admits use of another 40 * write operations to one NAND page. In this case UBI can fit EC and VID 41 * headers at one NAND page. Thus, UBI may use "sub-page" size as the minimal 42 * I/O unit for the headers (the @ubi->hdrs_min_io_size field). But it still 43 * reports NAND page size (@ubi->min_io_size) as a minimal I/O unit for the UBI [all …]
|
| D | fastmap.c | 10 #include "ubi.h" 14 * @ubi: UBI device description object 16 static inline unsigned long *init_seen(struct ubi_device *ubi) in init_seen() argument 20 if (!ubi_dbg_chk_fastmap(ubi)) in init_seen() 23 ret = bitmap_zalloc(ubi->peb_count, GFP_KERNEL); in init_seen() 32 * @seen: integer array of @ubi->peb_count size 41 * @ubi: UBI device description object 43 * @seen: integer array of @ubi->peb_count size 45 static inline void set_seen(struct ubi_device *ubi, int pnum, unsigned long *seen) in set_seen() argument 47 if (!ubi_dbg_chk_fastmap(ubi) || !seen) in set_seen() [all …]
|
| D | vtbl.c | 29 * In this UBI implementation the on-flash volume table does not contain any 52 #include "ubi.h" 54 static void self_vtbl_check(const struct ubi_device *ubi); 61 * @ubi: UBI device description object 63 static int ubi_update_layout_vol(struct ubi_device *ubi) in ubi_update_layout_vol() argument 68 layout_vol = ubi->volumes[vol_id2idx(ubi, UBI_LAYOUT_VOLUME_ID)]; in ubi_update_layout_vol() 70 err = ubi_eba_atomic_leb_change(ubi, layout_vol, i, ubi->vtbl, in ubi_update_layout_vol() 71 ubi->vtbl_size); in ubi_update_layout_vol() 81 * @ubi: UBI device description object 90 int ubi_change_vtbl_record(struct ubi_device *ubi, int idx, in ubi_change_vtbl_record() argument [all …]
|
| D | eba.c | 9 * The UBI Eraseblock Association (EBA) sub-system. 34 #include "ubi.h" 65 * @ubi: UBI device description object 71 unsigned long long ubi_next_sqnum(struct ubi_device *ubi) in ubi_next_sqnum() argument 75 spin_lock(&ubi->ltree_lock); in ubi_next_sqnum() 76 sqnum = ubi->global_sqnum++; in ubi_next_sqnum() 77 spin_unlock(&ubi->ltree_lock); in ubi_next_sqnum() 84 * @ubi: UBI device description object 90 static int ubi_get_compat(const struct ubi_device *ubi, int vol_id) in ubi_get_compat() argument 202 * @ubi: UBI device description object [all …]
|
| D | misc.c | 8 /* Here we keep miscellaneous functions which are used all over the UBI code */ 10 #include "ubi.h" 14 * @ubi: UBI device description object 22 int ubi_calc_data_len(const struct ubi_device *ubi, const void *buf, in ubi_calc_data_len() argument 27 ubi_assert(!(length & (ubi->min_io_size - 1))); in ubi_calc_data_len() 34 length = ALIGN(i + 1, ubi->min_io_size); in ubi_calc_data_len() 40 * @ubi: UBI device description object 48 int ubi_check_volume(struct ubi_device *ubi, int vol_id) in ubi_check_volume() argument 52 struct ubi_volume *vol = ubi->volumes[vol_id]; in ubi_check_volume() 71 err = ubi_eba_read_leb(ubi, vol, i, buf, 0, size, 1); in ubi_check_volume() [all …]
|
| D | kapi.c | 8 /* This file mostly implements UBI kernel API functions */ 16 #include "ubi.h" 19 * ubi_do_get_device_info - get information about UBI device. 20 * @ubi: UBI device description object 23 * This function is the same as 'ubi_get_device_info()', but it assumes the UBI 26 void ubi_do_get_device_info(struct ubi_device *ubi, struct ubi_device_info *di) in ubi_do_get_device_info() argument 28 di->ubi_num = ubi->ubi_num; in ubi_do_get_device_info() 29 di->leb_size = ubi->leb_size; in ubi_do_get_device_info() 30 di->leb_start = ubi->leb_start; in ubi_do_get_device_info() 31 di->min_io_size = ubi->min_io_size; in ubi_do_get_device_info() [all …]
|
| D | ubi.h | 28 #include <linux/mtd/ubi.h> 31 #include "ubi-media.h" 33 /* Maximum number of supported UBI devices */ 36 /* UBI name used for character devices, sysfs, etc */ 37 #define UBI_NAME_STR "ubi" 41 /* Normal UBI messages */ 43 void ubi_msg(const struct ubi_device *ubi, const char *fmt, ...); 45 /* UBI warning messages */ 47 void ubi_warn(const struct ubi_device *ubi, const char *fmt, ...); 49 /* UBI error messages */ [all …]
|
| /kernel/linux/linux-5.10/drivers/mtd/ubi/ |
| D | build.c | 11 * This file includes UBI initialization and building of UBI devices. 13 * When UBI is initialized, it attaches all the MTD devices specified as the 15 * specified, UBI does not attach any MTD device, but it is possible to do 16 * later using the "UBI control device". 32 #include "ubi.h" 69 /* UBI module parameter to enable fastmap automatically on non-fastmap images */ 77 /* UBI control character device */ 84 /* All UBI devices in system */ 87 /* Serializes UBI devices creations and removals */ 90 /* Protects @ubi_devices and @ubi->ref_count */ [all …]
|
| D | fastmap-wl.c | 14 struct ubi_device *ubi = container_of(wrk, struct ubi_device, fm_work); in update_fastmap_work_fn() local 16 ubi_update_fastmap(ubi); in update_fastmap_work_fn() 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() 42 static inline void return_unused_peb(struct ubi_device *ubi, in return_unused_peb() argument 45 wl_tree_add(e, &ubi->free); in return_unused_peb() 46 ubi->free_count++; in return_unused_peb() 51 * @ubi: UBI device description object 54 static void return_unused_pool_pebs(struct ubi_device *ubi, in return_unused_pool_pebs() argument [all …]
|
| D | wl.c | 9 * UBI wear-leveling sub-system. 23 * done asynchronously in context of the per-UBI device background thread, 37 * As it was said, for the UBI sub-system all physical eraseblocks are either 92 #include "ubi.h" 125 static int self_check_ec(struct ubi_device *ubi, int pnum, int ec); 126 static int self_check_in_wl_tree(const struct ubi_device *ubi, 128 static int self_check_in_pq(const struct ubi_device *ubi, 137 * the @ubi->used and @ubi->free RB-trees. 169 * @ubi: UBI device description object 175 static void wl_entry_destroy(struct ubi_device *ubi, struct ubi_wl_entry *e) in wl_entry_destroy() argument [all …]
|
| D | vmt.c | 17 #include "ubi.h" 19 static int self_check_volumes(struct ubi_device *ubi); 24 /* Device attributes corresponding to files in '/<sysfs>/class/ubi/ubiX_Y' */ 43 * "Show" method for files in '/<sysfs>/class/ubi/ubiX_Y/'. 47 * /<sysfs>/class/ubi/ubiX_Y/reserved_ebs; 49 * C. process 1 starts reading the /<sysfs>/class/ubi/ubiX_Y/reserved_ebs file; 52 * out that the volume was removed from the @ubi->volumes array. 59 struct ubi_device *ubi = vol->ubi; in vol_attribute_show() local 61 spin_lock(&ubi->volumes_lock); in vol_attribute_show() 62 if (!ubi->volumes[vol->vol_id]) { in vol_attribute_show() [all …]
|
| D | io.c | 10 * UBI input/output sub-system. 14 * writing UBI headers. 26 * changed. For example, for different reasons (e.g., optimization) UBI may be 28 * offset. Of course, if the offset of the VID header is unaligned, UBI adds 32 * About minimal I/O units. In general, UBI assumes flash device model where 35 * @ubi->mtd->writesize field. But as an exception, UBI admits use of another 40 * write operations to one NAND page. In this case UBI can fit EC and VID 41 * headers at one NAND page. Thus, UBI may use "sub-page" size as the minimal 42 * I/O unit for the headers (the @ubi->hdrs_min_io_size field). But it still 43 * reports NAND page size (@ubi->min_io_size) as a minimal I/O unit for the UBI [all …]
|
| D | fastmap.c | 10 #include "ubi.h" 14 * @ubi: UBI device description object 16 static inline unsigned long *init_seen(struct ubi_device *ubi) in init_seen() argument 20 if (!ubi_dbg_chk_fastmap(ubi)) in init_seen() 23 ret = kcalloc(BITS_TO_LONGS(ubi->peb_count), sizeof(unsigned long), in init_seen() 33 * @seen: integer array of @ubi->peb_count size 42 * @ubi: UBI device description object 44 * @seen: integer array of @ubi->peb_count size 46 static inline void set_seen(struct ubi_device *ubi, int pnum, unsigned long *seen) in set_seen() argument 48 if (!ubi_dbg_chk_fastmap(ubi) || !seen) in set_seen() [all …]
|
| D | vtbl.c | 29 * In this UBI implementation the on-flash volume table does not contain any 52 #include "ubi.h" 54 static void self_vtbl_check(const struct ubi_device *ubi); 61 * @ubi: UBI device description object 63 static int ubi_update_layout_vol(struct ubi_device *ubi) in ubi_update_layout_vol() argument 68 layout_vol = ubi->volumes[vol_id2idx(ubi, UBI_LAYOUT_VOLUME_ID)]; in ubi_update_layout_vol() 70 err = ubi_eba_atomic_leb_change(ubi, layout_vol, i, ubi->vtbl, in ubi_update_layout_vol() 71 ubi->vtbl_size); in ubi_update_layout_vol() 81 * @ubi: UBI device description object 90 int ubi_change_vtbl_record(struct ubi_device *ubi, int idx, in ubi_change_vtbl_record() argument [all …]
|
| D | eba.c | 9 * The UBI Eraseblock Association (EBA) sub-system. 34 #include "ubi.h" 65 * @ubi: UBI device description object 71 unsigned long long ubi_next_sqnum(struct ubi_device *ubi) in ubi_next_sqnum() argument 75 spin_lock(&ubi->ltree_lock); in ubi_next_sqnum() 76 sqnum = ubi->global_sqnum++; in ubi_next_sqnum() 77 spin_unlock(&ubi->ltree_lock); in ubi_next_sqnum() 84 * @ubi: UBI device description object 90 static int ubi_get_compat(const struct ubi_device *ubi, int vol_id) in ubi_get_compat() argument 203 * @ubi: UBI device description object [all …]
|
| D | misc.c | 8 /* Here we keep miscellaneous functions which are used all over the UBI code */ 10 #include "ubi.h" 14 * @ubi: UBI device description object 22 int ubi_calc_data_len(const struct ubi_device *ubi, const void *buf, in ubi_calc_data_len() argument 27 ubi_assert(!(length & (ubi->min_io_size - 1))); in ubi_calc_data_len() 34 length = ALIGN(i + 1, ubi->min_io_size); in ubi_calc_data_len() 40 * @ubi: UBI device description object 48 int ubi_check_volume(struct ubi_device *ubi, int vol_id) in ubi_check_volume() argument 52 struct ubi_volume *vol = ubi->volumes[vol_id]; in ubi_check_volume() 71 err = ubi_eba_read_leb(ubi, vol, i, buf, 0, size, 1); in ubi_check_volume() [all …]
|
| D | kapi.c | 8 /* This file mostly implements UBI kernel API functions */ 16 #include "ubi.h" 19 * ubi_do_get_device_info - get information about UBI device. 20 * @ubi: UBI device description object 23 * This function is the same as 'ubi_get_device_info()', but it assumes the UBI 26 void ubi_do_get_device_info(struct ubi_device *ubi, struct ubi_device_info *di) in ubi_do_get_device_info() argument 28 di->ubi_num = ubi->ubi_num; in ubi_do_get_device_info() 29 di->leb_size = ubi->leb_size; in ubi_do_get_device_info() 30 di->leb_start = ubi->leb_start; in ubi_do_get_device_info() 31 di->min_io_size = ubi->min_io_size; in ubi_do_get_device_info() [all …]
|
| D | ubi.h | 28 #include <linux/mtd/ubi.h> 31 #include "ubi-media.h" 33 /* Maximum number of supported UBI devices */ 36 /* UBI name used for character devices, sysfs, etc */ 37 #define UBI_NAME_STR "ubi" 41 /* Normal UBI messages */ 43 void ubi_msg(const struct ubi_device *ubi, const char *fmt, ...); 45 /* UBI warning messages */ 47 void ubi_warn(const struct ubi_device *ubi, const char *fmt, ...); 49 /* UBI error messages */ [all …]
|
| D | debug.h | 11 void ubi_dump_flash(struct ubi_device *ubi, int pnum, int offset, int len); 19 pr_crit("UBI assert failed in %s at %u (pid %d)\n", \ 29 pr_debug("UBI DBG " type " (pid %d): " fmt "\n", current->pid, \ 48 int ubi_self_check_all_ff(struct ubi_device *ubi, int pnum, int offset, 52 int ubi_debugfs_init_dev(struct ubi_device *ubi); 53 void ubi_debugfs_exit_dev(struct ubi_device *ubi); 57 * @ubi: UBI device description object 59 * Returns non-zero if the UBI background thread is disabled for testing 62 static inline int ubi_dbg_is_bgt_disabled(const struct ubi_device *ubi) in ubi_dbg_is_bgt_disabled() argument 64 return ubi->dbg.disable_bgt; in ubi_dbg_is_bgt_disabled() [all …]
|
| /kernel/linux/linux-5.10/Documentation/ABI/stable/ |
| D | sysfs-class-ubi | 1 What: /sys/class/ubi/ 6 The ubi/ class sub-directory belongs to the UBI subsystem and 7 provides general UBI information, per-UBI device information 8 and per-UBI volume information. 10 What: /sys/class/ubi/version 15 This file contains version of the latest supported UBI on-media 17 However, if in the future UBI needs on-flash format changes 29 UBI devices (UBI device 0, 1, etc). They contain general UBI 30 device information and per UBI volume information (each UBI 31 device may have many UBI volumes) [all …]
|
| /kernel/linux/linux-6.6/Documentation/ABI/stable/ |
| D | sysfs-class-ubi | 1 What: /sys/class/ubi/ 6 The ubi/ class sub-directory belongs to the UBI subsystem and 7 provides general UBI information, per-UBI device information 8 and per-UBI volume information. 10 What: /sys/class/ubi/version 15 This file contains version of the latest supported UBI on-media 17 However, if in the future UBI needs on-flash format changes 29 UBI devices (UBI device 0, 1, etc). They contain general UBI 30 device information and per UBI volume information (each UBI 31 device may have many UBI volumes) [all …]
|