Merge tag 'powerpc-4.3-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: - Re-enable CONFIG_SCSI_DH in our defconfigs - Remove unused os_area_db_id_video_mode - cxl: fix leak of IRQ names in cxl_free_afu_irqs() from Andrew - cxl: fix leak of ctx->irq_bitmap when releasing context via kernel API from Andrew - cxl: fix leak of ctx->mapping when releasing kernel API contexts from Andrew - cxl: Workaround malformed pcie packets on some cards from Philippe - cxl: Fix number of allocated pages in SPA from Christophe Lombard - Fix checkstop in native_hpte_clear() with lockdep from Cyril - Panic on unhandled Machine Check on powernv from Daniel - selftests/powerpc: Fix build failure of load_unaligned_zeropad test * tag 'powerpc-4.3-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: selftests/powerpc: Fix build failure of load_unaligned_zeropad test powerpc/powernv: Panic on unhandled Machine Check powerpc: Fix checkstop in native_hpte_clear() with lockdep cxl: Fix number of allocated pages in SPA cxl: Workaround malformed pcie packets on some cards cxl: fix leak of ctx->mapping when releasing kernel API contexts cxl: fix leak of ctx->irq_bitmap when releasing context via kernel API cxl: fix leak of IRQ names in cxl_free_afu_irqs() powerpc/ps3: Remove unused os_area_db_id_video_mode powerpc/configs: Re-enable CONFIG_SCSI_DH
Цей коміт міститься в:
@@ -105,6 +105,7 @@ EXPORT_SYMBOL_GPL(cxl_allocate_afu_irqs);
|
||||
|
||||
void cxl_free_afu_irqs(struct cxl_context *ctx)
|
||||
{
|
||||
afu_irq_name_free(ctx);
|
||||
cxl_release_irq_ranges(&ctx->irqs, ctx->afu->adapter);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(cxl_free_afu_irqs);
|
||||
|
@@ -275,6 +275,9 @@ static void reclaim_ctx(struct rcu_head *rcu)
|
||||
if (ctx->kernelapi)
|
||||
kfree(ctx->mapping);
|
||||
|
||||
if (ctx->irq_bitmap)
|
||||
kfree(ctx->irq_bitmap);
|
||||
|
||||
kfree(ctx);
|
||||
}
|
||||
|
||||
|
@@ -677,6 +677,7 @@ int cxl_register_serr_irq(struct cxl_afu *afu);
|
||||
void cxl_release_serr_irq(struct cxl_afu *afu);
|
||||
int afu_register_irqs(struct cxl_context *ctx, u32 count);
|
||||
void afu_release_irqs(struct cxl_context *ctx, void *cookie);
|
||||
void afu_irq_name_free(struct cxl_context *ctx);
|
||||
irqreturn_t cxl_slice_irq_err(int irq, void *data);
|
||||
|
||||
int cxl_debugfs_init(void);
|
||||
|
@@ -120,9 +120,16 @@ int afu_release(struct inode *inode, struct file *file)
|
||||
__func__, ctx->pe);
|
||||
cxl_context_detach(ctx);
|
||||
|
||||
mutex_lock(&ctx->mapping_lock);
|
||||
ctx->mapping = NULL;
|
||||
mutex_unlock(&ctx->mapping_lock);
|
||||
|
||||
/*
|
||||
* Delete the context's mapping pointer, unless it's created by the
|
||||
* kernel API, in which case leave it so it can be freed by reclaim_ctx()
|
||||
*/
|
||||
if (!ctx->kernelapi) {
|
||||
mutex_lock(&ctx->mapping_lock);
|
||||
ctx->mapping = NULL;
|
||||
mutex_unlock(&ctx->mapping_lock);
|
||||
}
|
||||
|
||||
put_device(&ctx->afu->dev);
|
||||
|
||||
|
@@ -414,7 +414,7 @@ void cxl_release_psl_irq(struct cxl_afu *afu)
|
||||
kfree(afu->psl_irq_name);
|
||||
}
|
||||
|
||||
static void afu_irq_name_free(struct cxl_context *ctx)
|
||||
void afu_irq_name_free(struct cxl_context *ctx)
|
||||
{
|
||||
struct cxl_irq_name *irq_name, *tmp;
|
||||
|
||||
@@ -524,7 +524,5 @@ void afu_release_irqs(struct cxl_context *ctx, void *cookie)
|
||||
afu_irq_name_free(ctx);
|
||||
cxl_release_irq_ranges(&ctx->irqs, ctx->afu->adapter);
|
||||
|
||||
kfree(ctx->irq_bitmap);
|
||||
ctx->irq_bitmap = NULL;
|
||||
ctx->irq_count = 0;
|
||||
}
|
||||
|
@@ -457,6 +457,7 @@ static int activate_afu_directed(struct cxl_afu *afu)
|
||||
|
||||
dev_info(&afu->dev, "Activating AFU directed mode\n");
|
||||
|
||||
afu->num_procs = afu->max_procs_virtualised;
|
||||
if (afu->spa == NULL) {
|
||||
if (cxl_alloc_spa(afu))
|
||||
return -ENOMEM;
|
||||
@@ -468,7 +469,6 @@ static int activate_afu_directed(struct cxl_afu *afu)
|
||||
cxl_p1n_write(afu, CXL_PSL_ID_An, CXL_PSL_ID_An_F | CXL_PSL_ID_An_L);
|
||||
|
||||
afu->current_mode = CXL_MODE_DIRECTED;
|
||||
afu->num_procs = afu->max_procs_virtualised;
|
||||
|
||||
if ((rc = cxl_chardev_m_afu_add(afu)))
|
||||
return rc;
|
||||
|
@@ -1035,6 +1035,32 @@ static int cxl_read_vsec(struct cxl *adapter, struct pci_dev *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Workaround a PCIe Host Bridge defect on some cards, that can cause
|
||||
* malformed Transaction Layer Packet (TLP) errors to be erroneously
|
||||
* reported. Mask this error in the Uncorrectable Error Mask Register.
|
||||
*
|
||||
* The upper nibble of the PSL revision is used to distinguish between
|
||||
* different cards. The affected ones have it set to 0.
|
||||
*/
|
||||
static void cxl_fixup_malformed_tlp(struct cxl *adapter, struct pci_dev *dev)
|
||||
{
|
||||
int aer;
|
||||
u32 data;
|
||||
|
||||
if (adapter->psl_rev & 0xf000)
|
||||
return;
|
||||
if (!(aer = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR)))
|
||||
return;
|
||||
pci_read_config_dword(dev, aer + PCI_ERR_UNCOR_MASK, &data);
|
||||
if (data & PCI_ERR_UNC_MALF_TLP)
|
||||
if (data & PCI_ERR_UNC_INTN)
|
||||
return;
|
||||
data |= PCI_ERR_UNC_MALF_TLP;
|
||||
data |= PCI_ERR_UNC_INTN;
|
||||
pci_write_config_dword(dev, aer + PCI_ERR_UNCOR_MASK, data);
|
||||
}
|
||||
|
||||
static int cxl_vsec_looks_ok(struct cxl *adapter, struct pci_dev *dev)
|
||||
{
|
||||
if (adapter->vsec_status & CXL_STATUS_SECOND_PORT)
|
||||
@@ -1134,6 +1160,8 @@ static int cxl_configure_adapter(struct cxl *adapter, struct pci_dev *dev)
|
||||
if ((rc = cxl_vsec_looks_ok(adapter, dev)))
|
||||
return rc;
|
||||
|
||||
cxl_fixup_malformed_tlp(adapter, dev);
|
||||
|
||||
if ((rc = setup_cxl_bars(dev)))
|
||||
return rc;
|
||||
|
||||
|
Посилання в новій задачі
Заблокувати користувача