Home
last modified time | relevance | path

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

12

/Linux-v5.4/drivers/nvdimm/
Dregion_devs.c62 int nd_region_activate(struct nd_region *nd_region) in nd_region_activate() argument
66 struct device *dev = &nd_region->dev; in nd_region_activate()
69 nvdimm_bus_lock(&nd_region->dev); in nd_region_activate()
70 for (i = 0; i < nd_region->ndr_mappings; i++) { in nd_region_activate()
71 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in nd_region_activate()
75 nvdimm_bus_unlock(&nd_region->dev); in nd_region_activate()
86 nvdimm_bus_unlock(&nd_region->dev); in nd_region_activate()
97 for (i = 0; i < nd_region->ndr_mappings; i++) { in nd_region_activate()
98 struct nd_mapping *nd_mapping = &nd_region->mapping[i]; in nd_region_activate()
100 int rc = nvdimm_map_flush(&nd_region->dev, nvdimm, i, ndrd); in nd_region_activate()
[all …]
Dregion.c17 struct nd_region *nd_region = to_nd_region(dev); in nd_region_probe() local
19 if (nd_region->num_lanes > num_online_cpus() in nd_region_probe()
20 && nd_region->num_lanes < num_possible_cpus() in nd_region_probe()
23 num_online_cpus(), nd_region->num_lanes, in nd_region_probe()
26 nd_region->num_lanes); in nd_region_probe()
29 rc = nd_region_activate(nd_region); in nd_region_probe()
33 rc = nd_blk_region_init(nd_region); in nd_region_probe()
37 if (is_memory(&nd_region->dev)) { in nd_region_probe()
40 if (devm_init_badblocks(dev, &nd_region->bb)) in nd_region_probe()
42 nd_region->bb_state = sysfs_get_dirent(nd_region->dev.kobj.sd, in nd_region_probe()
[all …]
Dnamespace_devs.c25 struct nd_region *nd_region = to_nd_region(dev->parent); in namespace_pmem_release() local
28 ida_simple_remove(&nd_region->ns_ida, nspm->id); in namespace_pmem_release()
37 struct nd_region *nd_region = to_nd_region(dev->parent); in namespace_blk_release() local
40 ida_simple_remove(&nd_region->ns_ida, nsblk->id); in namespace_blk_release()
132 struct nd_region *nd_region = to_nd_region(dev->parent); in pmem_should_map_pages() local
139 if (!test_bit(ND_REGION_PAGEMAP, &nd_region->flags)) in pmem_should_map_pages()
184 struct nd_region *nd_region = to_nd_region(ndns->dev.parent); in nvdimm_namespace_disk_name() local
201 sprintf(name, "pmem%d.%d%s", nd_region->id, nsidx, in nvdimm_namespace_disk_name()
204 sprintf(name, "pmem%d%s", nd_region->id, in nvdimm_namespace_disk_name()
210 sprintf(name, "ndblk%d.%d%s", nd_region->id, nsblk->id, in nvdimm_namespace_disk_name()
[all …]
Dnd-core.h118 struct nd_region;
119 void nd_region_advance_seeds(struct nd_region *nd_region, struct device *dev);
120 void nd_region_create_ns_seed(struct nd_region *nd_region);
121 void nd_region_create_btt_seed(struct nd_region *nd_region);
122 void nd_region_create_pfn_seed(struct nd_region *nd_region);
123 void nd_region_create_dax_seed(struct nd_region *nd_region);
135 struct nd_region;
144 resource_size_t nd_pmem_max_contiguous_dpa(struct nd_region *nd_region,
146 resource_size_t nd_region_allocatable_dpa(struct nd_region *nd_region);
147 resource_size_t nd_pmem_available_dpa(struct nd_region *nd_region,
[all …]
Dnd.h138 struct nd_region { struct
158 int (*flush)(struct nd_region *nd_region, struct bio *bio); argument
167 struct nd_region nd_region; argument
270 struct device *nd_btt_create(struct nd_region *nd_region);
283 static inline struct device *nd_btt_create(struct nd_region *nd_region) in nd_btt_create() argument
296 struct device *nd_pfn_create(struct nd_region *nd_region);
313 static inline struct device *nd_pfn_create(struct nd_region *nd_region) in nd_pfn_create() argument
328 struct device *nd_dax_create(struct nd_region *nd_region);
341 static inline struct device *nd_dax_create(struct nd_region *nd_region) in nd_dax_create() argument
347 int nd_region_to_nstype(struct nd_region *nd_region);
[all …]
Ddax_devs.c15 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()
53 static struct nd_dax *nd_dax_alloc(struct nd_region *nd_region) in nd_dax_alloc() argument
64 nd_pfn->id = ida_simple_get(&nd_region->dax_ida, 0, 0, GFP_KERNEL); in nd_dax_alloc()
71 dev_set_name(dev, "dax%d.%d", nd_region->id, nd_pfn->id); in nd_dax_alloc()
74 dev->parent = &nd_region->dev; in nd_dax_alloc()
79 struct device *nd_dax_create(struct nd_region *nd_region) in nd_dax_create() argument
84 if (!is_memory(&nd_region->dev)) in nd_dax_create()
87 nd_dax = nd_dax_alloc(nd_region); in nd_dax_create()
101 struct nd_region *nd_region = to_nd_region(ndns->dev.parent); in nd_dax_probe() local
[all …]
Dbtt_devs.c18 struct nd_region *nd_region = to_nd_region(dev->parent); in nd_btt_release() local
23 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()
204 dev_set_name(dev, "btt%d.%d", nd_region->id, nd_btt->id); in __nd_btt_create()
205 dev->parent = &nd_region->dev; in __nd_btt_create()
218 ida_simple_remove(&nd_region->btt_ida, nd_btt->id); in __nd_btt_create()
225 struct device *nd_btt_create(struct nd_region *nd_region) in nd_btt_create() argument
227 struct device *dev = __nd_btt_create(nd_region, 0, NULL, NULL); in nd_btt_create()
336 struct nd_region *nd_region = to_nd_region(ndns->dev.parent); in nd_btt_probe() local
[all …]
Dpfn_devs.c19 struct nd_region *nd_region = to_nd_region(dev->parent); in nd_pfn_release() local
24 ida_simple_remove(&nd_region->pfn_ida, nd_pfn->id); in nd_pfn_release()
323 static struct nd_pfn *nd_pfn_alloc(struct nd_region *nd_region) in nd_pfn_alloc() argument
332 nd_pfn->id = ida_simple_get(&nd_region->pfn_ida, 0, 0, GFP_KERNEL); in nd_pfn_alloc()
339 dev_set_name(dev, "pfn%d.%d", nd_region->id, nd_pfn->id); in nd_pfn_alloc()
342 dev->parent = &nd_region->dev; in nd_pfn_alloc()
347 struct device *nd_pfn_create(struct nd_region *nd_region) in nd_pfn_create() argument
352 if (!is_memory(&nd_region->dev)) in nd_pfn_create()
355 nd_pfn = nd_pfn_alloc(nd_region); in nd_pfn_create()
370 struct nd_region *nd_region = to_nd_region(nd_pfn->dev.parent); in nd_pfn_clear_memmap_errors() local
[all …]
Dnd_virtio.c38 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
119 if (virtio_pmem_flush(nd_region)) in async_pmem_flush()
Dvirtio_pmem.c36 struct nd_region *nd_region; in virtio_pmem_probe() local
86 nd_region = nvdimm_pmem_region_create(vpmem->nvdimm_bus, &ndr_desc); in virtio_pmem_probe()
87 if (!nd_region) { in virtio_pmem_probe()
92 nd_region->provider_data = dev_to_virtio(nd_region->dev.parent->parent); in virtio_pmem_probe()
Dlabel.h139 struct nd_region;
142 int nd_pmem_namespace_label_update(struct nd_region *nd_region,
144 int nd_blk_namespace_label_update(struct nd_region *nd_region,
Ddimm_devs.c226 struct nd_region *nd_region = &ndbr->nd_region; in nd_blk_region_to_dimm() local
227 struct nd_mapping *nd_mapping = &nd_region->mapping[0]; in nd_blk_region_to_dimm()
564 struct nd_region *nd_region; in alias_dpa_busy() local
572 nd_region = to_nd_region(dev); in alias_dpa_busy()
573 for (i = 0; i < nd_region->ndr_mappings; i++) { in alias_dpa_busy()
574 nd_mapping = &nd_region->mapping[i]; in alias_dpa_busy()
579 if (i >= nd_region->ndr_mappings) in alias_dpa_busy()
639 resource_size_t nd_blk_available_dpa(struct nd_region *nd_region) in nd_blk_available_dpa() argument
641 struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(&nd_region->dev); in nd_blk_available_dpa()
642 struct nd_mapping *nd_mapping = &nd_region->mapping[0]; in nd_blk_available_dpa()
[all …]
Dpmem.c42 static struct nd_region *to_region(struct pmem_device *pmem) in to_region()
194 struct nd_region *nd_region = to_region(pmem); in pmem_make_request() local
197 ret = nvdimm_flush(nd_region, bio); in pmem_make_request()
212 ret = nvdimm_flush(nd_region, bio); in pmem_make_request()
356 struct nd_region *nd_region = to_nd_region(dev->parent); in pmem_attach_disk() local
389 fua = nvdimm_has_flush(nd_region); in pmem_attach_disk()
462 nvdimm_badblocks_populate(nd_region, &pmem->bb, &bb_res); in pmem_attach_disk()
465 if (is_nvdimm_sync(nd_region)) in pmem_attach_disk()
472 dax_write_cache(dax_dev, nvdimm_has_cache(nd_region)); in pmem_attach_disk()
564 struct nd_region *nd_region; in nd_pmem_notify() local
[all …]
Dlabel.c386 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()
759 static int __pmem_label_update(struct nd_region *nd_region, in __pmem_label_update() argument
764 struct nd_interleave_set *nd_set = nd_region->nd_set; in __pmem_label_update()
780 cookie = nd_region_interleave_set_cookie(nd_region, nsindex); in __pmem_label_update()
803 nd_label->nlabel = __cpu_to_le16(nd_region->ndr_mappings); in __pmem_label_update()
823 nd_dbg_dpa(nd_region, ndd, res, "\n"); in __pmem_label_update()
897 static int __blk_label_update(struct nd_region *nd_region, in __blk_label_update() argument
902 struct nd_interleave_set *nd_set = nd_region->nd_set; in __blk_label_update()
977 if (!nsblk_add_resource(nd_region, ndd, nsblk, res->start)) { in __blk_label_update()
[all …]
Dbus.c159 void nvdimm_region_notify(struct nd_region *nd_region, enum nvdimm_event event) in nvdimm_region_notify() argument
161 struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(&nd_region->dev); in nvdimm_region_notify()
167 nd_device_notify(&nd_region->dev, event); in nvdimm_region_notify()
178 struct nd_region *nd_region; in nvdimm_clear_badblocks_region() local
186 nd_region = to_nd_region(dev); in nvdimm_clear_badblocks_region()
187 ndr_end = nd_region->ndr_start + nd_region->ndr_size - 1; in nvdimm_clear_badblocks_region()
190 if (ctx->phys < nd_region->ndr_start in nvdimm_clear_badblocks_region()
194 sector = (ctx->phys - nd_region->ndr_start) / 512; in nvdimm_clear_badblocks_region()
195 badblocks_clear(&nd_region->bb, sector, ctx->cleared / 512); in nvdimm_clear_badblocks_region()
197 if (nd_region->bb_state) in nvdimm_clear_badblocks_region()
[all …]
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()
Dblk.c54 struct nd_region *nd_region; in to_ndbr() local
58 nd_region = container_of(parent, struct nd_region, dev); in to_ndbr()
59 return container_of(nd_region, struct nd_blk_region, nd_region); in to_ndbr()
Dvirtio_pmem.h54 int async_pmem_flush(struct nd_region *nd_region, struct bio *bio);
Dclaim.c78 struct nd_region *nd_region = to_nd_region(dev->parent); in is_idle() local
82 seed = nd_region->btt_seed; in is_idle()
84 seed = nd_region->pfn_seed; in is_idle()
86 seed = nd_region->dax_seed; in is_idle()
Dbtt.c1209 lane = nd_region_acquire_lane(btt->nd_region); in btt_read_pg()
1279 nd_region_release_lane(btt->nd_region, lane); in btt_read_pg()
1291 nd_region_release_lane(btt->nd_region, lane); in btt_read_pg()
1325 lane = nd_region_acquire_lane(btt->nd_region); in btt_write_pg()
1342 nd_region_release_lane(btt->nd_region, lane); in btt_write_pg()
1403 nd_region_release_lane(btt->nd_region, lane); in btt_write_pg()
1421 nd_region_release_lane(btt->nd_region, lane); in btt_write_pg()
1592 u32 lbasize, u8 *uuid, struct nd_region *nd_region) in btt_init() argument
1609 btt->nd_region = nd_region; in btt_init()
1619 if (btt->init_state != INIT_READY && nd_region->ro) { in btt_init()
[all …]
Dbtt.h229 struct nd_region *nd_region; member
/Linux-v5.4/include/linux/
Dlibnvdimm.h120 struct nd_region;
133 int (*flush)(struct nd_region *nd_region, struct bio *bio);
219 struct nd_region *to_nd_region(struct device *dev);
220 struct device *nd_region_dev(struct nd_region *nd_region);
250 struct nd_region *nvdimm_pmem_region_create(struct nvdimm_bus *nvdimm_bus,
252 struct nd_region *nvdimm_blk_region_create(struct nvdimm_bus *nvdimm_bus,
254 struct nd_region *nvdimm_volatile_region_create(struct nvdimm_bus *nvdimm_bus,
256 void *nd_region_provider_data(struct nd_region *nd_region);
261 unsigned int nd_region_acquire_lane(struct nd_region *nd_region);
262 void nd_region_release_lane(struct nd_region *nd_region, unsigned int lane);
[all …]
Dnd.h171 struct nd_region;
172 void nvdimm_region_notify(struct nd_region *nd_region, enum nvdimm_event event);
/Linux-v5.4/drivers/dax/pmem/
Dcore.c23 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-v5.4/drivers/acpi/nfit/
Dnfit.h143 struct nd_region *nd_region; member
275 struct nd_region *nd_region; member

12