s390/pci: message cleanup
Cleanup arch specific pci messages. Remove unhelpful messages and replace others with entries in the debugfs. Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
a2c0844965
commit
1f1dcbd4f2
|
@ -136,7 +136,6 @@ static int zpci_set_airq(struct zpci_dev *zdev)
|
||||||
fib->aisbo = zdev->aisb & 63;
|
fib->aisbo = zdev->aisb & 63;
|
||||||
|
|
||||||
rc = zpci_mod_fc(req, fib);
|
rc = zpci_mod_fc(req, fib);
|
||||||
pr_debug("%s mpcifc returned noi: %d\n", __func__, fib->noi);
|
|
||||||
|
|
||||||
free_page((unsigned long) fib);
|
free_page((unsigned long) fib);
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -424,7 +423,6 @@ int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
|
||||||
struct msi_msg msg;
|
struct msi_msg msg;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
pr_debug("%s: requesting %d MSI-X interrupts...", __func__, nvec);
|
|
||||||
if (type != PCI_CAP_ID_MSIX && type != PCI_CAP_ID_MSI)
|
if (type != PCI_CAP_ID_MSIX && type != PCI_CAP_ID_MSI)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
msi_vecs = min(nvec, ZPCI_MSI_VEC_MAX);
|
msi_vecs = min(nvec, ZPCI_MSI_VEC_MAX);
|
||||||
|
@ -489,7 +487,6 @@ out_msi:
|
||||||
out_si:
|
out_si:
|
||||||
airq_iv_free_bit(zpci_aisb_iv, aisb);
|
airq_iv_free_bit(zpci_aisb_iv, aisb);
|
||||||
out:
|
out:
|
||||||
dev_err(&pdev->dev, "register MSI failed with: %d\n", rc);
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -499,14 +496,10 @@ void arch_teardown_msi_irqs(struct pci_dev *pdev)
|
||||||
struct msi_desc *msi;
|
struct msi_desc *msi;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
pr_info("%s: on pdev: %p\n", __func__, pdev);
|
|
||||||
|
|
||||||
/* Disable adapter interrupts */
|
/* Disable adapter interrupts */
|
||||||
rc = zpci_clear_airq(zdev);
|
rc = zpci_clear_airq(zdev);
|
||||||
if (rc) {
|
if (rc)
|
||||||
dev_err(&pdev->dev, "deregister MSI failed with: %d\n", rc);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
/* Release MSI interrupts */
|
/* Release MSI interrupts */
|
||||||
list_for_each_entry(msi, &pdev->msi_list, list) {
|
list_for_each_entry(msi, &pdev->msi_list, list) {
|
||||||
|
@ -625,8 +618,11 @@ static struct resource *zpci_alloc_bus_resource(unsigned long start, unsigned lo
|
||||||
r->name = name;
|
r->name = name;
|
||||||
|
|
||||||
rc = request_resource(&iomem_resource, r);
|
rc = request_resource(&iomem_resource, r);
|
||||||
if (rc)
|
if (rc) {
|
||||||
pr_debug("request resource %pR failed\n", r);
|
kfree(r->name);
|
||||||
|
kfree(r);
|
||||||
|
return ERR_PTR(-ENOMEM);
|
||||||
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -822,7 +818,6 @@ int zpci_enable_device(struct zpci_dev *zdev)
|
||||||
rc = clp_enable_fh(zdev, ZPCI_NR_DMA_SPACES);
|
rc = clp_enable_fh(zdev, ZPCI_NR_DMA_SPACES);
|
||||||
if (rc)
|
if (rc)
|
||||||
goto out;
|
goto out;
|
||||||
pr_info("Enabled fh: 0x%x fid: 0x%x\n", zdev->fh, zdev->fid);
|
|
||||||
|
|
||||||
rc = zpci_dma_init_device(zdev);
|
rc = zpci_dma_init_device(zdev);
|
||||||
if (rc)
|
if (rc)
|
||||||
|
@ -942,10 +937,6 @@ static int __init pci_base_init(void)
|
||||||
|| !test_facility(71) || !test_facility(72))
|
|| !test_facility(71) || !test_facility(72))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pr_info("Probing PCI hardware: PCI:%d SID:%d AEN:%d\n",
|
|
||||||
test_facility(69), test_facility(70),
|
|
||||||
test_facility(71));
|
|
||||||
|
|
||||||
rc = zpci_debug_init();
|
rc = zpci_debug_init();
|
||||||
if (rc)
|
if (rc)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -16,6 +16,16 @@
|
||||||
#include <asm/pci_debug.h>
|
#include <asm/pci_debug.h>
|
||||||
#include <asm/pci_clp.h>
|
#include <asm/pci_clp.h>
|
||||||
|
|
||||||
|
static inline void zpci_err_clp(unsigned int rsp, int rc)
|
||||||
|
{
|
||||||
|
struct {
|
||||||
|
unsigned int rsp;
|
||||||
|
int rc;
|
||||||
|
} __packed data = {rsp, rc};
|
||||||
|
|
||||||
|
zpci_err_hex(&data, sizeof(data));
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Call Logical Processor
|
* Call Logical Processor
|
||||||
* Retry logic is handled by the caller.
|
* Retry logic is handled by the caller.
|
||||||
|
@ -54,7 +64,6 @@ static void clp_store_query_pci_fngrp(struct zpci_dev *zdev,
|
||||||
zdev->msi_addr = response->msia;
|
zdev->msi_addr = response->msia;
|
||||||
zdev->fmb_update = response->mui;
|
zdev->fmb_update = response->mui;
|
||||||
|
|
||||||
pr_debug("Supported number of MSI vectors: %u\n", response->noi);
|
|
||||||
switch (response->version) {
|
switch (response->version) {
|
||||||
case 1:
|
case 1:
|
||||||
zdev->max_bus_speed = PCIE_SPEED_5_0GT;
|
zdev->max_bus_speed = PCIE_SPEED_5_0GT;
|
||||||
|
@ -84,8 +93,8 @@ static int clp_query_pci_fngrp(struct zpci_dev *zdev, u8 pfgid)
|
||||||
if (!rc && rrb->response.hdr.rsp == CLP_RC_OK)
|
if (!rc && rrb->response.hdr.rsp == CLP_RC_OK)
|
||||||
clp_store_query_pci_fngrp(zdev, &rrb->response);
|
clp_store_query_pci_fngrp(zdev, &rrb->response);
|
||||||
else {
|
else {
|
||||||
pr_err("Query PCI FNGRP failed with response: %x cc: %d\n",
|
zpci_err("Q PCI FGRP:\n");
|
||||||
rrb->response.hdr.rsp, rc);
|
zpci_err_clp(rrb->response.hdr.rsp, rc);
|
||||||
rc = -EIO;
|
rc = -EIO;
|
||||||
}
|
}
|
||||||
clp_free_block(rrb);
|
clp_free_block(rrb);
|
||||||
|
@ -131,8 +140,8 @@ static int clp_query_pci_fn(struct zpci_dev *zdev, u32 fh)
|
||||||
if (rrb->response.pfgid)
|
if (rrb->response.pfgid)
|
||||||
rc = clp_query_pci_fngrp(zdev, rrb->response.pfgid);
|
rc = clp_query_pci_fngrp(zdev, rrb->response.pfgid);
|
||||||
} else {
|
} else {
|
||||||
pr_err("Query PCI failed with response: %x cc: %d\n",
|
zpci_err("Q PCI FN:\n");
|
||||||
rrb->response.hdr.rsp, rc);
|
zpci_err_clp(rrb->response.hdr.rsp, rc);
|
||||||
rc = -EIO;
|
rc = -EIO;
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
|
@ -206,8 +215,8 @@ static int clp_set_pci_fn(u32 *fh, u8 nr_dma_as, u8 command)
|
||||||
if (!rc && rrb->response.hdr.rsp == CLP_RC_OK)
|
if (!rc && rrb->response.hdr.rsp == CLP_RC_OK)
|
||||||
*fh = rrb->response.fh;
|
*fh = rrb->response.fh;
|
||||||
else {
|
else {
|
||||||
zpci_dbg(0, "SPF fh:%x, cc:%d, resp:%x\n", *fh, rc,
|
zpci_err("Set PCI FN:\n");
|
||||||
rrb->response.hdr.rsp);
|
zpci_err_clp(rrb->response.hdr.rsp, rc);
|
||||||
rc = -EIO;
|
rc = -EIO;
|
||||||
}
|
}
|
||||||
clp_free_block(rrb);
|
clp_free_block(rrb);
|
||||||
|
@ -262,8 +271,8 @@ static int clp_list_pci(struct clp_req_rsp_list_pci *rrb,
|
||||||
/* Get PCI function handle list */
|
/* Get PCI function handle list */
|
||||||
rc = clp_instr(rrb);
|
rc = clp_instr(rrb);
|
||||||
if (rc || rrb->response.hdr.rsp != CLP_RC_OK) {
|
if (rc || rrb->response.hdr.rsp != CLP_RC_OK) {
|
||||||
pr_err("List PCI failed with response: 0x%x cc: %d\n",
|
zpci_err("List PCI FN:\n");
|
||||||
rrb->response.hdr.rsp, rc);
|
zpci_err_clp(rrb->response.hdr.rsp, rc);
|
||||||
rc = -EIO;
|
rc = -EIO;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -273,17 +282,11 @@ static int clp_list_pci(struct clp_req_rsp_list_pci *rrb,
|
||||||
|
|
||||||
entries = (rrb->response.hdr.len - LIST_PCI_HDR_LEN) /
|
entries = (rrb->response.hdr.len - LIST_PCI_HDR_LEN) /
|
||||||
rrb->response.entry_size;
|
rrb->response.entry_size;
|
||||||
pr_info("Detected number of PCI functions: %u\n", entries);
|
|
||||||
|
|
||||||
/* Store the returned resume token as input for the next call */
|
|
||||||
resume_token = rrb->response.resume_token;
|
resume_token = rrb->response.resume_token;
|
||||||
|
|
||||||
for (i = 0; i < entries; i++)
|
for (i = 0; i < entries; i++)
|
||||||
cb(&rrb->response.fh_list[i]);
|
cb(&rrb->response.fh_list[i]);
|
||||||
} while (resume_token);
|
} while (resume_token);
|
||||||
|
|
||||||
pr_debug("Maximum number of supported PCI functions: %u\n",
|
|
||||||
rrb->response.max_fn);
|
|
||||||
out:
|
out:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,10 +145,8 @@ static int dma_update_trans(struct zpci_dev *zdev, unsigned long pa,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
spin_lock_irqsave(&zdev->dma_table_lock, irq_flags);
|
spin_lock_irqsave(&zdev->dma_table_lock, irq_flags);
|
||||||
if (!zdev->dma_table) {
|
if (!zdev->dma_table)
|
||||||
dev_err(&zdev->pdev->dev, "Missing DMA table\n");
|
|
||||||
goto no_refresh;
|
goto no_refresh;
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < nr_pages; i++) {
|
for (i = 0; i < nr_pages; i++) {
|
||||||
dma_update_cpu_trans(zdev, page_addr, dma_addr, flags);
|
dma_update_cpu_trans(zdev, page_addr, dma_addr, flags);
|
||||||
|
@ -280,11 +278,8 @@ static dma_addr_t s390_dma_map_pages(struct device *dev, struct page *page,
|
||||||
size = nr_pages * PAGE_SIZE;
|
size = nr_pages * PAGE_SIZE;
|
||||||
|
|
||||||
dma_addr = zdev->start_dma + iommu_page_index * PAGE_SIZE;
|
dma_addr = zdev->start_dma + iommu_page_index * PAGE_SIZE;
|
||||||
if (dma_addr + size > zdev->end_dma) {
|
if (dma_addr + size > zdev->end_dma)
|
||||||
dev_err(dev, "(dma_addr: 0x%16.16LX + size: 0x%16.16lx) > end_dma: 0x%16.16Lx\n",
|
|
||||||
dma_addr, size, zdev->end_dma);
|
|
||||||
goto out_free;
|
goto out_free;
|
||||||
}
|
|
||||||
|
|
||||||
if (direction == DMA_NONE || direction == DMA_TO_DEVICE)
|
if (direction == DMA_NONE || direction == DMA_TO_DEVICE)
|
||||||
flags |= ZPCI_TABLE_PROTECTED;
|
flags |= ZPCI_TABLE_PROTECTED;
|
||||||
|
@ -297,7 +292,8 @@ static dma_addr_t s390_dma_map_pages(struct device *dev, struct page *page,
|
||||||
out_free:
|
out_free:
|
||||||
dma_free_iommu(zdev, iommu_page_index, nr_pages);
|
dma_free_iommu(zdev, iommu_page_index, nr_pages);
|
||||||
out_err:
|
out_err:
|
||||||
dev_err(dev, "Failed to map addr: %lx\n", pa);
|
zpci_err("map error:\n");
|
||||||
|
zpci_err_hex(&pa, sizeof(pa));
|
||||||
return DMA_ERROR_CODE;
|
return DMA_ERROR_CODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -312,8 +308,10 @@ static void s390_dma_unmap_pages(struct device *dev, dma_addr_t dma_addr,
|
||||||
npages = iommu_num_pages(dma_addr, size, PAGE_SIZE);
|
npages = iommu_num_pages(dma_addr, size, PAGE_SIZE);
|
||||||
dma_addr = dma_addr & PAGE_MASK;
|
dma_addr = dma_addr & PAGE_MASK;
|
||||||
if (dma_update_trans(zdev, 0, dma_addr, npages * PAGE_SIZE,
|
if (dma_update_trans(zdev, 0, dma_addr, npages * PAGE_SIZE,
|
||||||
ZPCI_TABLE_PROTECTED | ZPCI_PTE_INVALID))
|
ZPCI_TABLE_PROTECTED | ZPCI_PTE_INVALID)) {
|
||||||
dev_err(dev, "Failed to unmap addr: %Lx\n", dma_addr);
|
zpci_err("unmap error:\n");
|
||||||
|
zpci_err_hex(&dma_addr, sizeof(dma_addr));
|
||||||
|
}
|
||||||
|
|
||||||
atomic64_add(npages, (atomic64_t *) &zdev->fmb->unmapped_pages);
|
atomic64_add(npages, (atomic64_t *) &zdev->fmb->unmapped_pages);
|
||||||
iommu_page_index = (dma_addr - zdev->start_dma) >> PAGE_SHIFT;
|
iommu_page_index = (dma_addr - zdev->start_dma) >> PAGE_SHIFT;
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/pci.h>
|
#include <linux/pci.h>
|
||||||
|
#include <asm/pci_debug.h>
|
||||||
|
|
||||||
/* Content Code Description for PCI Function Error */
|
/* Content Code Description for PCI Function Error */
|
||||||
struct zpci_ccdf_err {
|
struct zpci_ccdf_err {
|
||||||
|
@ -41,25 +42,15 @@ struct zpci_ccdf_avail {
|
||||||
u16 pec; /* PCI event code */
|
u16 pec; /* PCI event code */
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
static void zpci_event_log_err(struct zpci_ccdf_err *ccdf)
|
|
||||||
{
|
|
||||||
struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid);
|
|
||||||
|
|
||||||
zpci_err("SEI error CCD:\n");
|
|
||||||
zpci_err_hex(ccdf, sizeof(*ccdf));
|
|
||||||
dev_err(&zdev->pdev->dev, "event code: 0x%x\n", ccdf->pec);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void zpci_event_log_avail(struct zpci_ccdf_avail *ccdf)
|
static void zpci_event_log_avail(struct zpci_ccdf_avail *ccdf)
|
||||||
{
|
{
|
||||||
struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid);
|
struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid);
|
||||||
|
struct pci_dev *pdev = zdev ? zdev->pdev : NULL;
|
||||||
|
|
||||||
pr_err("%s%s: availability event: fh: 0x%x fid: 0x%x event code: 0x%x reason:",
|
pr_info("%s: Event 0x%x reconfigured PCI function 0x%x\n",
|
||||||
(zdev) ? dev_driver_string(&zdev->pdev->dev) : "?",
|
pdev ? pci_name(pdev) : "n/a", ccdf->pec, ccdf->fid);
|
||||||
(zdev) ? dev_name(&zdev->pdev->dev) : "?",
|
zpci_err("avail CCDF:\n");
|
||||||
ccdf->fh, ccdf->fid, ccdf->pec);
|
zpci_err_hex(ccdf, sizeof(*ccdf));
|
||||||
print_hex_dump(KERN_CONT, "ccdf", DUMP_PREFIX_OFFSET,
|
|
||||||
16, 1, ccdf, sizeof(*ccdf), false);
|
|
||||||
|
|
||||||
switch (ccdf->pec) {
|
switch (ccdf->pec) {
|
||||||
case 0x0301:
|
case 0x0301:
|
||||||
|
@ -79,14 +70,16 @@ static void zpci_event_log_avail(struct zpci_ccdf_avail *ccdf)
|
||||||
void zpci_event_error(void *data)
|
void zpci_event_error(void *data)
|
||||||
{
|
{
|
||||||
struct zpci_ccdf_err *ccdf = data;
|
struct zpci_ccdf_err *ccdf = data;
|
||||||
struct zpci_dev *zdev;
|
struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid);
|
||||||
|
|
||||||
zpci_event_log_err(ccdf);
|
zpci_err("error CCDF:\n");
|
||||||
zdev = get_zdev_by_fid(ccdf->fid);
|
zpci_err_hex(ccdf, sizeof(*ccdf));
|
||||||
if (!zdev) {
|
|
||||||
pr_err("Error event for unknown fid: %x", ccdf->fid);
|
if (!zdev)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
pr_err("%s: Event 0x%x reports an error for PCI function 0x%x\n",
|
||||||
|
pci_name(zdev->pdev), ccdf->pec, ccdf->fid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void zpci_event_availability(void *data)
|
void zpci_event_availability(void *data)
|
||||||
|
|
|
@ -133,7 +133,6 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
|
||||||
{
|
{
|
||||||
struct slot *slot = hotplug_slot->private;
|
struct slot *slot = hotplug_slot->private;
|
||||||
|
|
||||||
pr_debug("%s - physical_slot = %s\n", __func__, hotplug_slot_name(hotplug_slot));
|
|
||||||
kfree(slot->hotplug_slot->info);
|
kfree(slot->hotplug_slot->info);
|
||||||
kfree(slot->hotplug_slot);
|
kfree(slot->hotplug_slot);
|
||||||
kfree(slot);
|
kfree(slot);
|
||||||
|
@ -183,10 +182,9 @@ int zpci_init_slot(struct zpci_dev *zdev)
|
||||||
snprintf(name, SLOT_NAME_SIZE, "%08x", zdev->fid);
|
snprintf(name, SLOT_NAME_SIZE, "%08x", zdev->fid);
|
||||||
rc = pci_hp_register(slot->hotplug_slot, zdev->bus,
|
rc = pci_hp_register(slot->hotplug_slot, zdev->bus,
|
||||||
ZPCI_DEVFN, name);
|
ZPCI_DEVFN, name);
|
||||||
if (rc) {
|
if (rc)
|
||||||
pr_err("pci_hp_register failed with error %d\n", rc);
|
|
||||||
goto error_reg;
|
goto error_reg;
|
||||||
}
|
|
||||||
list_add(&slot->slot_list, &s390_hotplug_slot_list);
|
list_add(&slot->slot_list, &s390_hotplug_slot_list);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue