Lines Matching refs:cxlrd
311 static bool can_create_pmem(struct cxl_root_decoder *cxlrd) in can_create_pmem() argument
315 return (cxlrd->cxlsd.cxld.flags & flags) == flags; in can_create_pmem()
321 struct cxl_root_decoder *cxlrd = to_cxl_root_decoder(dev); in cxl_root_decoder_visible() local
323 if (a == CXL_REGION_ATTR(create_pmem_region) && !can_create_pmem(cxlrd)) in cxl_root_decoder_visible()
326 if (a == CXL_REGION_ATTR(delete_region) && !can_create_pmem(cxlrd)) in cxl_root_decoder_visible()
417 struct cxl_root_decoder *cxlrd = to_cxl_root_decoder(dev); in cxl_root_decoder_release() local
419 if (atomic_read(&cxlrd->region_id) >= 0) in cxl_root_decoder_release()
420 memregion_free(atomic_read(&cxlrd->region_id)); in cxl_root_decoder_release()
421 __cxl_decoder_release(&cxlrd->cxlsd.cxld); in cxl_root_decoder_release()
422 kfree(cxlrd); in cxl_root_decoder_release()
1431 static struct cxl_dport *cxl_hb_modulo(struct cxl_root_decoder *cxlrd, int pos) in cxl_hb_modulo() argument
1433 struct cxl_switch_decoder *cxlsd = &cxlrd->cxlsd; in cxl_hb_modulo()
1442 return cxlrd->cxlsd.target[pos % iw]; in cxl_hb_modulo()
1514 struct cxl_root_decoder *cxlrd; in cxl_root_decoder_alloc() local
1522 cxlrd = kzalloc(struct_size(cxlrd, cxlsd.target, nr_targets), in cxl_root_decoder_alloc()
1524 if (!cxlrd) in cxl_root_decoder_alloc()
1527 cxlsd = &cxlrd->cxlsd; in cxl_root_decoder_alloc()
1530 kfree(cxlrd); in cxl_root_decoder_alloc()
1534 cxlrd->calc_hb = cxl_hb_modulo; in cxl_root_decoder_alloc()
1542 atomic_set(&cxlrd->region_id, -1); in cxl_root_decoder_alloc()
1549 atomic_set(&cxlrd->region_id, rc); in cxl_root_decoder_alloc()
1550 return cxlrd; in cxl_root_decoder_alloc()