/linux/drivers/nvdimm/ |
H A D | region_devs.c | 63 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 D | region.c | 18 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 D | namespace_devs.c | 27 struct nd_region *nd_region = to_nd_region(dev->parent); in namespace_pmem_release() local 30 ida_free(&nd_region->ns_ida, nspm->id); in namespace_pmem_release() 92 struct nd_region *nd_region = to_nd_region(dev->parent); in pmem_should_map_pages() local 99 if (!test_bit(ND_REGION_PAGEMAP, &nd_region->flags)) in pmem_should_map_pages() 144 struct nd_region *nd_region = to_nd_region(ndns->dev.parent); in nvdimm_namespace_disk_name() local 161 sprintf(name, "pmem%d.%d%s", nd_region->id, nsidx, in nvdimm_namespace_disk_name() 164 sprintf(name, "pmem%d%s", nd_region->id, in nvdimm_namespace_disk_name() 188 struct nd_region *nd_region = to_nd_region(dev->parent); in nstype_show() local 190 return sprintf(buf, "%d\n", nd_region_to_nstype(nd_region)); in nstype_show() 235 static int nd_namespace_label_update(struct nd_region *nd_region, in nd_namespace_label_update() argument [all …]
|
H A D | nd-core.h | 100 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 D | btt_devs.c | 17 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 D | bus.c | 151 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 D | dimm_devs.c | 707 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 D | label.c | 409 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 D | badrange.c | 269 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 D | virtio_pmem.h | 54 int async_pmem_flush(struct nd_region *nd_region, struct bio *bio);
|
H A D | label.h | 222 struct nd_region; 224 int nd_pmem_namespace_label_update(struct nd_region *nd_region,
|
H A D | claim.c | 79 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 D | btt.c | 1203 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 D | btt.h | 228 struct nd_region *nd_region; member
|
H A D | of_pmem.c | 56 struct nd_region *region; in of_pmem_region_probe()
|
/linux/include/linux/ |
H A D | libnvdimm.h | 124 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 D | nd.h | 194 struct nd_region; 195 void nvdimm_region_notify(struct nd_region *nd_region, enum nvdimm_event event);
|
/linux/drivers/acpi/nfit/ |
H A D | nfit.h | 165 struct nd_region *nd_region; member 300 struct nd_region *nd_region; member
|
H A D | core.c | 2176 struct nd_region *nd_region = to_nd_region(dev); in range_index_show() local 2177 struct nfit_spa *nfit_spa = nd_region_provider_data(nd_region); in range_index_show() 2430 struct nd_region *nd_region = nfit_spa->nd_region; in ars_complete() local 2462 if (nd_region) { in ars_complete() 2463 dev = nd_region_dev(nd_region); in ars_complete() 2464 nvdimm_region_notify(nd_region, NVDIMM_REVALIDATE_POISON); in ars_complete() 2606 if (nfit_spa->nd_region) in acpi_nfit_register_region() 2690 nfit_spa->nd_region = nvdimm_pmem_region_create(nvdimm_bus, in acpi_nfit_register_region() 2692 if (!nfit_spa->nd_region) in acpi_nfit_register_region() 2695 nfit_spa->nd_region = nvdimm_volatile_region_create(nvdimm_bus, in acpi_nfit_register_region() [all …]
|
H A D | mce.c | 68 nvdimm_region_notify(nfit_spa->nd_region, in nfit_handle_mce()
|
/linux/tools/testing/nvdimm/test/ |
H A D | ndtest.h | 36 struct nd_region *blk_region; 62 struct nd_region *region;
|
H A D | nfit.c | 634 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 D | ndtest.c | 389 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()
|
/linux/drivers/cxl/ |
H A D | pmem.c | 291 static void unregister_nvdimm_region(void *nd_region) in unregister_nvdimm_region() argument 293 nvdimm_region_delete(nd_region); in unregister_nvdimm_region() 399 cxlr_pmem->nd_region = in cxl_pmem_region_probe() 401 if (!cxlr_pmem->nd_region) { in cxl_pmem_region_probe() 407 cxlr_pmem->nd_region); in cxl_pmem_region_probe()
|
H A D | cxl.h | 578 struct nd_region *nd_region; member
|