/Linux-v4.19/drivers/nvdimm/ |
D | region_devs.c | 70 int nd_region_activate(struct nd_region *nd_region) in nd_region_activate() argument 74 struct device *dev = &nd_region->dev; in nd_region_activate() 77 nvdimm_bus_lock(&nd_region->dev); in nd_region_activate() 78 for (i = 0; i < nd_region->ndr_mappings; i++) { in nd_region_activate() 79 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in nd_region_activate() 89 nvdimm_bus_unlock(&nd_region->dev); in nd_region_activate() 100 for (i = 0; i < nd_region->ndr_mappings; i++) { in nd_region_activate() 101 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in nd_region_activate() 103 int rc = nvdimm_map_flush(&nd_region->dev, nvdimm, i, ndrd); in nd_region_activate() 113 for (i = 0; i < nd_region->ndr_mappings - 1; i++) { in nd_region_activate() [all …]
|
D | region.c | 25 struct nd_region *nd_region = to_nd_region(dev); in nd_region_probe() local 27 if (nd_region->num_lanes > num_online_cpus() in nd_region_probe() 28 && nd_region->num_lanes < num_possible_cpus() in nd_region_probe() 31 num_online_cpus(), nd_region->num_lanes, in nd_region_probe() 34 nd_region->num_lanes); in nd_region_probe() 37 rc = nd_region_activate(nd_region); in nd_region_probe() 41 rc = nd_blk_region_init(nd_region); in nd_region_probe() 45 rc = nd_region_register_namespaces(nd_region, &err); in nd_region_probe() 56 if (is_nd_pmem(&nd_region->dev)) { in nd_region_probe() 59 if (devm_init_badblocks(dev, &nd_region->bb)) in nd_region_probe() [all …]
|
D | namespace_devs.c | 33 struct nd_region *nd_region = to_nd_region(dev->parent); in namespace_pmem_release() local 36 ida_simple_remove(&nd_region->ns_ida, nspm->id); in namespace_pmem_release() 45 struct nd_region *nd_region = to_nd_region(dev->parent); in namespace_blk_release() local 48 ida_simple_remove(&nd_region->ns_ida, nsblk->id); in namespace_blk_release() 140 struct nd_region *nd_region = to_nd_region(dev->parent); in pmem_should_map_pages() local 146 if (!test_bit(ND_REGION_PAGEMAP, &nd_region->flags)) in pmem_should_map_pages() 188 struct nd_region *nd_region = to_nd_region(ndns->dev.parent); in nvdimm_namespace_disk_name() local 205 sprintf(name, "pmem%d.%d%s", nd_region->id, nsidx, in nvdimm_namespace_disk_name() 208 sprintf(name, "pmem%d%s", nd_region->id, in nvdimm_namespace_disk_name() 214 sprintf(name, "ndblk%d.%d%s", nd_region->id, nsblk->id, in nvdimm_namespace_disk_name() [all …]
|
D | nd-core.h | 82 struct nd_region; 83 void nd_region_create_ns_seed(struct nd_region *nd_region); 84 void nd_region_create_btt_seed(struct nd_region *nd_region); 85 void nd_region_create_pfn_seed(struct nd_region *nd_region); 86 void nd_region_create_dax_seed(struct nd_region *nd_region); 99 struct nd_region; 108 resource_size_t nd_pmem_max_contiguous_dpa(struct nd_region *nd_region, 110 resource_size_t nd_region_allocatable_dpa(struct nd_region *nd_region); 111 resource_size_t nd_pmem_available_dpa(struct nd_region *nd_region, 113 resource_size_t nd_blk_available_dpa(struct nd_region *nd_region); [all …]
|
D | dax_devs.c | 23 struct nd_region *nd_region = to_nd_region(dev->parent); in nd_dax_release() local 29 ida_simple_remove(&nd_region->dax_ida, nd_pfn->id); in nd_dax_release() 61 static struct nd_dax *nd_dax_alloc(struct nd_region *nd_region) in nd_dax_alloc() argument 72 nd_pfn->id = ida_simple_get(&nd_region->dax_ida, 0, 0, GFP_KERNEL); in nd_dax_alloc() 79 dev_set_name(dev, "dax%d.%d", nd_region->id, nd_pfn->id); in nd_dax_alloc() 82 dev->parent = &nd_region->dev; in nd_dax_alloc() 87 struct device *nd_dax_create(struct nd_region *nd_region) in nd_dax_create() argument 92 if (!is_memory(&nd_region->dev)) in nd_dax_create() 95 nd_dax = nd_dax_alloc(nd_region); in nd_dax_create() 109 struct nd_region *nd_region = to_nd_region(ndns->dev.parent); in nd_dax_probe() local [all …]
|
D | nd.h | 142 struct nd_region { struct 170 struct nd_region nd_region; argument 262 struct device *nd_btt_create(struct nd_region *nd_region); 275 static inline struct device *nd_btt_create(struct nd_region *nd_region) in nd_btt_create() argument 292 struct device *nd_pfn_create(struct nd_region *nd_region); 309 static inline struct device *nd_pfn_create(struct nd_region *nd_region) in nd_pfn_create() argument 324 struct device *nd_dax_create(struct nd_region *nd_region); 337 static inline struct device *nd_dax_create(struct nd_region *nd_region) in nd_dax_create() argument 343 int nd_region_to_nstype(struct nd_region *nd_region); 344 int nd_region_register_namespaces(struct nd_region *nd_region, int *err); [all …]
|
D | btt_devs.c | 26 struct nd_region *nd_region = to_nd_region(dev->parent); in nd_btt_release() local 31 ida_simple_remove(&nd_region->btt_ida, nd_btt->id); in nd_btt_release() 181 static struct device *__nd_btt_create(struct nd_region *nd_region, in __nd_btt_create() argument 192 nd_btt->id = ida_simple_get(&nd_region->btt_ida, 0, 0, GFP_KERNEL); in __nd_btt_create() 203 dev_set_name(dev, "btt%d.%d", nd_region->id, nd_btt->id); in __nd_btt_create() 204 dev->parent = &nd_region->dev; in __nd_btt_create() 217 struct device *nd_btt_create(struct nd_region *nd_region) in nd_btt_create() argument 219 struct device *dev = __nd_btt_create(nd_region, 0, NULL, NULL); in nd_btt_create() 328 struct nd_region *nd_region = to_nd_region(ndns->dev.parent); in nd_btt_probe() local 343 btt_dev = __nd_btt_create(nd_region, 0, NULL, ndns); in nd_btt_probe()
|
D | dimm_devs.c | 241 struct nd_region *nd_region = &ndbr->nd_region; in nd_blk_region_to_dimm() local 242 struct nd_mapping *nd_mapping = &nd_region->mapping[0]; in nd_blk_region_to_dimm() 437 struct nd_region *nd_region; in alias_dpa_busy() local 445 nd_region = to_nd_region(dev); in alias_dpa_busy() 446 for (i = 0; i < nd_region->ndr_mappings; i++) { in alias_dpa_busy() 447 nd_mapping = &nd_region->mapping[i]; in alias_dpa_busy() 452 if (i >= nd_region->ndr_mappings) in alias_dpa_busy() 512 resource_size_t nd_blk_available_dpa(struct nd_region *nd_region) in nd_blk_available_dpa() argument 514 struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(&nd_region->dev); in nd_blk_available_dpa() 515 struct nd_mapping *nd_mapping = &nd_region->mapping[0]; in nd_blk_available_dpa() [all …]
|
D | label.h | 151 struct nd_region; 154 int nd_pmem_namespace_label_update(struct nd_region *nd_region, 156 int nd_blk_namespace_label_update(struct nd_region *nd_region,
|
D | pfn_devs.c | 27 struct nd_region *nd_region = to_nd_region(dev->parent); in nd_pfn_release() local 32 ida_simple_remove(&nd_region->pfn_ida, nd_pfn->id); in nd_pfn_release() 325 static struct nd_pfn *nd_pfn_alloc(struct nd_region *nd_region) in nd_pfn_alloc() argument 334 nd_pfn->id = ida_simple_get(&nd_region->pfn_ida, 0, 0, GFP_KERNEL); in nd_pfn_alloc() 341 dev_set_name(dev, "pfn%d.%d", nd_region->id, nd_pfn->id); in nd_pfn_alloc() 344 dev->parent = &nd_region->dev; in nd_pfn_alloc() 349 struct device *nd_pfn_create(struct nd_region *nd_region) in nd_pfn_create() argument 354 if (!is_memory(&nd_region->dev)) in nd_pfn_create() 357 nd_pfn = nd_pfn_alloc(nd_region); in nd_pfn_create() 490 struct nd_region *nd_region = to_nd_region(ndns->dev.parent); in nd_pfn_probe() local [all …]
|
D | pmem.c | 50 static struct nd_region *to_region(struct pmem_device *pmem) in to_region() 201 struct nd_region *nd_region = to_region(pmem); in pmem_make_request() local 204 nvdimm_flush(nd_region); in pmem_make_request() 219 nvdimm_flush(nd_region); in pmem_make_request() 352 struct nd_region *nd_region = to_nd_region(dev->parent); in pmem_attach_disk() local 384 fua = nvdimm_has_flush(nd_region); in pmem_attach_disk() 463 nvdimm_badblocks_populate(nd_region, &pmem->bb, &bb_res); in pmem_attach_disk() 471 dax_write_cache(dax_dev, nvdimm_has_cache(nd_region)); in pmem_attach_disk() 543 struct nd_region *nd_region; in nd_pmem_notify() local 558 nd_region = to_nd_region(ndns->dev.parent); in nd_pmem_notify() [all …]
|
D | label.c | 388 struct nd_region *nd_region = NULL; in nd_label_reserve_dpa() local 405 nd_dbg_dpa(nd_region, ndd, res, "reserve\n"); in nd_label_reserve_dpa() 626 static int __pmem_label_update(struct nd_region *nd_region, in __pmem_label_update() argument 631 struct nd_interleave_set *nd_set = nd_region->nd_set; in __pmem_label_update() 647 cookie = nd_region_interleave_set_cookie(nd_region, nsindex); in __pmem_label_update() 670 nd_label->nlabel = __cpu_to_le16(nd_region->ndr_mappings); in __pmem_label_update() 690 nd_dbg_dpa(nd_region, ndd, res, "\n"); in __pmem_label_update() 772 static int __blk_label_update(struct nd_region *nd_region, in __blk_label_update() argument 777 struct nd_interleave_set *nd_set = nd_region->nd_set; in __blk_label_update() 853 if (!nsblk_add_resource(nd_region, ndd, nsblk, res->start)) { in __blk_label_update() [all …]
|
D | bus.c | 168 void nvdimm_region_notify(struct nd_region *nd_region, enum nvdimm_event event) in nvdimm_region_notify() argument 170 struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(&nd_region->dev); in nvdimm_region_notify() 176 nd_device_notify(&nd_region->dev, event); in nvdimm_region_notify() 187 struct nd_region *nd_region; in nvdimm_clear_badblocks_region() local 195 nd_region = to_nd_region(dev); in nvdimm_clear_badblocks_region() 196 ndr_end = nd_region->ndr_start + nd_region->ndr_size - 1; in nvdimm_clear_badblocks_region() 199 if (ctx->phys < nd_region->ndr_start in nvdimm_clear_badblocks_region() 203 sector = (ctx->phys - nd_region->ndr_start) / 512; in nvdimm_clear_badblocks_region() 204 badblocks_clear(&nd_region->bb, sector, ctx->cleared / 512); in nvdimm_clear_badblocks_region() 206 if (nd_region->bb_state) in nvdimm_clear_badblocks_region() [all …]
|
D | badrange.c | 277 void nvdimm_badblocks_populate(struct nd_region *nd_region, in nvdimm_badblocks_populate() argument 282 if (!is_memory(&nd_region->dev)) { in nvdimm_badblocks_populate() 283 dev_WARN_ONCE(&nd_region->dev, 1, in nvdimm_badblocks_populate() 287 nvdimm_bus = walk_to_nvdimm_bus(&nd_region->dev); in nvdimm_badblocks_populate()
|
D | blk.c | 62 struct nd_region *nd_region; in to_ndbr() local 66 nd_region = container_of(parent, struct nd_region, dev); in to_ndbr() 67 return container_of(nd_region, struct nd_blk_region, nd_region); in to_ndbr()
|
D | claim.c | 86 struct nd_region *nd_region = to_nd_region(dev->parent); in is_idle() local 90 seed = nd_region->btt_seed; in is_idle() 92 seed = nd_region->pfn_seed; in is_idle() 94 seed = nd_region->dax_seed; in is_idle()
|
D | btt.c | 1208 lane = nd_region_acquire_lane(btt->nd_region); in btt_read_pg() 1278 nd_region_release_lane(btt->nd_region, lane); in btt_read_pg() 1290 nd_region_release_lane(btt->nd_region, lane); in btt_read_pg() 1324 lane = nd_region_acquire_lane(btt->nd_region); in btt_write_pg() 1341 nd_region_release_lane(btt->nd_region, lane); in btt_write_pg() 1402 nd_region_release_lane(btt->nd_region, lane); in btt_write_pg() 1420 nd_region_release_lane(btt->nd_region, lane); in btt_write_pg() 1591 u32 lbasize, u8 *uuid, struct nd_region *nd_region) in btt_init() argument 1608 btt->nd_region = nd_region; in btt_init() 1618 if (btt->init_state != INIT_READY && nd_region->ro) { in btt_init() [all …]
|
D | btt.h | 235 struct nd_region *nd_region; member
|
D | of_pmem.c | 62 struct nd_region *region; in of_pmem_region_probe()
|
/Linux-v4.19/include/linux/ |
D | libnvdimm.h | 169 struct nd_region *to_nd_region(struct device *dev); 170 struct device *nd_region_dev(struct nd_region *nd_region); 190 struct nd_region *nvdimm_pmem_region_create(struct nvdimm_bus *nvdimm_bus, 192 struct nd_region *nvdimm_blk_region_create(struct nvdimm_bus *nvdimm_bus, 194 struct nd_region *nvdimm_volatile_region_create(struct nvdimm_bus *nvdimm_bus, 196 void *nd_region_provider_data(struct nd_region *nd_region); 201 unsigned int nd_region_acquire_lane(struct nd_region *nd_region); 202 void nd_region_release_lane(struct nd_region *nd_region, unsigned int lane); 204 void nvdimm_flush(struct nd_region *nd_region); 205 int nvdimm_has_flush(struct nd_region *nd_region); [all …]
|
D | nd.h | 179 struct nd_region; 180 void nvdimm_region_notify(struct nd_region *nd_region, enum nvdimm_event event);
|
/Linux-v4.19/drivers/acpi/nfit/ |
D | nfit.h | 130 struct nd_region *nd_region; member 246 struct nd_region *nd_region; member
|
D | core.c | 1989 struct nd_region *nd_region = to_nd_region(dev); in range_index_show() local 1990 struct nfit_spa *nfit_spa = nd_region_provider_data(nd_region); in range_index_show() 2237 nvdimm_flush(nfit_blk->nd_region); in write_blk_ctl() 2286 nvdimm_flush(nfit_blk->nd_region); in acpi_nfit_blk_single_io() 2297 struct nd_region *nd_region = nfit_blk->nd_region; in acpi_nfit_blk_region_do_io() local 2301 lane = nd_region_acquire_lane(nd_region); in acpi_nfit_blk_region_do_io() 2313 nd_region_release_lane(nd_region, lane); in acpi_nfit_blk_region_do_io() 2380 nfit_blk->nd_region = to_nd_region(dev); in acpi_nfit_blk_region_enable() 2434 if (nvdimm_has_flush(nfit_blk->nd_region) < 0) in acpi_nfit_blk_region_enable() 2534 struct nd_region *nd_region = nfit_spa->nd_region; in ars_complete() local [all …]
|
D | mce.c | 72 nvdimm_region_notify(nfit_spa->nd_region, in nfit_handle_mce()
|
/Linux-v4.19/tools/testing/nvdimm/test/ |
D | nfit.c | 626 struct nd_region *region; 637 struct nd_region *nd_region; in nfit_test_search_region_spa() local 643 nd_region = to_nd_region(dev); in nfit_test_search_region_spa() 644 ndr_end = nd_region->ndr_start + nd_region->ndr_size; in nfit_test_search_region_spa() 646 if (ctx->addr >= nd_region->ndr_start && ctx->addr < ndr_end) { in nfit_test_search_region_spa() 647 ctx->region = nd_region; in nfit_test_search_region_spa() 658 struct nd_region *nd_region = NULL; in nfit_test_search_spa() local 673 nd_region = ctx.region; in nfit_test_search_spa() 675 dpa = ctx.addr - nd_region->ndr_start; in nfit_test_search_spa() 680 nd_mapping = &nd_region->mapping[nd_region->ndr_mappings - 1]; in nfit_test_search_spa() [all …]
|