/linux/drivers/mtd/ubi/ |
H A D | wl.c | 126 static int self_check_ec(struct ubi_device *ubi, int pnum, int ec); 127 static int self_check_in_wl_tree(const struct ubi_device *ubi, 129 static int self_check_in_pq(const struct ubi_device *ubi, 178 static void wl_entry_destroy(struct ubi_device *ubi, struct ubi_wl_entry *e) in wl_entry_destroy() argument 180 ubi->lookuptbl[e->pnum] = NULL; in wl_entry_destroy() 193 static int do_work(struct ubi_device *ubi, int *executed) in do_work() argument 206 down_read(&ubi->work_sem); in do_work() 207 spin_lock(&ubi->wl_lock); in do_work() 208 if (list_empty(&ubi->works)) { in do_work() 209 spin_unlock(&ubi->wl_lock); in do_work() [all …]
|
H A D | build.c | 159 int ubi_volume_notify(struct ubi_device *ubi, struct ubi_volume *vol, int ntype) in ubi_volume_notify() argument 164 ubi_do_get_device_info(ubi, &nt.di); in ubi_volume_notify() 165 ubi_do_get_volume_info(ubi, vol, &nt.vi); in ubi_volume_notify() 172 ret = ubi_update_fastmap(ubi); in ubi_volume_notify() 174 ubi_msg(ubi, "Unable to write a new fastmap: %i", ret); in ubi_volume_notify() 191 int ubi_notify_all(struct ubi_device *ubi, int ntype, struct notifier_block *nb) in ubi_notify_all() argument 196 ubi_do_get_device_info(ubi, &nt.di); in ubi_notify_all() 198 mutex_lock(&ubi->device_mutex); in ubi_notify_all() 199 for (i = 0; i < ubi->vtbl_slots; i++) { in ubi_notify_all() 205 if (!ubi->volumes[i]) in ubi_notify_all() [all …]
|
H A 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() 54 static void return_unused_pool_pebs(struct ubi_device *ubi, in return_unused_pool_pebs() argument 61 e = ubi->lookuptbl[pool->pebs[i]]; in return_unused_pool_pebs() [all …]
|
H A D | io.c | 81 static int self_check_not_bad(const struct ubi_device *ubi, int pnum); 82 static int self_check_peb_ec_hdr(const struct ubi_device *ubi, int pnum); 83 static int self_check_ec_hdr(const struct ubi_device *ubi, int pnum, 85 static int self_check_peb_vid_hdr(const struct ubi_device *ubi, int pnum); 86 static int self_check_vid_hdr(const struct ubi_device *ubi, int pnum, 88 static int self_check_write(struct ubi_device *ubi, const void *buf, int pnum, 113 int ubi_io_read(const struct ubi_device *ubi, void *buf, int pnum, int offset, in ubi_io_read() argument 122 ubi_assert(pnum >= 0 && pnum < ubi->peb_count); in ubi_io_read() 123 ubi_assert(offset >= 0 && offset + len <= ubi->peb_size); in ubi_io_read() 126 err = self_check_not_bad(ubi, pnum); in ubi_io_read() [all …]
|
H A D | debug.h | 11 void ubi_dump_flash(struct ubi_device *ubi, int pnum, int offset, int len); 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); 60 int ubi_dbg_power_cut(struct ubi_device *ubi, int caller); 62 static inline int ubi_dbg_bitflip(const struct ubi_device *ubi) in ubi_dbg_bitflip() argument 64 if (ubi->dbg.emulate_bitflips) in ubi_dbg_bitflip() 69 static inline int ubi_dbg_write_failure(const struct ubi_device *ubi) in ubi_dbg_write_failure() argument 71 if (ubi->dbg.emulate_io_failures) in ubi_dbg_write_failure() 76 static inline int ubi_dbg_erase_failure(const struct ubi_device *ubi) in ubi_dbg_erase_failure() argument [all …]
|
H A D | vmt.c | 19 static int self_check_volumes(struct ubi_device *ubi); 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] || ubi->volumes[vol->vol_id]->is_dead) { in vol_attribute_show() 63 spin_unlock(&ubi->volumes_lock); in vol_attribute_show() 68 spin_unlock(&ubi->volumes_lock); in vol_attribute_show() 97 spin_lock(&ubi->volumes_lock); in vol_attribute_show() 100 spin_unlock(&ubi->volumes_lock); in vol_attribute_show() 165 int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req) in ubi_create_volume() argument 172 if (ubi->ro_mode) in ubi_create_volume() [all …]
|
H A D | vtbl.c | 54 static void self_vtbl_check(const struct ubi_device *ubi); 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() 90 int ubi_change_vtbl_record(struct ubi_device *ubi, int idx, in ubi_change_vtbl_record() argument 96 ubi_assert(idx >= 0 && idx < ubi->vtbl_slots); in ubi_change_vtbl_record() 105 memcpy(&ubi->vtbl[idx], vtbl_rec, sizeof(struct ubi_vtbl_record)); in ubi_change_vtbl_record() 106 err = ubi_update_layout_vol(ubi); in ubi_change_vtbl_record() 108 self_vtbl_check(ubi); in ubi_change_vtbl_record() [all …]
|
H A D | eba.c | 68 unsigned long long ubi_next_sqnum(struct ubi_device *ubi) in ubi_next_sqnum() argument 72 spin_lock(&ubi->ltree_lock); in ubi_next_sqnum() 73 sqnum = ubi->global_sqnum++; in ubi_next_sqnum() 74 spin_unlock(&ubi->ltree_lock); in ubi_next_sqnum() 87 static int ubi_get_compat(const struct ubi_device *ubi, int vol_id) in ubi_get_compat() argument 207 static struct ubi_ltree_entry *ltree_lookup(struct ubi_device *ubi, int vol_id, in ltree_lookup() argument 212 p = ubi->ltree.rb_node; in ltree_lookup() 246 static struct ubi_ltree_entry *ltree_add_entry(struct ubi_device *ubi, in ltree_add_entry() argument 260 spin_lock(&ubi->ltree_lock); in ltree_add_entry() 261 le1 = ltree_lookup(ubi, vol_id, lnum); in ltree_add_entry() [all …]
|
H A D | ubi.h | 43 void ubi_msg(const struct ubi_device *ubi, const char *fmt, ...); 47 void ubi_warn(const struct ubi_device *ubi, const char *fmt, ...); 51 void ubi_err(const struct ubi_device *ubi, const char *fmt, ...); 333 struct ubi_device *ubi; member 805 int (*func)(struct ubi_device *ubi, struct ubi_work *wrk, int shutdown); 827 int ubi_add_to_av(struct ubi_device *ubi, struct ubi_attach_info *ai, int pnum, 833 struct ubi_ainf_peb *ubi_early_get_peb(struct ubi_device *ubi, 835 int ubi_attach(struct ubi_device *ubi, int force_scan); 838 int ubi_change_vtbl_record(struct ubi_device *ubi, int idx, 840 int ubi_vtbl_rename_volumes(struct ubi_device *ubi, [all …]
|
H A D | fastmap.c | 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_NOFS); in init_seen() 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() 58 static int self_check_seen(struct ubi_device *ubi, unsigned long *seen) in self_check_seen() argument 62 if (!ubi_dbg_chk_fastmap(ubi) || !seen) in self_check_seen() 65 for (pnum = 0; pnum < ubi->peb_count; pnum++) { in self_check_seen() 66 if (!test_bit(pnum, seen) && ubi->lookuptbl[pnum]) { in self_check_seen() 67 ubi_err(ubi, "self-check failed for PEB %d, fastmap didn't see it", pnum); in self_check_seen() [all …]
|
H A D | kapi.c | 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() 32 di->max_write_size = ubi->max_write_size; in ubi_do_get_device_info() 33 di->ro_mode = ubi->ro_mode; in ubi_do_get_device_info() 34 di->cdev = ubi->cdev.dev; in ubi_do_get_device_info() 48 struct ubi_device *ubi; in ubi_get_device_info() local 52 ubi = ubi_get_device(ubi_num); in ubi_get_device_info() [all …]
|
H A D | misc.c | 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() 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() 92 void ubi_update_reserved(struct ubi_device *ubi) in ubi_update_reserved() argument 94 int need = ubi->beb_rsvd_level - ubi->beb_rsvd_pebs; in ubi_update_reserved() 96 if (need <= 0 || ubi->avail_pebs == 0) in ubi_update_reserved() 99 need = min_t(int, need, ubi->avail_pebs); in ubi_update_reserved() [all …]
|
H A D | attach.c | 79 static int self_check_ai(struct ubi_device *ubi, struct ubi_attach_info *ai); 330 static int validate_vid_hdr(const struct ubi_device *ubi, in validate_vid_hdr() argument 349 ubi_err(ubi, "inconsistent vol_id"); in validate_vid_hdr() 359 ubi_err(ubi, "inconsistent vol_type"); in validate_vid_hdr() 364 ubi_err(ubi, "inconsistent used_ebs"); in validate_vid_hdr() 369 ubi_err(ubi, "inconsistent data_pad"); in validate_vid_hdr() 377 ubi_err(ubi, "inconsistent VID header at PEB %d", pnum); in validate_vid_hdr() 438 int ubi_compare_lebs(struct ubi_device *ubi, const struct ubi_ainf_peb *aeb, in ubi_compare_lebs() argument 455 ubi_err(ubi, "unsupported on-flash UBI format"); in ubi_compare_lebs() 486 vidb = ubi_alloc_vid_buf(ubi, GFP_KERNEL); in ubi_compare_lebs() [all …]
|
H A D | wl.h | 7 static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi); 8 static struct ubi_wl_entry *next_peb_for_wl(struct ubi_device *ubi, 10 static bool need_wear_leveling(struct ubi_device *ubi); 11 static void ubi_fastmap_close(struct ubi_device *ubi); 12 static inline void ubi_fastmap_init(struct ubi_device *ubi, int *count) in ubi_fastmap_init() argument 14 if (ubi->fm_disabled) in ubi_fastmap_init() 15 ubi->fm_pool_rsv_cnt = 0; in ubi_fastmap_init() 17 *count += (ubi->fm_size / ubi->leb_size) * 2 + ubi->fm_pool_rsv_cnt; in ubi_fastmap_init() 18 INIT_WORK(&ubi->fm_work, update_fastmap_work_fn); in ubi_fastmap_init() 20 static struct ubi_wl_entry *may_reserve_for_fm(struct ubi_device *ubi, [all …]
|
H A D | upd.c | 41 static int set_update_marker(struct ubi_device *ubi, struct ubi_volume *vol) in set_update_marker() argument 49 ubi_assert(ubi->vtbl[vol->vol_id].upd_marker); in set_update_marker() 54 vtbl_rec = ubi->vtbl[vol->vol_id]; in set_update_marker() 57 mutex_lock(&ubi->device_mutex); in set_update_marker() 58 err = ubi_change_vtbl_record(ubi, vol->vol_id, &vtbl_rec); in set_update_marker() 60 mutex_unlock(&ubi->device_mutex); in set_update_marker() 74 static int clear_update_marker(struct ubi_device *ubi, struct ubi_volume *vol, in clear_update_marker() argument 82 vtbl_rec = ubi->vtbl[vol->vol_id]; in clear_update_marker() 97 mutex_lock(&ubi->device_mutex); in clear_update_marker() 98 err = ubi_change_vtbl_record(ubi, vol->vol_id, &vtbl_rec); in clear_update_marker() [all …]
|
H A D | cdev.c | 49 spin_lock(&vol->ubi->volumes_lock); in get_exclusive() 53 ubi_err(vol->ubi, "%d users for volume %d", users, vol->vol_id); in get_exclusive() 61 spin_unlock(&vol->ubi->volumes_lock); in get_exclusive() 75 spin_lock(&vol->ubi->volumes_lock); in revoke_exclusive() 87 spin_unlock(&vol->ubi->volumes_lock); in revoke_exclusive() 123 vol->ubi->ubi_num, vol->vol_id, desc->mode); in vol_cdev_release() 126 ubi_warn(vol->ubi, "update of volume %d not finished, volume is damaged", in vol_cdev_release() 133 vol->upd_received, vol->upd_bytes, vol->ubi->ubi_num, in vol_cdev_release() 150 ubi_err(vol->ubi, "updating"); in vol_cdev_llseek() 161 struct ubi_device *ubi = desc->vol->ubi; in vol_cdev_fsync() local [all …]
|
H A D | debug.c | 52 void ubi_dump_flash(struct ubi_device *ubi, int pnum, int offset, int len) in FAIL_ACTION() 57 loff_t addr = (loff_t)pnum * ubi->peb_size + offset; in FAIL_ACTION() 62 err = mtd_read(ubi->mtd, addr, len, &read, buf); in FAIL_ACTION() 64 ubi_err(ubi, "err %d while reading %d bytes from PEB %d:%d, read %zd bytes", in FAIL_ACTION() 69 ubi_msg(ubi, "dumping %d bytes of data from PEB %d, offset %d", in FAIL_ACTION() 333 struct ubi_device *ubi; in dfs_file_read() local 338 ubi = ubi_get_device(ubi_num); in dfs_file_read() 339 if (!ubi) in dfs_file_read() 341 d = &ubi->dbg; in dfs_file_read() 390 ubi_put_device(ubi); in dfs_file_read() [all …]
|
H A D | Makefile | 2 obj-$(CONFIG_MTD_UBI) += ubi.o 4 ubi-y += vtbl.o vmt.o upd.o build.o cdev.o kapi.o eba.o io.o wl.o attach.o 5 ubi-y += misc.o debug.o 6 ubi-$(CONFIG_MTD_UBI_FASTMAP) += fastmap.o 7 ubi-$(CONFIG_MTD_UBI_BLOCK) += block.o
|
/linux/Documentation/ABI/stable/ |
H A D | sysfs-class-ubi | 1 What: /sys/class/ubi/ 6 The ubi/ class sub-directory belongs to the UBI subsystem and 10 What: /sys/class/ubi/version 33 What: /sys/class/ubi/ubiX/avail_eraseblocks 42 What: /sys/class/ubi/ubiX/bad_peb_count 49 What: /sys/class/ubi/ubiX/bgt_enabled 57 What: /sys/class/ubi/ubiX/dev 65 What: /sys/class/ubi/ubiX/eraseblock_size 74 What: /sys/class/ubi/ubiX/max_ec 81 What: /sys/class/ubi/ubiX/max_vol_count [all …]
|
/linux/arch/arm/boot/dts/microchip/ |
H A D | at91-kizboxmini-common.dtsi | 15 bootargs = "ubi.mtd=ubi"; 152 ubi@20000 { 153 label = "ubi";
|
H A D | at91-kizbox.dts | 17 bootargs = "ubi.mtd=ubi"; 148 ubi@20000 { 149 label = "ubi";
|
H A D | at91-kizbox3_common.dtsi | 35 bootargs = "ubi.mtd=ubi"; 146 ubi@2A0000 { 147 label = "ubi";
|
H A D | at91-som60.dtsi | 206 ubi@e0000 { 207 label = "ubi";
|
/linux/fs/ubifs/ |
H A D | super.c | 1945 ubi_close_volume(c->ubi); in ubifs_put_super() 2039 struct ubi_volume_desc *ubi; in open_ubi() local 2045 ubi = ubi_open_volume_path(name, mode); in open_ubi() 2046 if (!IS_ERR(ubi)) in open_ubi() 2047 return ubi; in open_ubi() 2082 static struct ubifs_info *alloc_ubifs_info(struct ubi_volume_desc *ubi) in alloc_ubifs_info() argument 2125 ubi_get_volume_info(ubi, &c->vi); in alloc_ubifs_info() 2140 c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, UBI_READWRITE); in ubifs_fill_super() 2141 if (IS_ERR(c->ubi)) { in ubifs_fill_super() 2142 err = PTR_ERR(c->ubi); in ubifs_fill_super() [all …]
|
/linux/arch/arm/boot/dts/aspeed/ |
H A D | aspeed-bmc-opp-mowgli.dts | 308 obmc-ubi@80000 { 310 label = "obmc-ubi"; 331 obmc-ubi@80000 { 333 label = "alt-obmc-ubi";
|