| /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 static int get_flush_data(struct nd_region *nd_region, size_t *size, int *num_flush) in get_flush_data() argument 111 guard(nvdimm_bus)(&nd_region->dev); in get_flush_data() 112 for (i = 0; i < nd_region->ndr_mappings; i++) { in get_flush_data() [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 | dax_devs.c | 15 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 D | nd.h | 403 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); 622 static inline struct device *nd_dax_create(struct nd_region *nd_region) in nd_dax_create() argument [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() 176 static struct device *__nd_btt_create(struct nd_region *nd_region, in __nd_btt_create() argument 187 nd_btt->id = ida_alloc(&nd_region->btt_ida, GFP_KERNEL); in __nd_btt_create() 199 dev_set_name(dev, "btt%d.%d", nd_region->id, nd_btt->id); in __nd_btt_create() 200 dev->parent = &nd_region->dev; in __nd_btt_create() 213 ida_free(&nd_region->btt_ida, nd_btt->id); in __nd_btt_create() 220 struct device *nd_btt_create(struct nd_region *nd_region) in nd_btt_create() argument 222 struct device *dev = __nd_btt_create(nd_region, 0, NULL, NULL); in nd_btt_create() 333 struct nd_region *nd_region = to_nd_region(ndns->dev.parent); in nd_btt_probe() local [all …]
|
| H A D | pfn_devs.c | 20 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() 309 static struct nd_pfn *nd_pfn_alloc(struct nd_region *nd_region) in nd_pfn_alloc() argument 318 nd_pfn->id = ida_alloc(&nd_region->pfn_ida, GFP_KERNEL); in nd_pfn_alloc() 325 dev_set_name(dev, "pfn%d.%d", nd_region->id, nd_pfn->id); in nd_pfn_alloc() 327 dev->parent = &nd_region->dev; in nd_pfn_alloc() 332 struct device *nd_pfn_create(struct nd_region *nd_region) in nd_pfn_create() argument 337 if (!is_memory(&nd_region->dev)) in nd_pfn_create() 340 nd_pfn = nd_pfn_alloc(nd_region); in nd_pfn_create() 355 struct nd_region *nd_region = to_nd_region(nd_pfn->dev.parent); in nd_pfn_clear_memmap_errors() local [all …]
|
| H A D | nd_virtio.c | 38 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() 111 int async_pmem_flush(struct nd_region *nd_region, struct bio *bio) in async_pmem_flush() argument 130 if (virtio_pmem_flush(nd_region)) in async_pmem_flush()
|
| H A D | bus.c | 148 void nvdimm_region_notify(struct nd_region *nd_region, enum nvdimm_event event) in nvdimm_region_notify() argument 150 struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(&nd_region->dev); in nvdimm_region_notify() 156 nd_device_notify(&nd_region->dev, event); in nvdimm_region_notify() 167 struct nd_region *nd_region; in nvdimm_clear_badblocks_region() local 175 nd_region = to_nd_region(dev); in nvdimm_clear_badblocks_region() 176 ndr_end = nd_region->ndr_start + nd_region->ndr_size - 1; in nvdimm_clear_badblocks_region() 179 if (ctx->phys < nd_region->ndr_start || in nvdimm_clear_badblocks_region() 183 sector = (ctx->phys - nd_region->ndr_start) / 512; in nvdimm_clear_badblocks_region() 184 badblocks_clear(&nd_region->bb, sector, ctx->cleared / 512); in nvdimm_clear_badblocks_region() 186 if (nd_region->bb_state) in nvdimm_clear_badblocks_region() [all …]
|
| H A D | dimm_devs.c | 693 static unsigned long dpa_align(struct nd_region *nd_region) in dpa_align() argument 695 struct device *dev = &nd_region->dev; in dpa_align() 700 if (dev_WARN_ONCE(dev, !nd_region->ndr_mappings || nd_region->align in dpa_align() 701 % nd_region->ndr_mappings, in dpa_align() 703 nd_region->align, nd_region->ndr_mappings)) in dpa_align() 705 return nd_region->align / nd_region->ndr_mappings; in dpa_align() 717 resource_size_t nd_pmem_max_contiguous_dpa(struct nd_region *nd_region, in nd_pmem_max_contiguous_dpa() argument 730 align = dpa_align(nd_region); in nd_pmem_max_contiguous_dpa() 735 if (__reserve_free_pmem(&nd_region->dev, nd_mapping->nvdimm)) in nd_pmem_max_contiguous_dpa() 764 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() 874 static int __pmem_label_update(struct nd_region *nd_region, in __pmem_label_update() argument 879 struct nd_interleave_set *nd_set = nd_region->nd_set; in __pmem_label_update() 895 cookie = nd_region_interleave_set_cookie(nd_region, nsindex); in __pmem_label_update() 917 nsl_set_nlabel(ndd, nd_label, nd_region->ndr_mappings); in __pmem_label_update() 928 nd_dbg_dpa(nd_region, ndd, res, "\n"); in __pmem_label_update() 1057 int nd_pmem_namespace_label_update(struct nd_region *nd_region, in nd_pmem_namespace_label_update() argument 1062 for (i = 0; i < nd_region->ndr_mappings; i++) { in nd_pmem_namespace_label_update() 1063 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 | claim.c | 60 struct nd_region *nd_region = to_nd_region(dev->parent); in is_idle() local 64 seed = nd_region->btt_seed; in is_idle() 66 seed = nd_region->pfn_seed; in is_idle() 68 seed = nd_region->dax_seed; in is_idle()
|
| H A D | label.h | 222 struct nd_region; 224 int nd_pmem_namespace_label_update(struct nd_region *nd_region,
|
| 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/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 | 2184 struct nd_region *nd_region = to_nd_region(dev); in range_index_show() local 2185 struct nfit_spa *nfit_spa = nd_region_provider_data(nd_region); in range_index_show() 2438 struct nd_region *nd_region = nfit_spa->nd_region; in ars_complete() local 2470 if (nd_region) { in ars_complete() 2471 dev = nd_region_dev(nd_region); in ars_complete() 2472 nvdimm_region_notify(nd_region, NVDIMM_REVALIDATE_POISON); in ars_complete() 2614 if (nfit_spa->nd_region) in acpi_nfit_register_region() 2698 nfit_spa->nd_region = nvdimm_pmem_region_create(nvdimm_bus, in acpi_nfit_register_region() 2700 if (!nfit_spa->nd_region) in acpi_nfit_register_region() 2703 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/include/linux/ |
| H A D | nd.h | 194 struct nd_region; 195 void nvdimm_region_notify(struct nd_region *nd_region, enum nvdimm_event event);
|
| /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 682 nd_region = ctx.region; in nfit_test_search_spa() 684 dpa = ctx.addr - nd_region->ndr_start; in nfit_test_search_spa() 689 nd_mapping = &nd_region->mapping[nd_region->ndr_mappings - 1]; in nfit_test_search_spa()
|
| /linux/drivers/cxl/ |
| H A D | pmem.c | 380 static void unregister_nvdimm_region(void *nd_region) in unregister_nvdimm_region() argument 382 nvdimm_region_delete(nd_region); in unregister_nvdimm_region() 496 cxlr_pmem->nd_region = in cxl_pmem_region_probe() 498 if (!cxlr_pmem->nd_region) { in cxl_pmem_region_probe() 504 cxlr_pmem->nd_region); in cxl_pmem_region_probe()
|
| /linux/arch/powerpc/platforms/pseries/ |
| H A D | papr_scm.c | 68 struct nd_region *region; 91 static int papr_scm_pmem_flush(struct nd_region *nd_region, in papr_scm_pmem_flush() argument 94 struct papr_scm_priv *p = nd_region_provider_data(nd_region); in papr_scm_pmem_flush() 1298 static void papr_scm_add_badblock(struct nd_region *region, in papr_scm_add_badblock()
|