diff options
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/cxl/context.c | 3 | ||||
-rw-r--r-- | drivers/misc/cxl/cxl.h | 2 | ||||
-rw-r--r-- | drivers/misc/cxl/native.c | 2 | ||||
-rw-r--r-- | drivers/misc/cxl/pci.c | 12 | ||||
-rw-r--r-- | drivers/misc/cxl/vphb.c | 2 |
5 files changed, 12 insertions, 9 deletions
diff --git a/drivers/misc/cxl/context.c b/drivers/misc/cxl/context.c index bdee9a01ef35..c466ee2b0c97 100644 --- a/drivers/misc/cxl/context.c +++ b/drivers/misc/cxl/context.c | |||
@@ -90,8 +90,7 @@ int cxl_context_init(struct cxl_context *ctx, struct cxl_afu *afu, bool master, | |||
90 | */ | 90 | */ |
91 | mutex_lock(&afu->contexts_lock); | 91 | mutex_lock(&afu->contexts_lock); |
92 | idr_preload(GFP_KERNEL); | 92 | idr_preload(GFP_KERNEL); |
93 | i = idr_alloc(&ctx->afu->contexts_idr, ctx, | 93 | i = idr_alloc(&ctx->afu->contexts_idr, ctx, ctx->afu->adapter->min_pe, |
94 | ctx->afu->adapter->native->sl_ops->min_pe, | ||
95 | ctx->afu->num_procs, GFP_NOWAIT); | 94 | ctx->afu->num_procs, GFP_NOWAIT); |
96 | idr_preload_end(); | 95 | idr_preload_end(); |
97 | mutex_unlock(&afu->contexts_lock); | 96 | mutex_unlock(&afu->contexts_lock); |
diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h index de090533f18c..344a0ff8f8c7 100644 --- a/drivers/misc/cxl/cxl.h +++ b/drivers/misc/cxl/cxl.h | |||
@@ -561,7 +561,6 @@ struct cxl_service_layer_ops { | |||
561 | u64 (*timebase_read)(struct cxl *adapter); | 561 | u64 (*timebase_read)(struct cxl *adapter); |
562 | int capi_mode; | 562 | int capi_mode; |
563 | bool needs_reset_before_disable; | 563 | bool needs_reset_before_disable; |
564 | int min_pe; | ||
565 | }; | 564 | }; |
566 | 565 | ||
567 | struct cxl_native { | 566 | struct cxl_native { |
@@ -603,6 +602,7 @@ struct cxl { | |||
603 | struct bin_attribute cxl_attr; | 602 | struct bin_attribute cxl_attr; |
604 | int adapter_num; | 603 | int adapter_num; |
605 | int user_irqs; | 604 | int user_irqs; |
605 | int min_pe; | ||
606 | u64 ps_size; | 606 | u64 ps_size; |
607 | u16 psl_rev; | 607 | u16 psl_rev; |
608 | u16 base_image; | 608 | u16 base_image; |
diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c index 3bcdaee11ba1..e606fdc4bc9c 100644 --- a/drivers/misc/cxl/native.c +++ b/drivers/misc/cxl/native.c | |||
@@ -924,7 +924,7 @@ static irqreturn_t native_irq_multiplexed(int irq, void *data) | |||
924 | return fail_psl_irq(afu, &irq_info); | 924 | return fail_psl_irq(afu, &irq_info); |
925 | } | 925 | } |
926 | 926 | ||
927 | void native_irq_wait(struct cxl_context *ctx) | 927 | static void native_irq_wait(struct cxl_context *ctx) |
928 | { | 928 | { |
929 | u64 dsisr; | 929 | u64 dsisr; |
930 | int timeout = 1000; | 930 | int timeout = 1000; |
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c index d152e2de8c93..6f0c4ac4b649 100644 --- a/drivers/misc/cxl/pci.c +++ b/drivers/misc/cxl/pci.c | |||
@@ -379,7 +379,7 @@ static int calc_capp_routing(struct pci_dev *dev, u64 *chipid, u64 *capp_unit_id | |||
379 | 379 | ||
380 | static int init_implementation_adapter_psl_regs(struct cxl *adapter, struct pci_dev *dev) | 380 | static int init_implementation_adapter_psl_regs(struct cxl *adapter, struct pci_dev *dev) |
381 | { | 381 | { |
382 | u64 psl_dsnctl; | 382 | u64 psl_dsnctl, psl_fircntl; |
383 | u64 chipid; | 383 | u64 chipid; |
384 | u64 capp_unit_id; | 384 | u64 capp_unit_id; |
385 | int rc; | 385 | int rc; |
@@ -398,8 +398,11 @@ static int init_implementation_adapter_psl_regs(struct cxl *adapter, struct pci_ | |||
398 | cxl_p1_write(adapter, CXL_PSL_RESLCKTO, 0x20000000200ULL); | 398 | cxl_p1_write(adapter, CXL_PSL_RESLCKTO, 0x20000000200ULL); |
399 | /* snoop write mask */ | 399 | /* snoop write mask */ |
400 | cxl_p1_write(adapter, CXL_PSL_SNWRALLOC, 0x00000000FFFFFFFFULL); | 400 | cxl_p1_write(adapter, CXL_PSL_SNWRALLOC, 0x00000000FFFFFFFFULL); |
401 | /* set fir_accum */ | 401 | /* set fir_cntl to recommended value for production env */ |
402 | cxl_p1_write(adapter, CXL_PSL_FIR_CNTL, 0x0800000000000000ULL); | 402 | psl_fircntl = (0x2ULL << (63-3)); /* ce_report */ |
403 | psl_fircntl |= (0x1ULL << (63-6)); /* FIR_report */ | ||
404 | psl_fircntl |= 0x1ULL; /* ce_thresh */ | ||
405 | cxl_p1_write(adapter, CXL_PSL_FIR_CNTL, psl_fircntl); | ||
403 | /* for debugging with trace arrays */ | 406 | /* for debugging with trace arrays */ |
404 | cxl_p1_write(adapter, CXL_PSL_TRACE, 0x0000FF7C00000000ULL); | 407 | cxl_p1_write(adapter, CXL_PSL_TRACE, 0x0000FF7C00000000ULL); |
405 | 408 | ||
@@ -1521,14 +1524,15 @@ static const struct cxl_service_layer_ops xsl_ops = { | |||
1521 | .write_timebase_ctrl = write_timebase_ctrl_xsl, | 1524 | .write_timebase_ctrl = write_timebase_ctrl_xsl, |
1522 | .timebase_read = timebase_read_xsl, | 1525 | .timebase_read = timebase_read_xsl, |
1523 | .capi_mode = OPAL_PHB_CAPI_MODE_DMA, | 1526 | .capi_mode = OPAL_PHB_CAPI_MODE_DMA, |
1524 | .min_pe = 1, /* Workaround for Mellanox CX4 HW bug */ | ||
1525 | }; | 1527 | }; |
1526 | 1528 | ||
1527 | static void set_sl_ops(struct cxl *adapter, struct pci_dev *dev) | 1529 | static void set_sl_ops(struct cxl *adapter, struct pci_dev *dev) |
1528 | { | 1530 | { |
1529 | if (dev->vendor == PCI_VENDOR_ID_MELLANOX && dev->device == 0x1013) { | 1531 | if (dev->vendor == PCI_VENDOR_ID_MELLANOX && dev->device == 0x1013) { |
1532 | /* Mellanox CX-4 */ | ||
1530 | dev_info(&adapter->dev, "Device uses an XSL\n"); | 1533 | dev_info(&adapter->dev, "Device uses an XSL\n"); |
1531 | adapter->native->sl_ops = &xsl_ops; | 1534 | adapter->native->sl_ops = &xsl_ops; |
1535 | adapter->min_pe = 1; /* Workaround for CX-4 hardware bug */ | ||
1532 | } else { | 1536 | } else { |
1533 | dev_info(&adapter->dev, "Device uses a PSL\n"); | 1537 | dev_info(&adapter->dev, "Device uses a PSL\n"); |
1534 | adapter->native->sl_ops = &psl_ops; | 1538 | adapter->native->sl_ops = &psl_ops; |
diff --git a/drivers/misc/cxl/vphb.c b/drivers/misc/cxl/vphb.c index dee8def1c193..7ada5f1b7bb6 100644 --- a/drivers/misc/cxl/vphb.c +++ b/drivers/misc/cxl/vphb.c | |||
@@ -221,7 +221,7 @@ int cxl_pci_vphb_add(struct cxl_afu *afu) | |||
221 | /* Setup the PHB using arch provided callback */ | 221 | /* Setup the PHB using arch provided callback */ |
222 | phb->ops = &cxl_pcie_pci_ops; | 222 | phb->ops = &cxl_pcie_pci_ops; |
223 | phb->cfg_addr = NULL; | 223 | phb->cfg_addr = NULL; |
224 | phb->cfg_data = 0; | 224 | phb->cfg_data = NULL; |
225 | phb->private_data = afu; | 225 | phb->private_data = afu; |
226 | phb->controller_ops = cxl_pci_controller_ops; | 226 | phb->controller_ops = cxl_pci_controller_ops; |
227 | 227 | ||