diff options
Diffstat (limited to 'drivers/pci/pcie')
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv.c | 9 | ||||
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv_acpi.c | 8 | ||||
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv_core.c | 24 | ||||
-rw-r--r-- | drivers/pci/pcie/portdrv_bus.c | 1 | ||||
-rw-r--r-- | drivers/pci/pcie/portdrv_core.c | 22 | ||||
-rw-r--r-- | drivers/pci/pcie/portdrv_pci.c | 5 |
6 files changed, 34 insertions, 35 deletions
diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c index 07c3bdb6edc2..77036f46acfe 100644 --- a/drivers/pci/pcie/aer/aerdrv.c +++ b/drivers/pci/pcie/aer/aerdrv.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/pcieport_if.h> | 26 | #include <linux/pcieport_if.h> |
27 | 27 | ||
28 | #include "aerdrv.h" | 28 | #include "aerdrv.h" |
29 | #include "../../pci.h" | ||
29 | 30 | ||
30 | /* | 31 | /* |
31 | * Version Information | 32 | * Version Information |
@@ -219,8 +220,7 @@ static int __devinit aer_probe (struct pcie_device *dev, | |||
219 | 220 | ||
220 | /* Alloc rpc data structure */ | 221 | /* Alloc rpc data structure */ |
221 | if (!(rpc = aer_alloc_rpc(dev))) { | 222 | if (!(rpc = aer_alloc_rpc(dev))) { |
222 | printk(KERN_DEBUG "%s: Alloc rpc fails on PCIE device[%s]\n", | 223 | dev_printk(KERN_DEBUG, device, "alloc rpc failed\n"); |
223 | __func__, device->bus_id); | ||
224 | aer_remove(dev); | 224 | aer_remove(dev); |
225 | return -ENOMEM; | 225 | return -ENOMEM; |
226 | } | 226 | } |
@@ -228,8 +228,7 @@ static int __devinit aer_probe (struct pcie_device *dev, | |||
228 | /* Request IRQ ISR */ | 228 | /* Request IRQ ISR */ |
229 | if ((status = request_irq(dev->irq, aer_irq, IRQF_SHARED, "aerdrv", | 229 | if ((status = request_irq(dev->irq, aer_irq, IRQF_SHARED, "aerdrv", |
230 | dev))) { | 230 | dev))) { |
231 | printk(KERN_DEBUG "%s: Request ISR fails on PCIE device[%s]\n", | 231 | dev_printk(KERN_DEBUG, device, "request IRQ failed\n"); |
232 | __func__, device->bus_id); | ||
233 | aer_remove(dev); | 232 | aer_remove(dev); |
234 | return status; | 233 | return status; |
235 | } | 234 | } |
@@ -273,7 +272,7 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev) | |||
273 | * to issue Configuration Requests to those devices. | 272 | * to issue Configuration Requests to those devices. |
274 | */ | 273 | */ |
275 | msleep(200); | 274 | msleep(200); |
276 | printk(KERN_DEBUG "Complete link reset at Root[%s]\n", dev->dev.bus_id); | 275 | dev_printk(KERN_DEBUG, &dev->dev, "Root Port link has been reset\n"); |
277 | 276 | ||
278 | /* Enable Root Port's interrupt in response to error messages */ | 277 | /* Enable Root Port's interrupt in response to error messages */ |
279 | pci_read_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, &status); | 278 | pci_read_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, &status); |
diff --git a/drivers/pci/pcie/aer/aerdrv_acpi.c b/drivers/pci/pcie/aer/aerdrv_acpi.c index d39a78dbd026..30f581b8791f 100644 --- a/drivers/pci/pcie/aer/aerdrv_acpi.c +++ b/drivers/pci/pcie/aer/aerdrv_acpi.c | |||
@@ -50,10 +50,10 @@ int aer_osc_setup(struct pcie_device *pciedev) | |||
50 | } | 50 | } |
51 | 51 | ||
52 | if (ACPI_FAILURE(status)) { | 52 | if (ACPI_FAILURE(status)) { |
53 | printk(KERN_DEBUG "AER service couldn't init device %s - %s\n", | 53 | dev_printk(KERN_DEBUG, &pciedev->device, "AER service couldn't " |
54 | pciedev->device.bus_id, | 54 | "init device: %s\n", |
55 | (status == AE_SUPPORT || status == AE_NOT_FOUND) ? | 55 | (status == AE_SUPPORT || status == AE_NOT_FOUND) ? |
56 | "no _OSC support" : "Run ACPI _OSC fails"); | 56 | "no _OSC support" : "_OSC failed"); |
57 | return -1; | 57 | return -1; |
58 | } | 58 | } |
59 | 59 | ||
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c index aaa82392d1dc..ee5e7b5176d0 100644 --- a/drivers/pci/pcie/aer/aerdrv_core.c +++ b/drivers/pci/pcie/aer/aerdrv_core.c | |||
@@ -221,9 +221,9 @@ static void report_error_detected(struct pci_dev *dev, void *data) | |||
221 | * of a driver for this device is unaware of | 221 | * of a driver for this device is unaware of |
222 | * its hw state. | 222 | * its hw state. |
223 | */ | 223 | */ |
224 | printk(KERN_DEBUG "Device ID[%s] has %s\n", | 224 | dev_printk(KERN_DEBUG, &dev->dev, "device has %s\n", |
225 | dev->dev.bus_id, (dev->driver) ? | 225 | dev->driver ? |
226 | "no AER-aware driver" : "no driver"); | 226 | "no AER-aware driver" : "no driver"); |
227 | } | 227 | } |
228 | return; | 228 | return; |
229 | } | 229 | } |
@@ -304,7 +304,7 @@ static pci_ers_result_t broadcast_error_message(struct pci_dev *dev, | |||
304 | { | 304 | { |
305 | struct aer_broadcast_data result_data; | 305 | struct aer_broadcast_data result_data; |
306 | 306 | ||
307 | printk(KERN_DEBUG "Broadcast %s message\n", error_mesg); | 307 | dev_printk(KERN_DEBUG, &dev->dev, "broadcast %s message\n", error_mesg); |
308 | result_data.state = state; | 308 | result_data.state = state; |
309 | if (cb == report_error_detected) | 309 | if (cb == report_error_detected) |
310 | result_data.result = PCI_ERS_RESULT_CAN_RECOVER; | 310 | result_data.result = PCI_ERS_RESULT_CAN_RECOVER; |
@@ -404,18 +404,16 @@ static pci_ers_result_t reset_link(struct pcie_device *aerdev, | |||
404 | data.aer_driver = | 404 | data.aer_driver = |
405 | to_service_driver(aerdev->device.driver); | 405 | to_service_driver(aerdev->device.driver); |
406 | } else { | 406 | } else { |
407 | printk(KERN_DEBUG "No link-reset support to Device ID" | 407 | dev_printk(KERN_DEBUG, &dev->dev, "no link-reset " |
408 | "[%s]\n", | 408 | "support\n"); |
409 | dev->dev.bus_id); | ||
410 | return PCI_ERS_RESULT_DISCONNECT; | 409 | return PCI_ERS_RESULT_DISCONNECT; |
411 | } | 410 | } |
412 | } | 411 | } |
413 | 412 | ||
414 | status = data.aer_driver->reset_link(udev); | 413 | status = data.aer_driver->reset_link(udev); |
415 | if (status != PCI_ERS_RESULT_RECOVERED) { | 414 | if (status != PCI_ERS_RESULT_RECOVERED) { |
416 | printk(KERN_DEBUG "Link reset at upstream Device ID" | 415 | dev_printk(KERN_DEBUG, &dev->dev, "link reset at upstream " |
417 | "[%s] failed\n", | 416 | "device %s failed\n", pci_name(udev)); |
418 | udev->dev.bus_id); | ||
419 | return PCI_ERS_RESULT_DISCONNECT; | 417 | return PCI_ERS_RESULT_DISCONNECT; |
420 | } | 418 | } |
421 | 419 | ||
@@ -511,10 +509,12 @@ static void handle_error_source(struct pcie_device * aerdev, | |||
511 | } else { | 509 | } else { |
512 | status = do_recovery(aerdev, dev, info.severity); | 510 | status = do_recovery(aerdev, dev, info.severity); |
513 | if (status == PCI_ERS_RESULT_RECOVERED) { | 511 | if (status == PCI_ERS_RESULT_RECOVERED) { |
514 | printk(KERN_DEBUG "AER driver successfully recovered\n"); | 512 | dev_printk(KERN_DEBUG, &dev->dev, "AER driver " |
513 | "successfully recovered\n"); | ||
515 | } else { | 514 | } else { |
516 | /* TODO: Should kernel panic here? */ | 515 | /* TODO: Should kernel panic here? */ |
517 | printk(KERN_DEBUG "AER driver didn't recover\n"); | 516 | dev_printk(KERN_DEBUG, &dev->dev, "AER driver didn't " |
517 | "recover\n"); | ||
518 | } | 518 | } |
519 | } | 519 | } |
520 | } | 520 | } |
diff --git a/drivers/pci/pcie/portdrv_bus.c b/drivers/pci/pcie/portdrv_bus.c index 3f0976868eda..359fe5568df1 100644 --- a/drivers/pci/pcie/portdrv_bus.c +++ b/drivers/pci/pcie/portdrv_bus.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/pm.h> | 13 | #include <linux/pm.h> |
14 | 14 | ||
15 | #include <linux/pcieport_if.h> | 15 | #include <linux/pcieport_if.h> |
16 | #include "portdrv.h" | ||
16 | 17 | ||
17 | static int pcie_port_bus_match(struct device *dev, struct device_driver *drv); | 18 | static int pcie_port_bus_match(struct device *dev, struct device_driver *drv); |
18 | static int pcie_port_bus_suspend(struct device *dev, pm_message_t state); | 19 | static int pcie_port_bus_suspend(struct device *dev, pm_message_t state); |
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index fb0abfa508dc..890f0d2b370a 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c | |||
@@ -23,20 +23,20 @@ static int pcie_port_probe_service(struct device *dev) | |||
23 | { | 23 | { |
24 | struct pcie_device *pciedev; | 24 | struct pcie_device *pciedev; |
25 | struct pcie_port_service_driver *driver; | 25 | struct pcie_port_service_driver *driver; |
26 | int status = -ENODEV; | 26 | int status; |
27 | 27 | ||
28 | if (!dev || !dev->driver) | 28 | if (!dev || !dev->driver) |
29 | return status; | 29 | return -ENODEV; |
30 | 30 | ||
31 | driver = to_service_driver(dev->driver); | 31 | driver = to_service_driver(dev->driver); |
32 | if (!driver || !driver->probe) | 32 | if (!driver || !driver->probe) |
33 | return status; | 33 | return -ENODEV; |
34 | 34 | ||
35 | pciedev = to_pcie_device(dev); | 35 | pciedev = to_pcie_device(dev); |
36 | status = driver->probe(pciedev, driver->id_table); | 36 | status = driver->probe(pciedev, driver->id_table); |
37 | if (!status) { | 37 | if (!status) { |
38 | printk(KERN_DEBUG "Load service driver %s on pcie device %s\n", | 38 | dev_printk(KERN_DEBUG, dev, "service driver %s loaded\n", |
39 | driver->name, dev->bus_id); | 39 | driver->name); |
40 | get_device(dev); | 40 | get_device(dev); |
41 | } | 41 | } |
42 | return status; | 42 | return status; |
@@ -53,8 +53,8 @@ static int pcie_port_remove_service(struct device *dev) | |||
53 | pciedev = to_pcie_device(dev); | 53 | pciedev = to_pcie_device(dev); |
54 | driver = to_service_driver(dev->driver); | 54 | driver = to_service_driver(dev->driver); |
55 | if (driver && driver->remove) { | 55 | if (driver && driver->remove) { |
56 | printk(KERN_DEBUG "Unload service driver %s on pcie device %s\n", | 56 | dev_printk(KERN_DEBUG, dev, "unloading service driver %s\n", |
57 | driver->name, dev->bus_id); | 57 | driver->name); |
58 | driver->remove(pciedev); | 58 | driver->remove(pciedev); |
59 | put_device(dev); | 59 | put_device(dev); |
60 | } | 60 | } |
@@ -103,7 +103,7 @@ static int pcie_port_resume_service(struct device *dev) | |||
103 | */ | 103 | */ |
104 | static void release_pcie_device(struct device *dev) | 104 | static void release_pcie_device(struct device *dev) |
105 | { | 105 | { |
106 | printk(KERN_DEBUG "Free Port Service[%s]\n", dev->bus_id); | 106 | dev_printk(KERN_DEBUG, dev, "free port service\n"); |
107 | kfree(to_pcie_device(dev)); | 107 | kfree(to_pcie_device(dev)); |
108 | } | 108 | } |
109 | 109 | ||
@@ -150,7 +150,7 @@ static int assign_interrupt_mode(struct pci_dev *dev, int *vectors, int mask) | |||
150 | if (pos) { | 150 | if (pos) { |
151 | struct msix_entry msix_entries[PCIE_PORT_DEVICE_MAXSERVICES] = | 151 | struct msix_entry msix_entries[PCIE_PORT_DEVICE_MAXSERVICES] = |
152 | {{0, 0}, {0, 1}, {0, 2}, {0, 3}}; | 152 | {{0, 0}, {0, 1}, {0, 2}, {0, 3}}; |
153 | printk("%s Found MSIX capability\n", __func__); | 153 | dev_info(&dev->dev, "found MSI-X capability\n"); |
154 | status = pci_enable_msix(dev, msix_entries, nvec); | 154 | status = pci_enable_msix(dev, msix_entries, nvec); |
155 | if (!status) { | 155 | if (!status) { |
156 | int j = 0; | 156 | int j = 0; |
@@ -165,7 +165,7 @@ static int assign_interrupt_mode(struct pci_dev *dev, int *vectors, int mask) | |||
165 | if (status) { | 165 | if (status) { |
166 | pos = pci_find_capability(dev, PCI_CAP_ID_MSI); | 166 | pos = pci_find_capability(dev, PCI_CAP_ID_MSI); |
167 | if (pos) { | 167 | if (pos) { |
168 | printk("%s Found MSI capability\n", __func__); | 168 | dev_info(&dev->dev, "found MSI capability\n"); |
169 | status = pci_enable_msi(dev); | 169 | status = pci_enable_msi(dev); |
170 | if (!status) { | 170 | if (!status) { |
171 | interrupt_mode = PCIE_PORT_MSI_MODE; | 171 | interrupt_mode = PCIE_PORT_MSI_MODE; |
@@ -252,7 +252,7 @@ static struct pcie_device* alloc_pcie_device(struct pci_dev *parent, | |||
252 | return NULL; | 252 | return NULL; |
253 | 253 | ||
254 | pcie_device_init(parent, device, port_type, service_type, irq,irq_mode); | 254 | pcie_device_init(parent, device, port_type, service_type, irq,irq_mode); |
255 | printk(KERN_DEBUG "Allocate Port Service[%s]\n", device->device.bus_id); | 255 | dev_printk(KERN_DEBUG, &device->device, "allocate port service\n"); |
256 | return device; | 256 | return device; |
257 | } | 257 | } |
258 | 258 | ||
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index 51d163238d93..367c9c20000d 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c | |||
@@ -91,9 +91,8 @@ static int __devinit pcie_portdrv_probe (struct pci_dev *dev, | |||
91 | 91 | ||
92 | pci_set_master(dev); | 92 | pci_set_master(dev); |
93 | if (!dev->irq && dev->pin) { | 93 | if (!dev->irq && dev->pin) { |
94 | printk(KERN_WARNING | 94 | dev_warn(&dev->dev, "device [%04x/%04x] has invalid IRQ; " |
95 | "%s->Dev[%04x:%04x] has invalid IRQ. Check vendor BIOS\n", | 95 | "check vendor BIOS\n", dev->vendor, dev->device); |
96 | __func__, dev->vendor, dev->device); | ||
97 | } | 96 | } |
98 | if (pcie_port_device_register(dev)) { | 97 | if (pcie_port_device_register(dev)) { |
99 | pci_disable_device(dev); | 98 | pci_disable_device(dev); |