Home
last modified time | relevance | path

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

12

/linux/drivers/nvdimm/
H A Dregion_devs.c63 static int nd_region_invalidate_memregion(struct nd_region *nd_region) in nd_region_invalidate_memregion() argument
67 for (i = 0; i < nd_region->ndr_mappings; i++) { in nd_region_invalidate_memregion()
68 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in nd_region_invalidate_memregion()
83 &nd_region->dev, in nd_region_invalidate_memregion()
87 dev_err(&nd_region->dev, in nd_region_invalidate_memregion()
95 for (i = 0; i < nd_region->ndr_mappings; i++) { in nd_region_invalidate_memregion()
96 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in nd_region_invalidate_memregion()
105 int nd_region_activate(struct nd_region *nd_region) in nd_region_activate() argument
109 struct device *dev = &nd_region->dev; in nd_region_activate()
112 nvdimm_bus_lock(&nd_region->dev); in nd_region_activate()
[all …]
H A Dregion.c18 struct nd_region *nd_region = to_nd_region(dev); in nd_region_probe() local
20 .start = nd_region->ndr_start, in nd_region_probe()
21 .end = nd_region->ndr_start + nd_region->ndr_size - 1, in nd_region_probe()
24 if (nd_region->num_lanes > num_online_cpus() in nd_region_probe()
25 && nd_region->num_lanes < num_possible_cpus() in nd_region_probe()
28 num_online_cpus(), nd_region->num_lanes, in nd_region_probe()
31 nd_region->num_lanes); in nd_region_probe()
34 rc = nd_region_activate(nd_region); in nd_region_probe()
38 if (devm_init_badblocks(dev, &nd_region->bb)) in nd_region_probe()
40 nd_region->bb_state = in nd_region_probe()
[all …]
H A Dnd-core.h100 struct nd_region;
101 void nd_region_advance_seeds(struct nd_region *nd_region, struct device *dev);
102 void nd_region_create_ns_seed(struct nd_region *nd_region);
103 void nd_region_create_btt_seed(struct nd_region *nd_region);
104 void nd_region_create_pfn_seed(struct nd_region *nd_region);
105 void nd_region_create_dax_seed(struct nd_region *nd_region);
115 struct nd_region;
124 resource_size_t nd_pmem_max_contiguous_dpa(struct nd_region *nd_region,
126 resource_size_t nd_region_allocatable_dpa(struct nd_region *nd_region);
127 resource_size_t nd_pmem_available_dpa(struct nd_region *nd_region,
[all …]
H A Ddax_devs.c15 struct nd_region *nd_region = to_nd_region(dev->parent); in nd_dax_release() local
21 ida_free(&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_alloc(&nd_region->dax_ida, 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 …]
H A Dnd.h403 struct nd_region { struct
424 int (*flush)(struct nd_region *nd_region, struct bio *bio); argument
428 static inline bool nsl_validate_nlabel(struct nd_region *nd_region, in nsl_validate_nlabel() argument
434 return nsl_get_nlabel(ndd, nd_label) == nd_region->ndr_mappings; in nsl_validate_nlabel()
544 struct device *nd_btt_create(struct nd_region *nd_region);
557 static inline struct device *nd_btt_create(struct nd_region *nd_region) in nd_btt_create() argument
570 struct device *nd_pfn_create(struct nd_region *nd_region);
587 static inline struct device *nd_pfn_create(struct nd_region *nd_region) in nd_pfn_create() argument
602 struct device *nd_dax_create(struct nd_region *nd_region);
615 static inline struct device *nd_dax_create(struct nd_region *nd_region) in nd_dax_create() argument
[all …]
H A Dbtt_devs.c17 struct nd_region *nd_region = to_nd_region(dev->parent); in nd_btt_release() local
22 ida_free(&nd_region->btt_ida, nd_btt->id); in nd_btt_release()
183 static struct device *__nd_btt_create(struct nd_region *nd_region, in __nd_btt_create() argument
194 nd_btt->id = ida_alloc(&nd_region->btt_ida, GFP_KERNEL); in __nd_btt_create()
206 dev_set_name(dev, "btt%d.%d", nd_region->id, nd_btt->id); in __nd_btt_create()
207 dev->parent = &nd_region->dev; in __nd_btt_create()
220 ida_free(&nd_region->btt_ida, nd_btt->id); in __nd_btt_create()
227 struct device *nd_btt_create(struct nd_region *nd_region) in nd_btt_create() argument
229 struct device *dev = __nd_btt_create(nd_region, 0, NULL, NULL); in nd_btt_create()
340 struct nd_region *nd_region = to_nd_region(ndns->dev.parent); in nd_btt_probe() local
[all …]
H A Dpfn_devs.c20 struct nd_region *nd_region = to_nd_region(dev->parent); in nd_pfn_release() local
25 ida_free(&nd_region->pfn_ida, nd_pfn->id); in nd_pfn_release()
320 static struct nd_pfn *nd_pfn_alloc(struct nd_region *nd_region) in nd_pfn_alloc() argument
329 nd_pfn->id = ida_alloc(&nd_region->pfn_ida, GFP_KERNEL); in nd_pfn_alloc()
336 dev_set_name(dev, "pfn%d.%d", nd_region->id, nd_pfn->id); in nd_pfn_alloc()
338 dev->parent = &nd_region->dev; in nd_pfn_alloc()
343 struct device *nd_pfn_create(struct nd_region *nd_region) in nd_pfn_create() argument
348 if (!is_memory(&nd_region->dev)) in nd_pfn_create()
351 nd_pfn = nd_pfn_alloc(nd_region); in nd_pfn_create()
366 struct nd_region *nd_region = to_nd_region(nd_pfn->dev.parent); in nd_pfn_clear_memmap_errors() local
[all …]
H A Dbus.c151 void nvdimm_region_notify(struct nd_region *nd_region, enum nvdimm_event event) in nvdimm_region_notify() argument
153 struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(&nd_region->dev); in nvdimm_region_notify()
159 nd_device_notify(&nd_region->dev, event); in nvdimm_region_notify()
170 struct nd_region *nd_region; in nvdimm_clear_badblocks_region() local
178 nd_region = to_nd_region(dev); in nvdimm_clear_badblocks_region()
179 ndr_end = nd_region->ndr_start + nd_region->ndr_size - 1; in nvdimm_clear_badblocks_region()
182 if (ctx->phys < nd_region->ndr_start || in nvdimm_clear_badblocks_region()
186 sector = (ctx->phys - nd_region->ndr_start) / 512; in nvdimm_clear_badblocks_region()
187 badblocks_clear(&nd_region->bb, sector, ctx->cleared / 512); in nvdimm_clear_badblocks_region()
189 if (nd_region->bb_state) in nvdimm_clear_badblocks_region()
[all …]
H A Ddimm_devs.c707 static unsigned long dpa_align(struct nd_region *nd_region) in dpa_align() argument
709 struct device *dev = &nd_region->dev; in dpa_align()
714 if (dev_WARN_ONCE(dev, !nd_region->ndr_mappings || nd_region->align in dpa_align()
715 % nd_region->ndr_mappings, in dpa_align()
717 nd_region->align, nd_region->ndr_mappings)) in dpa_align()
719 return nd_region->align / nd_region->ndr_mappings; in dpa_align()
731 resource_size_t nd_pmem_max_contiguous_dpa(struct nd_region *nd_region, in nd_pmem_max_contiguous_dpa() argument
744 align = dpa_align(nd_region); in nd_pmem_max_contiguous_dpa()
749 if (__reserve_free_pmem(&nd_region->dev, nd_mapping->nvdimm)) in nd_pmem_max_contiguous_dpa()
778 resource_size_t nd_pmem_available_dpa(struct nd_region *nd_region, in nd_pmem_available_dpa() argument
[all …]
H A Dpmem.c44 static struct nd_region *to_region(struct pmem_device *pmem) in to_region()
210 struct nd_region *nd_region = to_region(pmem); in pmem_submit_bio() local
213 ret = nvdimm_flush(nd_region, bio); in pmem_submit_bio()
234 ret = nvdimm_flush(nd_region, bio); in pmem_submit_bio()
453 struct nd_region *nd_region = to_nd_region(dev->parent); in pmem_attach_disk() local
494 fua = nvdimm_has_flush(nd_region); in pmem_attach_disk()
557 nvdimm_badblocks_populate(nd_region, &pmem->bb, &bb_range); in pmem_attach_disk()
568 if (is_nvdimm_sync(nd_region)) in pmem_attach_disk()
574 dax_write_cache(dax_dev, nvdimm_has_cache(nd_region)); in pmem_attach_disk()
676 struct nd_region *nd_region; in pmem_revalidate_poison() local
[all …]
H A Dlabel.c409 struct nd_region *nd_region = NULL; in nd_label_reserve_dpa() local
426 nd_dbg_dpa(nd_region, ndd, res, "reserve\n"); in nd_label_reserve_dpa()
873 static int __pmem_label_update(struct nd_region *nd_region, in __pmem_label_update() argument
878 struct nd_interleave_set *nd_set = nd_region->nd_set; in __pmem_label_update()
894 cookie = nd_region_interleave_set_cookie(nd_region, nsindex); in __pmem_label_update()
916 nsl_set_nlabel(ndd, nd_label, nd_region->ndr_mappings); in __pmem_label_update()
927 nd_dbg_dpa(nd_region, ndd, res, "\n"); in __pmem_label_update()
1056 int nd_pmem_namespace_label_update(struct nd_region *nd_region, in nd_pmem_namespace_label_update() argument
1061 for (i = 0; i < nd_region->ndr_mappings; i++) { in nd_pmem_namespace_label_update()
1062 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in nd_pmem_namespace_label_update()
[all …]
H A 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()
H A Dvirtio_pmem.h54 int async_pmem_flush(struct nd_region *nd_region, struct bio *bio);
H A Dlabel.h222 struct nd_region;
224 int nd_pmem_namespace_label_update(struct nd_region *nd_region,
H A 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()
H A Dbtt.c1203 lane = nd_region_acquire_lane(btt->nd_region); in btt_read_pg()
1273 nd_region_release_lane(btt->nd_region, lane); in btt_read_pg()
1285 nd_region_release_lane(btt->nd_region, lane); in btt_read_pg()
1319 lane = nd_region_acquire_lane(btt->nd_region); in btt_write_pg()
1336 nd_region_release_lane(btt->nd_region, lane); in btt_write_pg()
1397 nd_region_release_lane(btt->nd_region, lane); in btt_write_pg()
1415 nd_region_release_lane(btt->nd_region, lane); in btt_write_pg()
1562 struct nd_region *nd_region) in btt_init() argument
1579 btt->nd_region = nd_region; in btt_init()
1589 if (btt->init_state != INIT_READY && nd_region->ro) { in btt_init()
[all …]
H A Dbtt.h228 struct nd_region *nd_region; member
/linux/include/linux/
H A Dlibnvdimm.h124 struct nd_region;
138 int (*flush)(struct nd_region *nd_region, struct bio *bio);
253 struct nd_region *to_nd_region(struct device *dev);
254 struct device *nd_region_dev(struct nd_region *nd_region);
276 void nvdimm_region_delete(struct nd_region *nd_region);
286 struct nd_region *nvdimm_pmem_region_create(struct nvdimm_bus *nvdimm_bus,
288 struct nd_region *nvdimm_blk_region_create(struct nvdimm_bus *nvdimm_bus,
290 struct nd_region *nvdimm_volatile_region_create(struct nvdimm_bus *nvdimm_bus,
292 void *nd_region_provider_data(struct nd_region *nd_region);
293 unsigned int nd_region_acquire_lane(struct nd_region *nd_region);
[all …]
H A Dnd.h194 struct nd_region;
195 void nvdimm_region_notify(struct nd_region *nd_region, enum nvdimm_event event);
/linux/drivers/acpi/nfit/
H A Dnfit.h165 struct nd_region *nd_region; member
300 struct nd_region *nd_region; member
H A Dcore.c2171 struct nd_region *nd_region = to_nd_region(dev); in range_index_show() local
2172 struct nfit_spa *nfit_spa = nd_region_provider_data(nd_region); in range_index_show()
2425 struct nd_region *nd_region = nfit_spa->nd_region; in ars_complete() local
2457 if (nd_region) { in ars_complete()
2458 dev = nd_region_dev(nd_region); in ars_complete()
2459 nvdimm_region_notify(nd_region, NVDIMM_REVALIDATE_POISON); in ars_complete()
2601 if (nfit_spa->nd_region) in acpi_nfit_register_region()
2685 nfit_spa->nd_region = nvdimm_pmem_region_create(nvdimm_bus, in acpi_nfit_register_region()
2687 if (!nfit_spa->nd_region) in acpi_nfit_register_region()
2690 nfit_spa->nd_region = nvdimm_volatile_region_create(nvdimm_bus, in acpi_nfit_register_region()
[all …]
H A Dmce.c68 nvdimm_region_notify(nfit_spa->nd_region, in nfit_handle_mce()
/linux/tools/testing/nvdimm/test/
H A Dndtest.h36 struct nd_region *blk_region;
62 struct nd_region *region;
H A Dnfit.c634 struct nd_region *region;
645 struct nd_region *nd_region; in nfit_test_search_region_spa() local
651 nd_region = to_nd_region(dev); in nfit_test_search_region_spa()
652 ndr_end = nd_region->ndr_start + nd_region->ndr_size; in nfit_test_search_region_spa()
654 if (ctx->addr >= nd_region->ndr_start && ctx->addr < ndr_end) { in nfit_test_search_region_spa()
655 ctx->region = nd_region; in nfit_test_search_region_spa()
666 struct nd_region *nd_region = NULL; in nfit_test_search_spa() local
681 nd_region = ctx.region; in nfit_test_search_spa()
683 dpa = ctx.addr - nd_region->ndr_start; in nfit_test_search_spa()
688 nd_mapping = &nd_region->mapping[nd_region->ndr_mappings - 1]; in nfit_test_search_spa()
H A Dndtest.c389 struct nd_region *nd_region = to_nd_region(dev); in range_index_show() local
390 struct ndtest_region *region = nd_region_provider_data(nd_region); in range_index_show()

12