Home
last modified time | relevance | path

Searched refs:nd_region (Results 1 – 25 of 26) sorted by relevance

12

/drivers/nvdimm/
Dregion_devs.c62 int nd_region_activate(struct nd_region *nd_region) in nd_region_activate() argument
66 struct device *dev = &nd_region->dev; in nd_region_activate()
69 nvdimm_bus_lock(&nd_region->dev); in nd_region_activate()
70 for (i = 0; i < nd_region->ndr_mappings; i++) { in nd_region_activate()
71 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in nd_region_activate()
75 nvdimm_bus_unlock(&nd_region->dev); in nd_region_activate()
86 nvdimm_bus_unlock(&nd_region->dev); in nd_region_activate()
97 for (i = 0; i < nd_region->ndr_mappings; i++) { in nd_region_activate()
98 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in nd_region_activate()
100 int rc = nvdimm_map_flush(&nd_region->dev, nvdimm, i, ndrd); in nd_region_activate()
[all …]
Dregion.c17 struct nd_region *nd_region = to_nd_region(dev); in nd_region_probe() local
19 if (nd_region->num_lanes > num_online_cpus() in nd_region_probe()
20 && nd_region->num_lanes < num_possible_cpus() in nd_region_probe()
23 num_online_cpus(), nd_region->num_lanes, in nd_region_probe()
26 nd_region->num_lanes); in nd_region_probe()
29 rc = nd_region_activate(nd_region); in nd_region_probe()
33 rc = nd_blk_region_init(nd_region); in nd_region_probe()
37 if (is_memory(&nd_region->dev)) { in nd_region_probe()
39 .start = nd_region->ndr_start, in nd_region_probe()
40 .end = nd_region->ndr_start + nd_region->ndr_size - 1, in nd_region_probe()
[all …]
Dnamespace_devs.c26 struct nd_region *nd_region = to_nd_region(dev->parent); in namespace_pmem_release() local
29 ida_simple_remove(&nd_region->ns_ida, nspm->id); in namespace_pmem_release()
38 struct nd_region *nd_region = to_nd_region(dev->parent); in namespace_blk_release() local
41 ida_simple_remove(&nd_region->ns_ida, nsblk->id); in namespace_blk_release()
107 struct nd_region *nd_region = to_nd_region(dev->parent); in pmem_should_map_pages() local
114 if (!test_bit(ND_REGION_PAGEMAP, &nd_region->flags)) in pmem_should_map_pages()
159 struct nd_region *nd_region = to_nd_region(ndns->dev.parent); in nvdimm_namespace_disk_name() local
176 sprintf(name, "pmem%d.%d%s", nd_region->id, nsidx, in nvdimm_namespace_disk_name()
179 sprintf(name, "pmem%d%s", nd_region->id, in nvdimm_namespace_disk_name()
185 sprintf(name, "ndblk%d.%d%s", nd_region->id, nsblk->id, in nvdimm_namespace_disk_name()
[all …]
Dnd-core.h118 struct nd_region;
119 void nd_region_advance_seeds(struct nd_region *nd_region, struct device *dev);
120 void nd_region_create_ns_seed(struct nd_region *nd_region);
121 void nd_region_create_btt_seed(struct nd_region *nd_region);
122 void nd_region_create_pfn_seed(struct nd_region *nd_region);
123 void nd_region_create_dax_seed(struct nd_region *nd_region);
131 struct nd_region;
140 resource_size_t nd_pmem_max_contiguous_dpa(struct nd_region *nd_region,
142 resource_size_t nd_region_allocatable_dpa(struct nd_region *nd_region);
143 resource_size_t nd_pmem_available_dpa(struct nd_region *nd_region,
[all …]
Ddax_devs.c15 struct nd_region *nd_region = to_nd_region(dev->parent); in nd_dax_release() local
21 ida_simple_remove(&nd_region->dax_ida, nd_pfn->id); in nd_dax_release()
47 static struct nd_dax *nd_dax_alloc(struct nd_region *nd_region) in nd_dax_alloc() argument
58 nd_pfn->id = ida_simple_get(&nd_region->dax_ida, 0, 0, GFP_KERNEL); in nd_dax_alloc()
65 dev_set_name(dev, "dax%d.%d", nd_region->id, nd_pfn->id); in nd_dax_alloc()
67 dev->parent = &nd_region->dev; in nd_dax_alloc()
72 struct device *nd_dax_create(struct nd_region *nd_region) in nd_dax_create() argument
77 if (!is_memory(&nd_region->dev)) in nd_dax_create()
80 nd_dax = nd_dax_alloc(nd_region); in nd_dax_create()
94 struct nd_region *nd_region = to_nd_region(ndns->dev.parent); in nd_dax_probe() local
[all …]
Dnd.h288 struct nd_region { struct
309 int (*flush)(struct nd_region *nd_region, struct bio *bio); argument
318 struct nd_region nd_region; argument
429 struct device *nd_btt_create(struct nd_region *nd_region);
442 static inline struct device *nd_btt_create(struct nd_region *nd_region) in nd_btt_create() argument
455 struct device *nd_pfn_create(struct nd_region *nd_region);
472 static inline struct device *nd_pfn_create(struct nd_region *nd_region) in nd_pfn_create() argument
487 struct device *nd_dax_create(struct nd_region *nd_region);
500 static inline struct device *nd_dax_create(struct nd_region *nd_region) in nd_dax_create() argument
506 int nd_region_to_nstype(struct nd_region *nd_region);
[all …]
Ddimm_devs.c216 struct nd_region *nd_region = &ndbr->nd_region; in nd_blk_region_to_dimm() local
217 struct nd_mapping *nd_mapping = &nd_region->mapping[0]; in nd_blk_region_to_dimm()
714 static unsigned long dpa_align(struct nd_region *nd_region) in dpa_align() argument
716 struct device *dev = &nd_region->dev; in dpa_align()
721 if (dev_WARN_ONCE(dev, !nd_region->ndr_mappings || nd_region->align in dpa_align()
722 % nd_region->ndr_mappings, in dpa_align()
724 nd_region->align, nd_region->ndr_mappings)) in dpa_align()
726 return nd_region->align / nd_region->ndr_mappings; in dpa_align()
734 struct nd_region *nd_region; in alias_dpa_busy() local
743 nd_region = to_nd_region(dev); in alias_dpa_busy()
[all …]
Dbtt_devs.c18 struct nd_region *nd_region = to_nd_region(dev->parent); in nd_btt_release() local
23 ida_simple_remove(&nd_region->btt_ida, nd_btt->id); in nd_btt_release()
182 static struct device *__nd_btt_create(struct nd_region *nd_region, in __nd_btt_create() argument
193 nd_btt->id = ida_simple_get(&nd_region->btt_ida, 0, 0, GFP_KERNEL); in __nd_btt_create()
205 dev_set_name(dev, "btt%d.%d", nd_region->id, nd_btt->id); in __nd_btt_create()
206 dev->parent = &nd_region->dev; in __nd_btt_create()
218 ida_simple_remove(&nd_region->btt_ida, nd_btt->id); in __nd_btt_create()
225 struct device *nd_btt_create(struct nd_region *nd_region) in nd_btt_create() argument
227 struct device *dev = __nd_btt_create(nd_region, 0, NULL, NULL); in nd_btt_create()
336 struct nd_region *nd_region = to_nd_region(ndns->dev.parent); in nd_btt_probe() local
[all …]
Dpfn_devs.c19 struct nd_region *nd_region = to_nd_region(dev->parent); in nd_pfn_release() local
24 ida_simple_remove(&nd_region->pfn_ida, nd_pfn->id); in nd_pfn_release()
316 static struct nd_pfn *nd_pfn_alloc(struct nd_region *nd_region) in nd_pfn_alloc() argument
325 nd_pfn->id = ida_simple_get(&nd_region->pfn_ida, 0, 0, GFP_KERNEL); in nd_pfn_alloc()
332 dev_set_name(dev, "pfn%d.%d", nd_region->id, nd_pfn->id); in nd_pfn_alloc()
334 dev->parent = &nd_region->dev; in nd_pfn_alloc()
339 struct device *nd_pfn_create(struct nd_region *nd_region) in nd_pfn_create() argument
344 if (!is_memory(&nd_region->dev)) in nd_pfn_create()
347 nd_pfn = nd_pfn_alloc(nd_region); in nd_pfn_create()
362 struct nd_region *nd_region = to_nd_region(nd_pfn->dev.parent); in nd_pfn_clear_memmap_errors() local
[all …]
Dvirtio_pmem.c36 struct nd_region *nd_region; in virtio_pmem_probe() local
86 nd_region = nvdimm_pmem_region_create(vpmem->nvdimm_bus, &ndr_desc); in virtio_pmem_probe()
87 if (!nd_region) { in virtio_pmem_probe()
92 nd_region->provider_data = dev_to_virtio(nd_region->dev.parent->parent); in virtio_pmem_probe()
Dnd_virtio.c38 static int virtio_pmem_flush(struct nd_region *nd_region) in virtio_pmem_flush() argument
40 struct virtio_device *vdev = nd_region->provider_data; in virtio_pmem_flush()
101 int async_pmem_flush(struct nd_region *nd_region, struct bio *bio) in async_pmem_flush() argument
119 if (virtio_pmem_flush(nd_region)) in async_pmem_flush()
Dbus.c157 void nvdimm_region_notify(struct nd_region *nd_region, enum nvdimm_event event) in nvdimm_region_notify() argument
159 struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(&nd_region->dev); in nvdimm_region_notify()
165 nd_device_notify(&nd_region->dev, event); in nvdimm_region_notify()
176 struct nd_region *nd_region; in nvdimm_clear_badblocks_region() local
184 nd_region = to_nd_region(dev); in nvdimm_clear_badblocks_region()
185 ndr_end = nd_region->ndr_start + nd_region->ndr_size - 1; in nvdimm_clear_badblocks_region()
188 if (ctx->phys < nd_region->ndr_start || in nvdimm_clear_badblocks_region()
192 sector = (ctx->phys - nd_region->ndr_start) / 512; in nvdimm_clear_badblocks_region()
193 badblocks_clear(&nd_region->bb, sector, ctx->cleared / 512); in nvdimm_clear_badblocks_region()
195 if (nd_region->bb_state) in nvdimm_clear_badblocks_region()
[all …]
Dpmem.c43 static struct nd_region *to_region(struct pmem_device *pmem) in to_region()
202 struct nd_region *nd_region = to_region(pmem); in pmem_submit_bio() local
205 ret = nvdimm_flush(nd_region, bio); in pmem_submit_bio()
226 ret = nvdimm_flush(nd_region, bio); in pmem_submit_bio()
351 struct nd_region *nd_region = to_nd_region(dev->parent); in pmem_attach_disk() local
387 fua = nvdimm_has_flush(nd_region); in pmem_attach_disk()
453 nvdimm_badblocks_populate(nd_region, &pmem->bb, &bb_range); in pmem_attach_disk()
456 if (is_nvdimm_sync(nd_region)) in pmem_attach_disk()
463 dax_write_cache(dax_dev, nvdimm_has_cache(nd_region)); in pmem_attach_disk()
558 struct nd_region *nd_region; in pmem_revalidate_poison() local
[all …]
Dlabel.h138 struct nd_region;
141 int nd_pmem_namespace_label_update(struct nd_region *nd_region,
143 int nd_blk_namespace_label_update(struct nd_region *nd_region,
Dlabel.c402 struct nd_region *nd_region = NULL; in nd_label_reserve_dpa() local
421 nd_dbg_dpa(nd_region, ndd, res, "reserve\n"); in nd_label_reserve_dpa()
814 static int __pmem_label_update(struct nd_region *nd_region, in __pmem_label_update() argument
819 struct nd_interleave_set *nd_set = nd_region->nd_set; in __pmem_label_update()
835 cookie = nd_region_interleave_set_cookie(nd_region, nsindex); in __pmem_label_update()
857 nsl_set_nlabel(ndd, nd_label, nd_region->ndr_mappings); in __pmem_label_update()
867 nd_dbg_dpa(nd_region, ndd, res, "\n"); in __pmem_label_update()
994 static int __blk_label_update(struct nd_region *nd_region, in __blk_label_update() argument
999 struct nd_interleave_set *nd_set = nd_region->nd_set; in __blk_label_update()
1074 if (!nsblk_add_resource(nd_region, ndd, nsblk, res->start)) { in __blk_label_update()
[all …]
Dblk.c54 struct nd_region *nd_region; in to_ndbr() local
58 nd_region = container_of(parent, struct nd_region, dev); in to_ndbr()
59 return container_of(nd_region, struct nd_blk_region, nd_region); in to_ndbr()
Dbadrange.c269 void nvdimm_badblocks_populate(struct nd_region *nd_region, in nvdimm_badblocks_populate() argument
274 if (!is_memory(&nd_region->dev)) { in nvdimm_badblocks_populate()
275 dev_WARN_ONCE(&nd_region->dev, 1, in nvdimm_badblocks_populate()
279 nvdimm_bus = walk_to_nvdimm_bus(&nd_region->dev); in nvdimm_badblocks_populate()
Dclaim.c79 struct nd_region *nd_region = to_nd_region(dev->parent); in is_idle() local
83 seed = nd_region->btt_seed; in is_idle()
85 seed = nd_region->pfn_seed; in is_idle()
87 seed = nd_region->dax_seed; in is_idle()
Dvirtio_pmem.h54 int async_pmem_flush(struct nd_region *nd_region, struct bio *bio);
Dbtt.c1210 lane = nd_region_acquire_lane(btt->nd_region); in btt_read_pg()
1280 nd_region_release_lane(btt->nd_region, lane); in btt_read_pg()
1292 nd_region_release_lane(btt->nd_region, lane); in btt_read_pg()
1326 lane = nd_region_acquire_lane(btt->nd_region); in btt_write_pg()
1343 nd_region_release_lane(btt->nd_region, lane); in btt_write_pg()
1404 nd_region_release_lane(btt->nd_region, lane); in btt_write_pg()
1422 nd_region_release_lane(btt->nd_region, lane); in btt_write_pg()
1577 u32 lbasize, u8 *uuid, struct nd_region *nd_region) in btt_init() argument
1594 btt->nd_region = nd_region; in btt_init()
1604 if (btt->init_state != INIT_READY && nd_region->ro) { in btt_init()
[all …]
Dbtt.h228 struct nd_region *nd_region; member
/drivers/dax/pmem/
Dcore.c24 struct nd_region *nd_region = to_nd_region(dev->parent); in __dax_pmem_probe() local
57 nd_region->target_node, le32_to_cpu(pfn_sb->align), in __dax_pmem_probe()
/drivers/acpi/nfit/
Dnfit.h165 struct nd_region *nd_region; member
306 struct nd_region *nd_region; member
Dcore.c2256 struct nd_region *nd_region = to_nd_region(dev); in range_index_show() local
2257 struct nfit_spa *nfit_spa = nd_region_provider_data(nd_region); in range_index_show()
2480 nvdimm_flush(nfit_blk->nd_region, NULL); in write_blk_ctl()
2529 nvdimm_flush(nfit_blk->nd_region, NULL); in acpi_nfit_blk_single_io()
2540 struct nd_region *nd_region = nfit_blk->nd_region; in acpi_nfit_blk_region_do_io() local
2544 lane = nd_region_acquire_lane(nd_region); in acpi_nfit_blk_region_do_io()
2556 nd_region_release_lane(nd_region, lane); in acpi_nfit_blk_region_do_io()
2623 nfit_blk->nd_region = to_nd_region(dev); in acpi_nfit_blk_region_enable()
2677 if (nvdimm_has_flush(nfit_blk->nd_region) < 0) in acpi_nfit_blk_region_enable()
2781 struct nd_region *nd_region = nfit_spa->nd_region; in ars_complete() local
[all …]
Dmce.c68 nvdimm_region_notify(nfit_spa->nd_region, in nfit_handle_mce()

12