aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2013-10-22 09:17:19 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-10-24 11:17:15 -0400
commit1f1dcbd4f23bd1f3bef7c000bfe46e85e4b66726 (patch)
treeba016b67773b7c694e13288cce03548cd7d82eb2 /arch/s390
parenta2c0844965534e2276e5b0c0dc8a0952658412a4 (diff)
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>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/pci/pci.c21
-rw-r--r--arch/s390/pci/pci_clp.c33
-rw-r--r--arch/s390/pci/pci_dma.c18
-rw-r--r--arch/s390/pci/pci_event.c35
4 files changed, 46 insertions, 61 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index 206186c44ade..fd6d6ce79439 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -136,7 +136,6 @@ static int zpci_set_airq(struct zpci_dev *zdev)
136 fib->aisbo = zdev->aisb & 63; 136 fib->aisbo = zdev->aisb & 63;
137 137
138 rc = zpci_mod_fc(req, fib); 138 rc = zpci_mod_fc(req, fib);
139 pr_debug("%s mpcifc returned noi: %d\n", __func__, fib->noi);
140 139
141 free_page((unsigned long) fib); 140 free_page((unsigned long) fib);
142 return rc; 141 return rc;
@@ -424,7 +423,6 @@ int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
424 struct msi_msg msg; 423 struct msi_msg msg;
425 int rc; 424 int rc;
426 425
427 pr_debug("%s: requesting %d MSI-X interrupts...", __func__, nvec);
428 if (type != PCI_CAP_ID_MSIX && type != PCI_CAP_ID_MSI) 426 if (type != PCI_CAP_ID_MSIX && type != PCI_CAP_ID_MSI)
429 return -EINVAL; 427 return -EINVAL;
430 msi_vecs = min(nvec, ZPCI_MSI_VEC_MAX); 428 msi_vecs = min(nvec, ZPCI_MSI_VEC_MAX);
@@ -489,7 +487,6 @@ out_msi:
489out_si: 487out_si:
490 airq_iv_free_bit(zpci_aisb_iv, aisb); 488 airq_iv_free_bit(zpci_aisb_iv, aisb);
491out: 489out:
492 dev_err(&pdev->dev, "register MSI failed with: %d\n", rc);
493 return rc; 490 return rc;
494} 491}
495 492
@@ -499,14 +496,10 @@ void arch_teardown_msi_irqs(struct pci_dev *pdev)
499 struct msi_desc *msi; 496 struct msi_desc *msi;
500 int rc; 497 int rc;
501 498
502 pr_info("%s: on pdev: %p\n", __func__, pdev);
503
504 /* Disable adapter interrupts */ 499 /* Disable adapter interrupts */
505 rc = zpci_clear_airq(zdev); 500 rc = zpci_clear_airq(zdev);
506 if (rc) { 501 if (rc)
507 dev_err(&pdev->dev, "deregister MSI failed with: %d\n", rc);
508 return; 502 return;
509 }
510 503
511 /* Release MSI interrupts */ 504 /* Release MSI interrupts */
512 list_for_each_entry(msi, &pdev->msi_list, list) { 505 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
625 r->name = name; 618 r->name = name;
626 619
627 rc = request_resource(&iomem_resource, r); 620 rc = request_resource(&iomem_resource, r);
628 if (rc) 621 if (rc) {
629 pr_debug("request resource %pR failed\n", r); 622 kfree(r->name);
623 kfree(r);
624 return ERR_PTR(-ENOMEM);
625 }
630 return r; 626 return r;
631} 627}
632 628
@@ -822,7 +818,6 @@ int zpci_enable_device(struct zpci_dev *zdev)
822 rc = clp_enable_fh(zdev, ZPCI_NR_DMA_SPACES); 818 rc = clp_enable_fh(zdev, ZPCI_NR_DMA_SPACES);
823 if (rc) 819 if (rc)
824 goto out; 820 goto out;
825 pr_info("Enabled fh: 0x%x fid: 0x%x\n", zdev->fh, zdev->fid);
826 821
827 rc = zpci_dma_init_device(zdev); 822 rc = zpci_dma_init_device(zdev);
828 if (rc) 823 if (rc)
@@ -942,10 +937,6 @@ static int __init pci_base_init(void)
942 || !test_facility(71) || !test_facility(72)) 937 || !test_facility(71) || !test_facility(72))
943 return 0; 938 return 0;
944 939
945 pr_info("Probing PCI hardware: PCI:%d SID:%d AEN:%d\n",
946 test_facility(69), test_facility(70),
947 test_facility(71));
948
949 rc = zpci_debug_init(); 940 rc = zpci_debug_init();
950 if (rc) 941 if (rc)
951 goto out; 942 goto out;
diff --git a/arch/s390/pci/pci_clp.c b/arch/s390/pci/pci_clp.c
index 475563c3d1e4..84147984224a 100644
--- a/arch/s390/pci/pci_clp.c
+++ b/arch/s390/pci/pci_clp.c
@@ -16,6 +16,16 @@
16#include <asm/pci_debug.h> 16#include <asm/pci_debug.h>
17#include <asm/pci_clp.h> 17#include <asm/pci_clp.h>
18 18
19static inline void zpci_err_clp(unsigned int rsp, int rc)
20{
21 struct {
22 unsigned int rsp;
23 int rc;
24 } __packed data = {rsp, rc};
25
26 zpci_err_hex(&data, sizeof(data));
27}
28
19/* 29/*
20 * Call Logical Processor 30 * Call Logical Processor
21 * Retry logic is handled by the caller. 31 * Retry logic is handled by the caller.
@@ -54,7 +64,6 @@ static void clp_store_query_pci_fngrp(struct zpci_dev *zdev,
54 zdev->msi_addr = response->msia; 64 zdev->msi_addr = response->msia;
55 zdev->fmb_update = response->mui; 65 zdev->fmb_update = response->mui;
56 66
57 pr_debug("Supported number of MSI vectors: %u\n", response->noi);
58 switch (response->version) { 67 switch (response->version) {
59 case 1: 68 case 1:
60 zdev->max_bus_speed = PCIE_SPEED_5_0GT; 69 zdev->max_bus_speed = PCIE_SPEED_5_0GT;
@@ -84,8 +93,8 @@ static int clp_query_pci_fngrp(struct zpci_dev *zdev, u8 pfgid)
84 if (!rc && rrb->response.hdr.rsp == CLP_RC_OK) 93 if (!rc && rrb->response.hdr.rsp == CLP_RC_OK)
85 clp_store_query_pci_fngrp(zdev, &rrb->response); 94 clp_store_query_pci_fngrp(zdev, &rrb->response);
86 else { 95 else {
87 pr_err("Query PCI FNGRP failed with response: %x cc: %d\n", 96 zpci_err("Q PCI FGRP:\n");
88 rrb->response.hdr.rsp, rc); 97 zpci_err_clp(rrb->response.hdr.rsp, rc);
89 rc = -EIO; 98 rc = -EIO;
90 } 99 }
91 clp_free_block(rrb); 100 clp_free_block(rrb);
@@ -131,8 +140,8 @@ static int clp_query_pci_fn(struct zpci_dev *zdev, u32 fh)
131 if (rrb->response.pfgid) 140 if (rrb->response.pfgid)
132 rc = clp_query_pci_fngrp(zdev, rrb->response.pfgid); 141 rc = clp_query_pci_fngrp(zdev, rrb->response.pfgid);
133 } else { 142 } else {
134 pr_err("Query PCI failed with response: %x cc: %d\n", 143 zpci_err("Q PCI FN:\n");
135 rrb->response.hdr.rsp, rc); 144 zpci_err_clp(rrb->response.hdr.rsp, rc);
136 rc = -EIO; 145 rc = -EIO;
137 } 146 }
138out: 147out:
@@ -206,8 +215,8 @@ static int clp_set_pci_fn(u32 *fh, u8 nr_dma_as, u8 command)
206 if (!rc && rrb->response.hdr.rsp == CLP_RC_OK) 215 if (!rc && rrb->response.hdr.rsp == CLP_RC_OK)
207 *fh = rrb->response.fh; 216 *fh = rrb->response.fh;
208 else { 217 else {
209 zpci_dbg(0, "SPF fh:%x, cc:%d, resp:%x\n", *fh, rc, 218 zpci_err("Set PCI FN:\n");
210 rrb->response.hdr.rsp); 219 zpci_err_clp(rrb->response.hdr.rsp, rc);
211 rc = -EIO; 220 rc = -EIO;
212 } 221 }
213 clp_free_block(rrb); 222 clp_free_block(rrb);
@@ -262,8 +271,8 @@ static int clp_list_pci(struct clp_req_rsp_list_pci *rrb,
262 /* Get PCI function handle list */ 271 /* Get PCI function handle list */
263 rc = clp_instr(rrb); 272 rc = clp_instr(rrb);
264 if (rc || rrb->response.hdr.rsp != CLP_RC_OK) { 273 if (rc || rrb->response.hdr.rsp != CLP_RC_OK) {
265 pr_err("List PCI failed with response: 0x%x cc: %d\n", 274 zpci_err("List PCI FN:\n");
266 rrb->response.hdr.rsp, rc); 275 zpci_err_clp(rrb->response.hdr.rsp, rc);
267 rc = -EIO; 276 rc = -EIO;
268 goto out; 277 goto out;
269 } 278 }
@@ -273,17 +282,11 @@ static int clp_list_pci(struct clp_req_rsp_list_pci *rrb,
273 282
274 entries = (rrb->response.hdr.len - LIST_PCI_HDR_LEN) / 283 entries = (rrb->response.hdr.len - LIST_PCI_HDR_LEN) /
275 rrb->response.entry_size; 284 rrb->response.entry_size;
276 pr_info("Detected number of PCI functions: %u\n", entries);
277 285
278 /* Store the returned resume token as input for the next call */
279 resume_token = rrb->response.resume_token; 286 resume_token = rrb->response.resume_token;
280
281 for (i = 0; i < entries; i++) 287 for (i = 0; i < entries; i++)
282 cb(&rrb->response.fh_list[i]); 288 cb(&rrb->response.fh_list[i]);
283 } while (resume_token); 289 } while (resume_token);
284
285 pr_debug("Maximum number of supported PCI functions: %u\n",
286 rrb->response.max_fn);
287out: 290out:
288 return rc; 291 return rc;
289} 292}
diff --git a/arch/s390/pci/pci_dma.c b/arch/s390/pci/pci_dma.c
index 7e5573acb063..9b83d080902d 100644
--- a/arch/s390/pci/pci_dma.c
+++ b/arch/s390/pci/pci_dma.c
@@ -145,10 +145,8 @@ static int dma_update_trans(struct zpci_dev *zdev, unsigned long pa,
145 return -EINVAL; 145 return -EINVAL;
146 146
147 spin_lock_irqsave(&zdev->dma_table_lock, irq_flags); 147 spin_lock_irqsave(&zdev->dma_table_lock, irq_flags);
148 if (!zdev->dma_table) { 148 if (!zdev->dma_table)
149 dev_err(&zdev->pdev->dev, "Missing DMA table\n");
150 goto no_refresh; 149 goto no_refresh;
151 }
152 150
153 for (i = 0; i < nr_pages; i++) { 151 for (i = 0; i < nr_pages; i++) {
154 dma_update_cpu_trans(zdev, page_addr, dma_addr, flags); 152 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,
280 size = nr_pages * PAGE_SIZE; 278 size = nr_pages * PAGE_SIZE;
281 279
282 dma_addr = zdev->start_dma + iommu_page_index * PAGE_SIZE; 280 dma_addr = zdev->start_dma + iommu_page_index * PAGE_SIZE;
283 if (dma_addr + size > zdev->end_dma) { 281 if (dma_addr + size > zdev->end_dma)
284 dev_err(dev, "(dma_addr: 0x%16.16LX + size: 0x%16.16lx) > end_dma: 0x%16.16Lx\n",
285 dma_addr, size, zdev->end_dma);
286 goto out_free; 282 goto out_free;
287 }
288 283
289 if (direction == DMA_NONE || direction == DMA_TO_DEVICE) 284 if (direction == DMA_NONE || direction == DMA_TO_DEVICE)
290 flags |= ZPCI_TABLE_PROTECTED; 285 flags |= ZPCI_TABLE_PROTECTED;
@@ -297,7 +292,8 @@ static dma_addr_t s390_dma_map_pages(struct device *dev, struct page *page,
297out_free: 292out_free:
298 dma_free_iommu(zdev, iommu_page_index, nr_pages); 293 dma_free_iommu(zdev, iommu_page_index, nr_pages);
299out_err: 294out_err:
300 dev_err(dev, "Failed to map addr: %lx\n", pa); 295 zpci_err("map error:\n");
296 zpci_err_hex(&pa, sizeof(pa));
301 return DMA_ERROR_CODE; 297 return DMA_ERROR_CODE;
302} 298}
303 299
@@ -312,8 +308,10 @@ static void s390_dma_unmap_pages(struct device *dev, dma_addr_t dma_addr,
312 npages = iommu_num_pages(dma_addr, size, PAGE_SIZE); 308 npages = iommu_num_pages(dma_addr, size, PAGE_SIZE);
313 dma_addr = dma_addr & PAGE_MASK; 309 dma_addr = dma_addr & PAGE_MASK;
314 if (dma_update_trans(zdev, 0, dma_addr, npages * PAGE_SIZE, 310 if (dma_update_trans(zdev, 0, dma_addr, npages * PAGE_SIZE,
315 ZPCI_TABLE_PROTECTED | ZPCI_PTE_INVALID)) 311 ZPCI_TABLE_PROTECTED | ZPCI_PTE_INVALID)) {
316 dev_err(dev, "Failed to unmap addr: %Lx\n", dma_addr); 312 zpci_err("unmap error:\n");
313 zpci_err_hex(&dma_addr, sizeof(dma_addr));
314 }
317 315
318 atomic64_add(npages, (atomic64_t *) &zdev->fmb->unmapped_pages); 316 atomic64_add(npages, (atomic64_t *) &zdev->fmb->unmapped_pages);
319 iommu_page_index = (dma_addr - zdev->start_dma) >> PAGE_SHIFT; 317 iommu_page_index = (dma_addr - zdev->start_dma) >> PAGE_SHIFT;
diff --git a/arch/s390/pci/pci_event.c b/arch/s390/pci/pci_event.c
index 0aecaf954845..278e671ec9ac 100644
--- a/arch/s390/pci/pci_event.c
+++ b/arch/s390/pci/pci_event.c
@@ -10,6 +10,7 @@
10 10
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/pci.h> 12#include <linux/pci.h>
13#include <asm/pci_debug.h>
13 14
14/* Content Code Description for PCI Function Error */ 15/* Content Code Description for PCI Function Error */
15struct zpci_ccdf_err { 16struct zpci_ccdf_err {
@@ -41,25 +42,15 @@ struct zpci_ccdf_avail {
41 u16 pec; /* PCI event code */ 42 u16 pec; /* PCI event code */
42} __packed; 43} __packed;
43 44
44static void zpci_event_log_err(struct zpci_ccdf_err *ccdf)
45{
46 struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid);
47
48 zpci_err("SEI error CCD:\n");
49 zpci_err_hex(ccdf, sizeof(*ccdf));
50 dev_err(&zdev->pdev->dev, "event code: 0x%x\n", ccdf->pec);
51}
52
53static void zpci_event_log_avail(struct zpci_ccdf_avail *ccdf) 45static void zpci_event_log_avail(struct zpci_ccdf_avail *ccdf)
54{ 46{
55 struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid); 47 struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid);
48 struct pci_dev *pdev = zdev ? zdev->pdev : NULL;
56 49
57 pr_err("%s%s: availability event: fh: 0x%x fid: 0x%x event code: 0x%x reason:", 50 pr_info("%s: Event 0x%x reconfigured PCI function 0x%x\n",
58 (zdev) ? dev_driver_string(&zdev->pdev->dev) : "?", 51 pdev ? pci_name(pdev) : "n/a", ccdf->pec, ccdf->fid);
59 (zdev) ? dev_name(&zdev->pdev->dev) : "?", 52 zpci_err("avail CCDF:\n");
60 ccdf->fh, ccdf->fid, ccdf->pec); 53 zpci_err_hex(ccdf, sizeof(*ccdf));
61 print_hex_dump(KERN_CONT, "ccdf", DUMP_PREFIX_OFFSET,
62 16, 1, ccdf, sizeof(*ccdf), false);
63 54
64 switch (ccdf->pec) { 55 switch (ccdf->pec) {
65 case 0x0301: 56 case 0x0301:
@@ -79,14 +70,16 @@ static void zpci_event_log_avail(struct zpci_ccdf_avail *ccdf)
79void zpci_event_error(void *data) 70void zpci_event_error(void *data)
80{ 71{
81 struct zpci_ccdf_err *ccdf = data; 72 struct zpci_ccdf_err *ccdf = data;
82 struct zpci_dev *zdev; 73 struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid);
74
75 zpci_err("error CCDF:\n");
76 zpci_err_hex(ccdf, sizeof(*ccdf));
83 77
84 zpci_event_log_err(ccdf); 78 if (!zdev)
85 zdev = get_zdev_by_fid(ccdf->fid);
86 if (!zdev) {
87 pr_err("Error event for unknown fid: %x", ccdf->fid);
88 return; 79 return;
89 } 80
81 pr_err("%s: Event 0x%x reports an error for PCI function 0x%x\n",
82 pci_name(zdev->pdev), ccdf->pec, ccdf->fid);
90} 83}
91 84
92void zpci_event_availability(void *data) 85void zpci_event_availability(void *data)