/drivers/misc/cxl/ |
D | native.c | 24 static int afu_control(struct cxl_afu *afu, u64 command, u64 clear, in afu_control() argument 31 spin_lock(&afu->afu_cntl_lock); in afu_control() 34 trace_cxl_afu_ctrl(afu, command); in afu_control() 36 AFU_Cntl = cxl_p2n_read(afu, CXL_AFU_Cntl_An); in afu_control() 37 cxl_p2n_write(afu, CXL_AFU_Cntl_An, (AFU_Cntl & ~clear) | command); in afu_control() 39 AFU_Cntl = cxl_p2n_read(afu, CXL_AFU_Cntl_An); in afu_control() 42 dev_warn(&afu->dev, "WARNING: AFU control timed out!\n"); in afu_control() 47 if (!cxl_ops->link_ok(afu->adapter, afu)) { in afu_control() 48 afu->enabled = enabled; in afu_control() 56 AFU_Cntl = cxl_p2n_read(afu, CXL_AFU_Cntl_An); in afu_control() [all …]
|
D | guest.c | 22 static void pci_error_handlers(struct cxl_afu *afu, in pci_error_handlers() argument 28 if (afu->phb == NULL) in pci_error_handlers() 31 list_for_each_entry(afu_dev, &afu->phb->bus->devices, bus_list) { in pci_error_handlers() 63 dev_crit(&ctx->afu->dev, "PSL ERROR STATUS: 0x%.16llx\n", errstat); in guest_handle_psl_slice_error() 68 static ssize_t guest_collect_vpd(struct cxl *adapter, struct cxl_afu *afu, in guest_collect_vpd() argument 118 rc = cxl_h_collect_vpd(afu->guest->handle, 0, in guest_collect_vpd() 156 return cxl_h_collect_int_info(ctx->afu->guest->handle, ctx->process_token, info); in guest_get_irq_info() 176 static int afu_read_error_state(struct cxl_afu *afu, int *state_out) in afu_read_error_state() argument 181 if (!afu) in afu_read_error_state() 184 rc = cxl_h_read_error_state(afu->guest->handle, &state); in afu_read_error_state() [all …]
|
D | pci.c | 95 #define AFUD_READ(afu, off) in_be64(afu->native->afu_desc_mmio + off) argument 96 #define AFUD_READ_LE(afu, off) in_le64(afu->native->afu_desc_mmio + off) argument 100 #define AFUD_READ_INFO(afu) AFUD_READ(afu, 0x0) argument 109 #define AFUD_READ_CR(afu) AFUD_READ(afu, 0x20) argument 111 #define AFUD_READ_CR_OFF(afu) AFUD_READ(afu, 0x28) argument 112 #define AFUD_READ_PPPSA(afu) AFUD_READ(afu, 0x30) argument 116 #define AFUD_READ_PPPSA_OFF(afu) AFUD_READ(afu, 0x38) argument 117 #define AFUD_READ_EB(afu) AFUD_READ(afu, 0x40) argument 119 #define AFUD_READ_EB_OFF(afu) AFUD_READ(afu, 0x48) argument 274 static void dump_afu_descriptor(struct cxl_afu *afu) in dump_afu_descriptor() argument [all …]
|
D | vphb.c | 47 struct cxl_afu *afu; in cxl_pci_enable_device_hook() local 50 afu = (struct cxl_afu *)phb->private_data; in cxl_pci_enable_device_hook() 52 if (!cxl_ops->link_ok(afu->adapter, afu)) { in cxl_pci_enable_device_hook() 60 return _cxl_pci_associate_default_context(dev, afu); in cxl_pci_enable_device_hook() 86 static void cxl_afu_configured_put(struct cxl_afu *afu) in cxl_afu_configured_put() argument 88 atomic_dec_if_positive(&afu->configured_state); in cxl_afu_configured_put() 91 static bool cxl_afu_configured_get(struct cxl_afu *afu) in cxl_afu_configured_get() argument 93 return atomic_inc_unless_negative(&afu->configured_state); in cxl_afu_configured_get() 97 struct cxl_afu *afu, int *_record) in cxl_pcie_config_info() argument 102 if (record > afu->crs_num) in cxl_pcie_config_info() [all …]
|
D | sysfs.c | 186 struct cxl_afu *afu = to_afu_chardev_m(device); in mmio_size_show_master() local 188 return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->adapter->ps_size); in mmio_size_show_master() 195 struct cxl_afu *afu = to_afu_chardev_m(device); in pp_mmio_off_show() local 197 return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->native->pp_offset); in pp_mmio_off_show() 204 struct cxl_afu *afu = to_afu_chardev_m(device); in pp_mmio_len_show() local 206 return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->pp_size); in pp_mmio_len_show() 222 struct cxl_afu *afu = to_cxl_afu(device); in mmio_size_show() local 224 if (afu->pp_size) in mmio_size_show() 225 return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->pp_size); in mmio_size_show() 226 return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->adapter->ps_size); in mmio_size_show() [all …]
|
D | file.c | 30 #define CXL_AFU_MINOR_D(afu) (CXL_CARD_MINOR(afu->adapter) + 1 + (3 * afu->slice)) argument 31 #define CXL_AFU_MINOR_M(afu) (CXL_AFU_MINOR_D(afu) + 1) argument 32 #define CXL_AFU_MINOR_S(afu) (CXL_AFU_MINOR_D(afu) + 2) argument 33 #define CXL_AFU_MKDEV_D(afu) MKDEV(MAJOR(cxl_dev), CXL_AFU_MINOR_D(afu)) argument 34 #define CXL_AFU_MKDEV_M(afu) MKDEV(MAJOR(cxl_dev), CXL_AFU_MINOR_M(afu)) argument 35 #define CXL_AFU_MKDEV_S(afu) MKDEV(MAJOR(cxl_dev), CXL_AFU_MINOR_S(afu)) argument 48 struct cxl_afu *afu; in __afu_open() local 63 if (!(afu = adapter->afu[slice])) { in __afu_open() 73 cxl_afu_get(afu); in __afu_open() 76 if (!afu->current_mode) in __afu_open() [all …]
|
D | trace.h | 65 __field(u8, afu) 70 __entry->card = ctx->afu->adapter->adapter_num; 71 __entry->afu = ctx->afu->slice; 77 __entry->afu, 90 __field(u8, afu) 99 __entry->card = ctx->afu->adapter->adapter_num; 100 __entry->afu = ctx->afu->slice; 110 __entry->afu, 131 __field(u8, afu) 139 __entry->card = ctx->afu->adapter->adapter_num; [all …]
|
D | of.c | 74 struct cxl_afu *afu) in read_phys_addr() argument 92 afu->guest->handle = addr; in read_phys_addr() 95 afu->guest->p2n_phys += addr; in read_phys_addr() 96 afu->guest->p2n_size = size; in read_phys_addr() 99 afu->psn_phys += addr; in read_phys_addr() 100 afu->adapter->ps_size = size; in read_phys_addr() 115 static int read_vpd(struct cxl *adapter, struct cxl_afu *afu) in read_vpd() argument 126 rc = cxl_guest_read_afu_vpd(afu, vpd, len); in read_vpd() 135 int cxl_of_read_afu_handle(struct cxl_afu *afu, struct device_node *afu_np) in cxl_of_read_afu_handle() argument 137 if (read_handle(afu_np, &afu->guest->handle)) in cxl_of_read_afu_handle() [all …]
|
D | cxl.h | 466 struct cxl_afu *afu; member 558 int (*afu_regs_init)(struct cxl_afu *afu); 559 int (*register_serr_irq)(struct cxl_afu *afu); 560 void (*release_serr_irq)(struct cxl_afu *afu); 562 void (*debugfs_add_afu_sl_regs)(struct cxl_afu *afu, struct dentry *dir); 602 struct cxl_afu *afu[CXL_MAX_SLICES]; member 672 static inline bool cxl_adapter_link_ok(struct cxl *cxl, struct cxl_afu *afu) in cxl_adapter_link_ok() argument 703 static inline void __iomem *_cxl_p1n_addr(struct cxl_afu *afu, cxl_p1n_reg_t reg) in _cxl_p1n_addr() argument 706 return afu->native->p1n_mmio + cxl_reg_off(reg); in _cxl_p1n_addr() 709 static inline void cxl_p1n_write(struct cxl_afu *afu, cxl_p1n_reg_t reg, u64 val) in cxl_p1n_write() argument [all …]
|
D | main.c | 37 int cxl_afu_slbia(struct cxl_afu *afu) in cxl_afu_slbia() argument 42 cxl_p2n_write(afu, CXL_SLBIA_An, CXL_TLB_SLB_IQ_ALL); in cxl_afu_slbia() 43 while (cxl_p2n_read(afu, CXL_SLBIA_An) & CXL_TLB_SLB_P) { in cxl_afu_slbia() 45 dev_warn(&afu->dev, "WARNING: CXL AFU SLBIA timed out!\n"); in cxl_afu_slbia() 51 if (!cxl_ops->link_ok(afu->adapter, afu)) in cxl_afu_slbia() 72 ctx->afu->adapter->adapter_num, ctx->afu->slice, ctx->pe); in _cxl_slbia() 79 cxl_afu_slbia(ctx->afu); in _cxl_slbia() 87 struct cxl_afu *afu; in cxl_slbia_core() local 98 afu = adapter->afu[slice]; in cxl_slbia_core() 99 if (!afu || !afu->enabled) in cxl_slbia_core() [all …]
|
D | debugfs.c | 28 if (adapter->afu[slice]) in cxl_stop_trace() 29 cxl_p1n_write(adapter->afu[slice], CXL_PSL_SLICE_TRACE, 0x8000000000000000LL); in cxl_stop_trace() 93 void cxl_debugfs_add_afu_psl_regs(struct cxl_afu *afu, struct dentry *dir) in cxl_debugfs_add_afu_psl_regs() argument 95 debugfs_create_io_x64("fir", S_IRUSR, dir, _cxl_p1n_addr(afu, CXL_PSL_FIR_SLICE_An)); in cxl_debugfs_add_afu_psl_regs() 96 debugfs_create_io_x64("serr", S_IRUSR, dir, _cxl_p1n_addr(afu, CXL_PSL_SERR_An)); in cxl_debugfs_add_afu_psl_regs() 97 debugfs_create_io_x64("afu_debug", S_IRUSR, dir, _cxl_p1n_addr(afu, CXL_AFU_DEBUG_An)); in cxl_debugfs_add_afu_psl_regs() 98 debugfs_create_io_x64("trace", S_IRUSR | S_IWUSR, dir, _cxl_p1n_addr(afu, CXL_PSL_SLICE_TRACE)); in cxl_debugfs_add_afu_psl_regs() 101 int cxl_debugfs_afu_add(struct cxl_afu *afu) in cxl_debugfs_afu_add() argument 106 if (!afu->adapter->debugfs) in cxl_debugfs_afu_add() 109 snprintf(buf, 32, "psl%i.%i", afu->adapter->adapter_num, afu->slice); in cxl_debugfs_afu_add() [all …]
|
D | context.c | 37 int cxl_context_init(struct cxl_context *ctx, struct cxl_afu *afu, bool master, in cxl_context_init() argument 43 ctx->afu = afu; in cxl_context_init() 91 mutex_lock(&afu->contexts_lock); in cxl_context_init() 93 i = idr_alloc(&ctx->afu->contexts_idr, ctx, ctx->afu->adapter->min_pe, in cxl_context_init() 94 ctx->afu->num_procs, GFP_NOWAIT); in cxl_context_init() 96 mutex_unlock(&afu->contexts_lock); in cxl_context_init() 102 ctx->elem = &ctx->afu->native->spa[i]; in cxl_context_init() 113 cxl_afu_get(afu); in cxl_context_init() 128 if (ctx->afu->current_mode == CXL_MODE_DEDICATED) { in cxl_mmap_fault() 129 area = ctx->afu->psn_phys; in cxl_mmap_fault() [all …]
|
D | api.c | 24 struct cxl_afu *afu; in cxl_dev_context_init() local 28 afu = cxl_pci_to_afu(dev); in cxl_dev_context_init() 29 if (IS_ERR(afu)) in cxl_dev_context_init() 30 return ERR_CAST(afu); in cxl_dev_context_init() 54 rc = cxl_context_init(ctx, afu, false, mapping); in cxl_dev_context_init() 143 num = ctx->afu->pp_irqs; in cxl_allocate_afu_irqs() 154 cxl_map_irq(ctx->afu->adapter, hwirq, cxl_ops->psl_interrupt, ctx, "psl"); in cxl_allocate_afu_irqs() 181 cxl_ops->release_irq_ranges(&ctx->irqs, ctx->afu->adapter); in cxl_free_afu_irqs() 197 return cxl_map_irq(ctx->afu->adapter, hwirq, handler, cookie, name); in cxl_map_afu_irq() 236 rc = cxl_adapter_context_get(ctx->afu->adapter); in cxl_start_context() [all …]
|
D | irq.c | 101 dev_err_ratelimited(&ctx->afu->dev, "CXL AFU Error " in cxl_irq() 263 if ((rc = cxl_ops->alloc_irq_ranges(&ctx->irqs, ctx->afu->adapter, in afu_allocate_irqs() 269 ctx->irqs.offset[0] = ctx->afu->native->psl_hwirq; in afu_allocate_irqs() 290 dev_name(&ctx->afu->dev), in afu_allocate_irqs() 304 cxl_ops->release_irq_ranges(&ctx->irqs, ctx->afu->adapter); in afu_allocate_irqs() 335 cxl_map_irq(ctx->afu->adapter, hwirq, handler, ctx, in afu_register_hwirqs() 370 cxl_ops->release_irq_ranges(&ctx->irqs, ctx->afu->adapter); in afu_release_irqs() 375 void cxl_afu_decode_psl_serr(struct cxl_afu *afu, u64 serr) in cxl_afu_decode_psl_serr() argument 377 dev_crit(&afu->dev, in cxl_afu_decode_psl_serr() 379 dev_crit(&afu->dev, "PSL_SERR_An: 0x%016llx\n", serr); in cxl_afu_decode_psl_serr() [all …]
|
D | base.c | 58 struct cxl_afu *cxl_afu_get(struct cxl_afu *afu) in cxl_afu_get() argument 60 return (get_device(&afu->dev) == NULL) ? NULL : afu; in cxl_afu_get() 64 void cxl_afu_put(struct cxl_afu *afu) in cxl_afu_put() argument 66 put_device(&afu->dev); in cxl_afu_put() 113 bool cxl_pci_associate_default_context(struct pci_dev *dev, struct cxl_afu *afu) in cxl_pci_associate_default_context() argument 122 ret = calls->cxl_pci_associate_default_context(dev, afu); in cxl_pci_associate_default_context()
|
D | fault.c | 260 if (cxl_p2n_read(ctx->afu, CXL_PSL_DSISR_An) != dsisr || in cxl_handle_fault() 261 cxl_p2n_read(ctx->afu, CXL_PSL_DAR_An) != dar || in cxl_handle_fault() 262 cxl_p2n_read(ctx->afu, CXL_PSL_PEHandle_An) != ctx->pe) { in cxl_handle_fault() 267 dev_notice(&ctx->afu->dev, "cxl_handle_fault: Translation fault regs changed\n"); in cxl_handle_fault() 370 switch (ctx->afu->prefault_mode) { in cxl_prefault()
|
D | phb.c | 13 bool _cxl_pci_associate_default_context(struct pci_dev *dev, struct cxl_afu *afu) in _cxl_pci_associate_default_context() argument 27 return (cxl_ops->afu_check_and_enable(afu) == 0); in _cxl_pci_associate_default_context()
|
D | flash.c | 325 int afu; in transfer_image() local 347 for (afu = 0; afu < adapter->slices; afu++) in transfer_image() 348 cxl_guest_remove_afu(adapter->afu[afu]); in transfer_image()
|
/drivers/scsi/cxlflash/ |
D | main.c | 49 static struct afu_cmd *cmd_checkout(struct afu *afu) in cmd_checkout() argument 55 k = (afu->cmd_couts++ & (CXLFLASH_NUM_CMDS - 1)); in cmd_checkout() 57 cmd = &afu->cmd[k]; in cmd_checkout() 221 struct afu *afu = cmd->parent; in cmd_complete() local 222 struct cxlflash_cfg *cfg = afu->parent; in cmd_complete() 267 struct afu *afu = cmd->parent; in context_reset() local 288 room = readq_be(&afu->host_map->cmd_room); in context_reset() 289 atomic64_set(&afu->room, room); in context_reset() 300 writeq_be(rrin, &afu->host_map->ioarrin); in context_reset() 302 rrin = readq_be(&afu->host_map->ioarrin); in context_reset() [all …]
|
D | vlun.c | 504 static int grow_lxt(struct afu *afu, in grow_lxt() argument 595 cxlflash_afu_sync(afu, ctxid, rhndl, AFU_LW_SYNC); in grow_lxt() 617 static int shrink_lxt(struct afu *afu, in shrink_lxt() argument 673 cxlflash_afu_sync(afu, ctxid, rhndl, AFU_HW_SYNC); in shrink_lxt() 734 struct afu *afu = cfg->afu; in _cxlflash_vlun_resize() local 785 rc = grow_lxt(afu, sdev, ctxid, rhndl, rhte, &new_size); in _cxlflash_vlun_resize() 787 rc = shrink_lxt(afu, sdev, rhndl, rhte, ctxi, &new_size); in _cxlflash_vlun_resize() 817 struct afu *afu = cfg->afu; in cxlflash_restore_luntable() local 818 struct sisl_global_map __iomem *agm = &afu->afu_map->global; in cxlflash_restore_luntable() 862 struct afu *afu = cfg->afu; in init_luntable() local [all …]
|
D | superpipe.c | 252 struct afu *afu = cfg->afu; in afu_attach() local 271 val = SISL_RHT_CNT_ID((u64)MAX_RHT_PER_CONTEXT, (u64)(afu->ctx_hndl)); in afu_attach() 612 struct afu *afu = cfg->afu; in _cxlflash_disk_release() local 684 cxlflash_afu_sync(afu, ctxid, rhndl, AFU_HW_SYNC); in _cxlflash_disk_release() 723 struct afu *afu = cfg->afu; in destroy_context() local 729 if (afu->afu_map && ctxi->ctrl_map) { in destroy_context() 798 struct afu *afu = cfg->afu; in init_context() local 801 ctxi->ctrl_map = &afu->afu_map->ctrls[ctxid].ctrl; in init_context() 1281 struct afu *afu = cfg->afu; in cxlflash_disk_attach() local 1435 attach->mmio_size = sizeof(afu->afu_map->hosts[0].harea); in cxlflash_disk_attach() [all …]
|
D | common.h | 95 struct afu *afu; member 138 struct afu *parent; 150 struct afu { struct 197 int cxlflash_afu_sync(struct afu *, ctx_hndl_t, res_hndl_t, u8); argument
|