aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/cxl
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-09-01 12:33:46 -0400
committerThomas Gleixner <tglx@linutronix.de>2016-09-01 12:33:46 -0400
commit0cb7bf61b1e9f05027de58c80f9b46a714d24e35 (patch)
tree41fb55cf62d07b425122f9a8b96412c0d8eb99c5 /drivers/misc/cxl
parentaa877175e7a9982233ed8f10cb4bfddd78d82741 (diff)
parent3eab887a55424fc2c27553b7bfe32330df83f7b8 (diff)
Merge branch 'linus' into smp/hotplug
Apply upstream changes to avoid conflicts with pending patches.
Diffstat (limited to 'drivers/misc/cxl')
-rw-r--r--drivers/misc/cxl/context.c3
-rw-r--r--drivers/misc/cxl/cxl.h2
-rw-r--r--drivers/misc/cxl/native.c2
-rw-r--r--drivers/misc/cxl/pci.c12
-rw-r--r--drivers/misc/cxl/vphb.c2
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
567struct cxl_native { 566struct 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
927void native_irq_wait(struct cxl_context *ctx) 927static 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
380static int init_implementation_adapter_psl_regs(struct cxl *adapter, struct pci_dev *dev) 380static 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
1527static void set_sl_ops(struct cxl *adapter, struct pci_dev *dev) 1529static 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