Home
last modified time | relevance | path

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

12

/Linux-v5.10/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()
39 .start = nd_region->ndr_start, in nd_region_probe()
40 .end = nd_region->ndr_start + nd_region->ndr_size - 1, in nd_region_probe()
[all …]
Dnamespace_devs.c26 struct nd_region *nd_region = to_nd_region(dev->parent); in namespace_pmem_release() local
29 ida_simple_remove(&nd_region->ns_ida, nspm->id); in namespace_pmem_release()
38 struct nd_region *nd_region = to_nd_region(dev->parent); in namespace_blk_release() local
41 ida_simple_remove(&nd_region->ns_ida, nsblk->id); in namespace_blk_release()
107 struct nd_region *nd_region = to_nd_region(dev->parent); in pmem_should_map_pages() local
114 if (!test_bit(ND_REGION_PAGEMAP, &nd_region->flags)) in pmem_should_map_pages()
159 struct nd_region *nd_region = to_nd_region(ndns->dev.parent); in nvdimm_namespace_disk_name() local
176 sprintf(name, "pmem%d.%d%s", nd_region->id, nsidx, in nvdimm_namespace_disk_name()
179 sprintf(name, "pmem%d%s", nd_region->id, in nvdimm_namespace_disk_name()
185 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);
131 struct nd_region;
140 resource_size_t nd_pmem_max_contiguous_dpa(struct nd_region *nd_region,
142 resource_size_t nd_region_allocatable_dpa(struct nd_region *nd_region);
143 resource_size_t nd_pmem_available_dpa(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()
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 …]
Dnd.h138 struct nd_region { struct
159 int (*flush)(struct nd_region *nd_region, struct bio *bio); argument
168 struct nd_region nd_region; argument
279 struct device *nd_btt_create(struct nd_region *nd_region);
292 static inline struct device *nd_btt_create(struct nd_region *nd_region) in nd_btt_create() argument
305 struct device *nd_pfn_create(struct nd_region *nd_region);
322 static inline struct device *nd_pfn_create(struct nd_region *nd_region) in nd_pfn_create() argument
337 struct device *nd_dax_create(struct nd_region *nd_region);
350 static inline struct device *nd_dax_create(struct nd_region *nd_region) in nd_dax_create() argument
356 int nd_region_to_nstype(struct nd_region *nd_region);
[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()
182 static struct device *__nd_btt_create(struct nd_region *nd_region, in __nd_btt_create() argument
193 nd_btt->id = ida_simple_get(&nd_region->btt_ida, 0, 0, GFP_KERNEL); in __nd_btt_create()
205 dev_set_name(dev, "btt%d.%d", nd_region->id, nd_btt->id); in __nd_btt_create()
206 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 …]
Ddimm_devs.c216 struct nd_region *nd_region = &ndbr->nd_region; in nd_blk_region_to_dimm() local
217 struct nd_mapping *nd_mapping = &nd_region->mapping[0]; in nd_blk_region_to_dimm()
684 static unsigned long dpa_align(struct nd_region *nd_region) in dpa_align() argument
686 struct device *dev = &nd_region->dev; in dpa_align()
691 if (dev_WARN_ONCE(dev, !nd_region->ndr_mappings || nd_region->align in dpa_align()
692 % nd_region->ndr_mappings, in dpa_align()
694 nd_region->align, nd_region->ndr_mappings)) in dpa_align()
696 return nd_region->align / nd_region->ndr_mappings; in dpa_align()
704 struct nd_region *nd_region; in alias_dpa_busy() local
713 nd_region = to_nd_region(dev); in alias_dpa_busy()
[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()
316 static struct nd_pfn *nd_pfn_alloc(struct nd_region *nd_region) in nd_pfn_alloc() argument
325 nd_pfn->id = ida_simple_get(&nd_region->pfn_ida, 0, 0, GFP_KERNEL); in nd_pfn_alloc()
332 dev_set_name(dev, "pfn%d.%d", nd_region->id, nd_pfn->id); in nd_pfn_alloc()
334 dev->parent = &nd_region->dev; in nd_pfn_alloc()
339 struct device *nd_pfn_create(struct nd_region *nd_region) in nd_pfn_create() argument
344 if (!is_memory(&nd_region->dev)) in nd_pfn_create()
347 nd_pfn = nd_pfn_alloc(nd_region); in nd_pfn_create()
362 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,
Dpmem.c42 static struct nd_region *to_region(struct pmem_device *pmem) in to_region()
201 struct nd_region *nd_region = to_region(pmem); in pmem_submit_bio() local
204 ret = nvdimm_flush(nd_region, bio); in pmem_submit_bio()
225 ret = nvdimm_flush(nd_region, bio); in pmem_submit_bio()
375 struct nd_region *nd_region = to_nd_region(dev->parent); in pmem_attach_disk() local
412 fua = nvdimm_has_flush(nd_region); in pmem_attach_disk()
486 nvdimm_badblocks_populate(nd_region, &pmem->bb, &bb_range); in pmem_attach_disk()
489 if (is_nvdimm_sync(nd_region)) in pmem_attach_disk()
496 dax_write_cache(dax_dev, nvdimm_has_cache(nd_region)); in pmem_attach_disk()
593 struct nd_region *nd_region; in nd_pmem_notify() local
[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 …]
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 …]
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()
1588 u32 lbasize, u8 *uuid, struct nd_region *nd_region) in btt_init() argument
1605 btt->nd_region = nd_region; in btt_init()
1615 if (btt->init_state != INIT_READY && nd_region->ro) { in btt_init()
[all …]
Dbtt.h229 struct nd_region *nd_region; member
/Linux-v5.10/include/linux/
Dlibnvdimm.h117 struct nd_region;
130 int (*flush)(struct nd_region *nd_region, struct bio *bio);
259 struct nd_region *to_nd_region(struct device *dev);
260 struct device *nd_region_dev(struct nd_region *nd_region);
291 struct nd_region *nvdimm_pmem_region_create(struct nvdimm_bus *nvdimm_bus,
293 struct nd_region *nvdimm_blk_region_create(struct nvdimm_bus *nvdimm_bus,
295 struct nd_region *nvdimm_volatile_region_create(struct nvdimm_bus *nvdimm_bus,
297 void *nd_region_provider_data(struct nd_region *nd_region);
302 unsigned int nd_region_acquire_lane(struct nd_region *nd_region);
303 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.10/drivers/dax/pmem/
Dcore.c24 struct nd_region *nd_region = to_nd_region(dev->parent); in __dax_pmem_probe() local
57 nd_region->target_node, le32_to_cpu(pfn_sb->align), in __dax_pmem_probe()
/Linux-v5.10/drivers/acpi/nfit/
Dnfit.h165 struct nd_region *nd_region; member
306 struct nd_region *nd_region; member

12