Merge tag 'powerpc-4.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: "Some powerpc fixes for 4.8: Misc: - powerpc/vdso: Fix build rules to rebuild vdsos correctly from Nicholas Piggin - powerpc/ptrace: Fix coredump since ptrace TM changes from Cyril Bur - powerpc/32: Fix csum_partial_copy_generic() from Christophe Leroy - cxl: Set psl_fir_cntl to production environment value from Frederic Barrat - powerpc/eeh: Switch to conventional PCI address output in EEH log from Guilherme G. Piccoli - cxl: Use fixed width predefined types in data structure. from Philippe Bergheaud - powerpc/vdso: Add missing include file from Guenter Roeck - powerpc: Fix unused function warning 'lmb_to_memblock' from Alastair D'Silva - powerpc/powernv/ioda: Fix TCE invalidate to work in real mode again from Alexey Kardashevskiy - powerpc/cell: Add missing error code in spufs_mkgang() from Dan Carpenter - crypto: crc32c-vpmsum - Convert to CPU feature based module autoloading from Anton Blanchard - powerpc/pasemi: Fix coherent_dma_mask for dma engine from Darren Stevens Benjamin Herrenschmidt: - powerpc/32: Fix crash during static key init - powerpc: Update obsolete comment in setup_32.c about early_init() - powerpc: Print the kernel load address at the end of prom_init() - powerpc/pnv/pci: Fix incorrect PE reservation attempt on some 64-bit BARs - powerpc/xics: Properly set Edge/Level type and enable resend Mahesh Salgaonkar: - powerpc/book3s: Fix MCE console messages for unrecoverable MCE. - powerpc/powernv: Fix MCE handler to avoid trashing CR0/CR1 registers. - powerpc/powernv: Move IDLE_STATE_ENTER_SEQ macro to cpuidle.h - powerpc/powernv: Load correct TOC pointer while waking up from winkle. Andrew Donnellan: - cxl: Fix sparse warnings - cxl: Fix NULL dereference in cxl_context_init() on PowerVM guests Michael Ellerman: - selftests/powerpc: Specify we expect to build with std=gnu99 - powerpc/Makefile: Use cflags-y/aflags-y for setting endian options - powerpc/pci: Fix endian bug in fixed PHB numbering" * tag 'powerpc-4.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (26 commits) selftests/powerpc: Specify we expect to build with std=gnu99 powerpc/vdso: Fix build rules to rebuild vdsos correctly powerpc/Makefile: Use cflags-y/aflags-y for setting endian options powerpc/32: Fix crash during static key init powerpc: Update obsolete comment in setup_32.c about early_init() powerpc: Print the kernel load address at the end of prom_init() powerpc/ptrace: Fix coredump since ptrace TM changes powerpc/32: Fix csum_partial_copy_generic() cxl: Set psl_fir_cntl to production environment value powerpc/pnv/pci: Fix incorrect PE reservation attempt on some 64-bit BARs powerpc/book3s: Fix MCE console messages for unrecoverable MCE. powerpc/pci: Fix endian bug in fixed PHB numbering powerpc/eeh: Switch to conventional PCI address output in EEH log cxl: Fix sparse warnings cxl: Fix NULL dereference in cxl_context_init() on PowerVM guests cxl: Use fixed width predefined types in data structure. powerpc/vdso: Add missing include file powerpc: Fix unused function warning 'lmb_to_memblock' powerpc/powernv: Fix MCE handler to avoid trashing CR0/CR1 registers. powerpc/powernv: Move IDLE_STATE_ENTER_SEQ macro to cpuidle.h ...
This commit is contained in:
@@ -90,8 +90,7 @@ int cxl_context_init(struct cxl_context *ctx, struct cxl_afu *afu, bool master,
|
||||
*/
|
||||
mutex_lock(&afu->contexts_lock);
|
||||
idr_preload(GFP_KERNEL);
|
||||
i = idr_alloc(&ctx->afu->contexts_idr, ctx,
|
||||
ctx->afu->adapter->native->sl_ops->min_pe,
|
||||
i = idr_alloc(&ctx->afu->contexts_idr, ctx, ctx->afu->adapter->min_pe,
|
||||
ctx->afu->num_procs, GFP_NOWAIT);
|
||||
idr_preload_end();
|
||||
mutex_unlock(&afu->contexts_lock);
|
||||
|
@@ -561,7 +561,6 @@ struct cxl_service_layer_ops {
|
||||
u64 (*timebase_read)(struct cxl *adapter);
|
||||
int capi_mode;
|
||||
bool needs_reset_before_disable;
|
||||
int min_pe;
|
||||
};
|
||||
|
||||
struct cxl_native {
|
||||
@@ -603,6 +602,7 @@ struct cxl {
|
||||
struct bin_attribute cxl_attr;
|
||||
int adapter_num;
|
||||
int user_irqs;
|
||||
int min_pe;
|
||||
u64 ps_size;
|
||||
u16 psl_rev;
|
||||
u16 base_image;
|
||||
|
@@ -924,7 +924,7 @@ static irqreturn_t native_irq_multiplexed(int irq, void *data)
|
||||
return fail_psl_irq(afu, &irq_info);
|
||||
}
|
||||
|
||||
void native_irq_wait(struct cxl_context *ctx)
|
||||
static void native_irq_wait(struct cxl_context *ctx)
|
||||
{
|
||||
u64 dsisr;
|
||||
int timeout = 1000;
|
||||
|
@@ -379,7 +379,7 @@ static int calc_capp_routing(struct pci_dev *dev, u64 *chipid, u64 *capp_unit_id
|
||||
|
||||
static int init_implementation_adapter_psl_regs(struct cxl *adapter, struct pci_dev *dev)
|
||||
{
|
||||
u64 psl_dsnctl;
|
||||
u64 psl_dsnctl, psl_fircntl;
|
||||
u64 chipid;
|
||||
u64 capp_unit_id;
|
||||
int rc;
|
||||
@@ -398,8 +398,11 @@ static int init_implementation_adapter_psl_regs(struct cxl *adapter, struct pci_
|
||||
cxl_p1_write(adapter, CXL_PSL_RESLCKTO, 0x20000000200ULL);
|
||||
/* snoop write mask */
|
||||
cxl_p1_write(adapter, CXL_PSL_SNWRALLOC, 0x00000000FFFFFFFFULL);
|
||||
/* set fir_accum */
|
||||
cxl_p1_write(adapter, CXL_PSL_FIR_CNTL, 0x0800000000000000ULL);
|
||||
/* set fir_cntl to recommended value for production env */
|
||||
psl_fircntl = (0x2ULL << (63-3)); /* ce_report */
|
||||
psl_fircntl |= (0x1ULL << (63-6)); /* FIR_report */
|
||||
psl_fircntl |= 0x1ULL; /* ce_thresh */
|
||||
cxl_p1_write(adapter, CXL_PSL_FIR_CNTL, psl_fircntl);
|
||||
/* for debugging with trace arrays */
|
||||
cxl_p1_write(adapter, CXL_PSL_TRACE, 0x0000FF7C00000000ULL);
|
||||
|
||||
@@ -1521,14 +1524,15 @@ static const struct cxl_service_layer_ops xsl_ops = {
|
||||
.write_timebase_ctrl = write_timebase_ctrl_xsl,
|
||||
.timebase_read = timebase_read_xsl,
|
||||
.capi_mode = OPAL_PHB_CAPI_MODE_DMA,
|
||||
.min_pe = 1, /* Workaround for Mellanox CX4 HW bug */
|
||||
};
|
||||
|
||||
static void set_sl_ops(struct cxl *adapter, struct pci_dev *dev)
|
||||
{
|
||||
if (dev->vendor == PCI_VENDOR_ID_MELLANOX && dev->device == 0x1013) {
|
||||
/* Mellanox CX-4 */
|
||||
dev_info(&adapter->dev, "Device uses an XSL\n");
|
||||
adapter->native->sl_ops = &xsl_ops;
|
||||
adapter->min_pe = 1; /* Workaround for CX-4 hardware bug */
|
||||
} else {
|
||||
dev_info(&adapter->dev, "Device uses a PSL\n");
|
||||
adapter->native->sl_ops = &psl_ops;
|
||||
|
@@ -221,7 +221,7 @@ int cxl_pci_vphb_add(struct cxl_afu *afu)
|
||||
/* Setup the PHB using arch provided callback */
|
||||
phb->ops = &cxl_pcie_pci_ops;
|
||||
phb->cfg_addr = NULL;
|
||||
phb->cfg_data = 0;
|
||||
phb->cfg_data = NULL;
|
||||
phb->private_data = afu;
|
||||
phb->controller_ops = cxl_pci_controller_ops;
|
||||
|
||||
|
Reference in New Issue
Block a user