/Linux-v6.6/drivers/nvdimm/ |
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 …]
|
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 …]
|
D | namespace_devs.c | 27 struct nd_region *nd_region = to_nd_region(dev->parent); in namespace_pmem_release() local 30 ida_simple_remove(&nd_region->ns_ida, nspm->id); in namespace_pmem_release() 90 struct nd_region *nd_region = to_nd_region(dev->parent); in pmem_should_map_pages() local 97 if (!test_bit(ND_REGION_PAGEMAP, &nd_region->flags)) in pmem_should_map_pages() 142 struct nd_region *nd_region = to_nd_region(ndns->dev.parent); in nvdimm_namespace_disk_name() local 159 sprintf(name, "pmem%d.%d%s", nd_region->id, nsidx, in nvdimm_namespace_disk_name() 162 sprintf(name, "pmem%d%s", nd_region->id, in nvdimm_namespace_disk_name() 186 struct nd_region *nd_region = to_nd_region(dev->parent); in nstype_show() local 188 return sprintf(buf, "%d\n", nd_region_to_nstype(nd_region)); in nstype_show() 233 static int nd_namespace_label_update(struct nd_region *nd_region, in nd_namespace_label_update() argument [all …]
|
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 …]
|
D | dax_devs.c | 15 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 …]
|
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() 545 struct device *nd_btt_create(struct nd_region *nd_region); 558 static inline struct device *nd_btt_create(struct nd_region *nd_region) in nd_btt_create() argument 571 struct device *nd_pfn_create(struct nd_region *nd_region); 588 static inline struct device *nd_pfn_create(struct nd_region *nd_region) in nd_pfn_create() argument 603 struct device *nd_dax_create(struct nd_region *nd_region); 616 static inline struct device *nd_dax_create(struct nd_region *nd_region) in nd_dax_create() argument [all …]
|
D | btt_devs.c | 17 struct nd_region *nd_region = to_nd_region(dev->parent); in nd_btt_release() local 22 ida_simple_remove(&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_simple_get(&nd_region->btt_ida, 0, 0, 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_simple_remove(&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 …]
|
D | pfn_devs.c | 20 struct nd_region *nd_region = to_nd_region(dev->parent); in nd_pfn_release() local 25 ida_simple_remove(&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_simple_get(&nd_region->pfn_ida, 0, 0, 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 …]
|
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() 101 int async_pmem_flush(struct nd_region *nd_region, struct bio *bio) in async_pmem_flush() argument 120 if (virtio_pmem_flush(nd_region)) in async_pmem_flush()
|
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 …]
|
D | dimm_devs.c | 705 static unsigned long dpa_align(struct nd_region *nd_region) in dpa_align() argument 707 struct device *dev = &nd_region->dev; in dpa_align() 712 if (dev_WARN_ONCE(dev, !nd_region->ndr_mappings || nd_region->align in dpa_align() 713 % nd_region->ndr_mappings, in dpa_align() 715 nd_region->align, nd_region->ndr_mappings)) in dpa_align() 717 return nd_region->align / nd_region->ndr_mappings; in dpa_align() 726 resource_size_t nd_pmem_max_contiguous_dpa(struct nd_region *nd_region, in nd_pmem_max_contiguous_dpa() argument 739 align = dpa_align(nd_region); in nd_pmem_max_contiguous_dpa() 744 if (__reserve_free_pmem(&nd_region->dev, nd_mapping->nvdimm)) in nd_pmem_max_contiguous_dpa() 771 resource_size_t nd_pmem_available_dpa(struct nd_region *nd_region, in nd_pmem_available_dpa() argument [all …]
|
D | pmem.c | 44 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 488 fua = nvdimm_has_flush(nd_region); in pmem_attach_disk() 557 nvdimm_badblocks_populate(nd_region, &pmem->bb, &bb_range); in pmem_attach_disk() 567 if (is_nvdimm_sync(nd_region)) in pmem_attach_disk() 572 dax_write_cache(dax_dev, nvdimm_has_cache(nd_region)); in pmem_attach_disk() 675 struct nd_region *nd_region; in pmem_revalidate_poison() local [all …]
|
D | virtio_pmem.c | 35 struct nd_region *nd_region; in virtio_pmem_probe() local 100 nd_region = nvdimm_pmem_region_create(vpmem->nvdimm_bus, &ndr_desc); in virtio_pmem_probe() 101 if (!nd_region) { in virtio_pmem_probe()
|
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 …]
|
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()
|
D | virtio_pmem.h | 54 int async_pmem_flush(struct nd_region *nd_region, struct bio *bio);
|
D | label.h | 222 struct nd_region; 224 int nd_pmem_namespace_label_update(struct nd_region *nd_region,
|
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()
|
D | btt.c | 1207 lane = nd_region_acquire_lane(btt->nd_region); in btt_read_pg() 1277 nd_region_release_lane(btt->nd_region, lane); in btt_read_pg() 1289 nd_region_release_lane(btt->nd_region, lane); in btt_read_pg() 1323 lane = nd_region_acquire_lane(btt->nd_region); in btt_write_pg() 1340 nd_region_release_lane(btt->nd_region, lane); in btt_write_pg() 1401 nd_region_release_lane(btt->nd_region, lane); in btt_write_pg() 1419 nd_region_release_lane(btt->nd_region, lane); in btt_write_pg() 1566 struct nd_region *nd_region) in btt_init() argument 1583 btt->nd_region = nd_region; in btt_init() 1593 if (btt->init_state != INIT_READY && nd_region->ro) { in btt_init() [all …]
|
/Linux-v6.6/include/linux/ |
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 …]
|
D | nd.h | 198 struct nd_region; 199 void nvdimm_region_notify(struct nd_region *nd_region, enum nvdimm_event event);
|
/Linux-v6.6/drivers/dax/ |
D | pmem.c | 23 struct nd_region *nd_region = to_nd_region(dev->parent); in __dax_pmem_probe() local 56 nd_region->target_node, le32_to_cpu(pfn_sb->align), in __dax_pmem_probe()
|
/Linux-v6.6/drivers/acpi/nfit/ |
D | nfit.h | 165 struct nd_region *nd_region; member 300 struct nd_region *nd_region; member
|
/Linux-v6.6/tools/testing/nvdimm/test/ |
D | ndtest.h | 67 struct nd_region *blk_region; 93 struct nd_region *region;
|
/Linux-v6.6/drivers/cxl/ |
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()
|