diff options
Diffstat (limited to 'arch/s390/pci/pci_clp.c')
-rw-r--r-- | arch/s390/pci/pci_clp.c | 33 |
1 files changed, 18 insertions, 15 deletions
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 | ||
19 | static 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 | } |
138 | out: | 147 | out: |
@@ -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); | ||
287 | out: | 290 | out: |
288 | return rc; | 291 | return rc; |
289 | } | 292 | } |