aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/vc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/vc.c')
-rw-r--r--drivers/pci/vc.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/pci/vc.c b/drivers/pci/vc.c
index 1fa3a3219c45..5acd9c02683a 100644
--- a/drivers/pci/vc.c
+++ b/drivers/pci/vc.c
@@ -1,12 +1,9 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * PCI Virtual Channel support 3 * PCI Virtual Channel support
3 * 4 *
4 * Copyright (C) 2013 Red Hat, Inc. All rights reserved. 5 * Copyright (C) 2013 Red Hat, Inc. All rights reserved.
5 * Author: Alex Williamson <alex.williamson@redhat.com> 6 * Author: Alex Williamson <alex.williamson@redhat.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */ 7 */
11 8
12#include <linux/device.h> 9#include <linux/device.h>
@@ -57,7 +54,7 @@ static void pci_vc_load_arb_table(struct pci_dev *dev, int pos)
57 PCI_VC_PORT_STATUS_TABLE)) 54 PCI_VC_PORT_STATUS_TABLE))
58 return; 55 return;
59 56
60 dev_err(&dev->dev, "VC arbitration table failed to load\n"); 57 pci_err(dev, "VC arbitration table failed to load\n");
61} 58}
62 59
63/** 60/**
@@ -85,7 +82,7 @@ static void pci_vc_load_port_arb_table(struct pci_dev *dev, int pos, int res)
85 if (pci_wait_for_pending(dev, status_pos, PCI_VC_RES_STATUS_TABLE)) 82 if (pci_wait_for_pending(dev, status_pos, PCI_VC_RES_STATUS_TABLE))
86 return; 83 return;
87 84
88 dev_err(&dev->dev, "VC%d port arbitration table failed to load\n", res); 85 pci_err(dev, "VC%d port arbitration table failed to load\n", res);
89} 86}
90 87
91/** 88/**
@@ -161,11 +158,11 @@ enable:
161 pci_write_config_dword(dev, ctrl_pos, ctrl); 158 pci_write_config_dword(dev, ctrl_pos, ctrl);
162 159
163 if (!pci_wait_for_pending(dev, status_pos, PCI_VC_RES_STATUS_NEGO)) 160 if (!pci_wait_for_pending(dev, status_pos, PCI_VC_RES_STATUS_NEGO))
164 dev_err(&dev->dev, "VC%d negotiation stuck pending\n", id); 161 pci_err(dev, "VC%d negotiation stuck pending\n", id);
165 162
166 if (link && !pci_wait_for_pending(link, status_pos2, 163 if (link && !pci_wait_for_pending(link, status_pos2,
167 PCI_VC_RES_STATUS_NEGO)) 164 PCI_VC_RES_STATUS_NEGO))
168 dev_err(&link->dev, "VC%d negotiation stuck pending\n", id); 165 pci_err(link, "VC%d negotiation stuck pending\n", id);
169} 166}
170 167
171/** 168/**
@@ -195,8 +192,7 @@ static int pci_vc_do_save_buffer(struct pci_dev *dev, int pos,
195 /* Sanity check buffer size for save/restore */ 192 /* Sanity check buffer size for save/restore */
196 if (buf && save_state->cap.size != 193 if (buf && save_state->cap.size !=
197 pci_vc_do_save_buffer(dev, pos, NULL, save)) { 194 pci_vc_do_save_buffer(dev, pos, NULL, save)) {
198 dev_err(&dev->dev, 195 pci_err(dev, "VC save buffer size does not match @0x%x\n", pos);
199 "VC save buffer size does not match @0x%x\n", pos);
200 return -ENOMEM; 196 return -ENOMEM;
201 } 197 }
202 198
@@ -366,14 +362,14 @@ int pci_save_vc_state(struct pci_dev *dev)
366 362
367 save_state = pci_find_saved_ext_cap(dev, vc_caps[i].id); 363 save_state = pci_find_saved_ext_cap(dev, vc_caps[i].id);
368 if (!save_state) { 364 if (!save_state) {
369 dev_err(&dev->dev, "%s buffer not found in %s\n", 365 pci_err(dev, "%s buffer not found in %s\n",
370 vc_caps[i].name, __func__); 366 vc_caps[i].name, __func__);
371 return -ENOMEM; 367 return -ENOMEM;
372 } 368 }
373 369
374 ret = pci_vc_do_save_buffer(dev, pos, save_state, true); 370 ret = pci_vc_do_save_buffer(dev, pos, save_state, true);
375 if (ret) { 371 if (ret) {
376 dev_err(&dev->dev, "%s save unsuccessful %s\n", 372 pci_err(dev, "%s save unsuccessful %s\n",
377 vc_caps[i].name, __func__); 373 vc_caps[i].name, __func__);
378 return ret; 374 return ret;
379 } 375 }
@@ -426,8 +422,7 @@ void pci_allocate_vc_save_buffers(struct pci_dev *dev)
426 422
427 len = pci_vc_do_save_buffer(dev, pos, NULL, false); 423 len = pci_vc_do_save_buffer(dev, pos, NULL, false);
428 if (pci_add_ext_cap_save_buffer(dev, vc_caps[i].id, len)) 424 if (pci_add_ext_cap_save_buffer(dev, vc_caps[i].id, len))
429 dev_err(&dev->dev, 425 pci_err(dev, "unable to preallocate %s save buffer\n",
430 "unable to preallocate %s save buffer\n",
431 vc_caps[i].name); 426 vc_caps[i].name);
432 } 427 }
433} 428}