Lines Matching defs:ocx
1078 struct thunderx_ocx *ocx = container_of(msix, struct thunderx_ocx,
1082 unsigned long head = ring_pos(ocx->com_ring_head,
1083 ARRAY_SIZE(ocx->com_err_ctx));
1084 struct ocx_com_err_ctx *ctx = &ocx->com_err_ctx[head];
1086 ctx->reg_com_int = readq(ocx->regs + OCX_COM_INT);
1090 readq(ocx->regs + OCX_LNE_INT(lane));
1092 readq(ocx->regs + OCX_LNE_STAT(lane, 11));
1094 writeq(ctx->reg_lane_int[lane], ocx->regs + OCX_LNE_INT(lane));
1097 writeq(ctx->reg_com_int, ocx->regs + OCX_COM_INT);
1099 ocx->com_ring_head++;
1107 struct thunderx_ocx *ocx = container_of(msix, struct thunderx_ocx,
1124 while (CIRC_CNT(ocx->com_ring_head, ocx->com_ring_tail,
1125 ARRAY_SIZE(ocx->com_err_ctx))) {
1126 tail = ring_pos(ocx->com_ring_tail,
1127 ARRAY_SIZE(ocx->com_err_ctx));
1128 ctx = &ocx->com_err_ctx[tail];
1131 ocx->edac_dev->ctl_name, ctx->reg_com_int);
1154 edac_device_handle_ce(ocx->edac_dev, 0, 0, msg);
1156 ocx->com_ring_tail++;
1171 struct thunderx_ocx *ocx = container_of(msix, struct thunderx_ocx,
1173 unsigned long head = ring_pos(ocx->link_ring_head,
1174 ARRAY_SIZE(ocx->link_err_ctx));
1175 struct ocx_link_err_ctx *ctx = &ocx->link_err_ctx[head];
1178 ctx->reg_com_link_int = readq(ocx->regs + OCX_COM_LINKX_INT(ctx->link));
1180 writeq(ctx->reg_com_link_int, ocx->regs + OCX_COM_LINKX_INT(ctx->link));
1182 ocx->link_ring_head++;
1190 struct thunderx_ocx *ocx = container_of(msix, struct thunderx_ocx,
1205 while (CIRC_CNT(ocx->link_ring_head, ocx->link_ring_tail,
1206 ARRAY_SIZE(ocx->link_err_ctx))) {
1207 tail = ring_pos(ocx->link_ring_head,
1208 ARRAY_SIZE(ocx->link_err_ctx));
1210 ctx = &ocx->link_err_ctx[tail];
1214 ocx->edac_dev->ctl_name,
1223 edac_device_handle_ue(ocx->edac_dev, 0, 0, msg);
1225 edac_device_handle_ce(ocx->edac_dev, 0, 0, msg);
1227 ocx->link_ring_tail++;
1238 #define OCX_DEBUGFS_ATTR(_name, _reg) DEBUGFS_REG_ATTR(ocx, _name, _reg)
1327 static void thunderx_ocx_clearstats(struct thunderx_ocx *ocx)
1332 cfg = readq(ocx->regs + OCX_LNE_CFG(lane));
1335 writeq(cfg, ocx->regs + OCX_LNE_CFG(lane));
1338 readq(ocx->regs + OCX_LNE_STAT(lane, stat));
1345 struct thunderx_ocx *ocx;
1374 ocx = edac_dev->pvt_info;
1375 ocx->edac_dev = edac_dev;
1376 ocx->com_ring_head = 0;
1377 ocx->com_ring_tail = 0;
1378 ocx->link_ring_head = 0;
1379 ocx->link_ring_tail = 0;
1381 ocx->regs = pcim_iomap_table(pdev)[0];
1382 if (!ocx->regs) {
1388 ocx->pdev = pdev;
1391 ocx->msix_ent[i].entry = i;
1392 ocx->msix_ent[i].vector = 0;
1395 ret = pci_enable_msix_exact(pdev, ocx->msix_ent, OCX_INTS);
1403 ocx->msix_ent[i].vector,
1411 &ocx->msix_ent[i]);
1418 edac_dev->mod_name = "thunderx-ocx";
1419 edac_dev->ctl_name = "thunderx-ocx";
1428 ocx->debugfs = edac_debugfs_create_dir(pdev->dev.kobj.name);
1430 ret = thunderx_create_debugfs_nodes(ocx->debugfs,
1432 ocx,
1442 thunderx_ocx_clearstats(ocx);
1446 ocx->regs + OCX_LNE_INT_EN(i));
1448 reg = readq(ocx->regs + OCX_LNE_INT(i));
1449 writeq(reg, ocx->regs + OCX_LNE_INT(i));
1454 reg = readq(ocx->regs + OCX_COM_LINKX_INT(i));
1455 writeq(reg, ocx->regs + OCX_COM_LINKX_INT(i));
1458 ocx->regs + OCX_COM_LINKX_INT_ENA_W1S(i));
1461 reg = readq(ocx->regs + OCX_COM_INT);
1462 writeq(reg, ocx->regs + OCX_COM_INT);
1464 writeq(OCX_COM_INT_ENA_ALL, ocx->regs + OCX_COM_INT_ENA_W1S);
1476 struct thunderx_ocx *ocx = edac_dev->pvt_info;
1479 writeq(OCX_COM_INT_ENA_ALL, ocx->regs + OCX_COM_INT_ENA_W1C);
1483 ocx->regs + OCX_COM_LINKX_INT_ENA_W1C(i));
1486 edac_debugfs_remove_recursive(ocx->debugfs);