aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2013-09-27 18:35:43 -0400
committerBjorn Helgaas <bhelgaas@google.com>2013-09-27 18:35:43 -0400
commit605d240052473228bf0c8c051cad825fddb25502 (patch)
treec1eeed2abdf258cb6cf2d14f5986c2e9bed40a1e /drivers/pci
parentd3c02799d32039ddd548c20680f7982b646ba3d8 (diff)
parent09a2c73ddfc7f173237fc7209a65b34dd5bcb5ed (diff)
Merge branch 'pci/misc' into next
* pci/misc: PCI: Remove unused PCI_MSIX_FLAGS_BIRMASK definition PCI: acpiphp_ibm: Convert to dynamic debug PCI: acpiphp: Convert to dynamic debug PCI: Remove Intel Haswell D3 delays PCI: Pass type, width, and prefetchability for window alignment PCI: Document reason for using pci_is_root_bus() PCI: Use pci_is_root_bus() to check for root bus PCI: Remove unused "is_pcie" from pci_dev structure PCI: Update pci_find_slot() description in pci.txt [SCSI] qla2xxx: Use standard PCIe Capability Link register field names PCI: Fix comment typo, remove unnecessary !! in pci_is_pcie() PCI: Drop "setting latency timer" messages
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/hotplug/acpiphp.h10
-rw-r--r--drivers/pci/hotplug/acpiphp_core.c37
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c23
-rw-r--r--drivers/pci/hotplug/acpiphp_ibm.c58
-rw-r--r--drivers/pci/pci.c2
-rw-r--r--drivers/pci/probe.c1
-rw-r--r--drivers/pci/quirks.c23
-rw-r--r--drivers/pci/setup-bus.c4
8 files changed, 80 insertions, 78 deletions
diff --git a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h
index f4e028924667..26100f510b10 100644
--- a/drivers/pci/hotplug/acpiphp.h
+++ b/drivers/pci/hotplug/acpiphp.h
@@ -39,16 +39,6 @@
39#include <linux/mutex.h> 39#include <linux/mutex.h>
40#include <linux/pci_hotplug.h> 40#include <linux/pci_hotplug.h>
41 41
42#define dbg(format, arg...) \
43 do { \
44 if (acpiphp_debug) \
45 printk(KERN_DEBUG "%s: " format, \
46 MY_NAME , ## arg); \
47 } while (0)
48#define err(format, arg...) printk(KERN_ERR "%s: " format, MY_NAME , ## arg)
49#define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg)
50#define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME , ## arg)
51
52struct acpiphp_context; 42struct acpiphp_context;
53struct acpiphp_bridge; 43struct acpiphp_bridge;
54struct acpiphp_slot; 44struct acpiphp_slot;
diff --git a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c
index bf2203ef1308..8650d39db392 100644
--- a/drivers/pci/hotplug/acpiphp_core.c
+++ b/drivers/pci/hotplug/acpiphp_core.c
@@ -31,6 +31,8 @@
31 * 31 *
32 */ 32 */
33 33
34#define pr_fmt(fmt) "acpiphp: " fmt
35
34#include <linux/init.h> 36#include <linux/init.h>
35#include <linux/module.h> 37#include <linux/module.h>
36#include <linux/moduleparam.h> 38#include <linux/moduleparam.h>
@@ -43,12 +45,9 @@
43#include <linux/smp.h> 45#include <linux/smp.h>
44#include "acpiphp.h" 46#include "acpiphp.h"
45 47
46#define MY_NAME "acpiphp"
47
48/* name size which is used for entries in pcihpfs */ 48/* name size which is used for entries in pcihpfs */
49#define SLOT_NAME_SIZE 21 /* {_SUN} */ 49#define SLOT_NAME_SIZE 21 /* {_SUN} */
50 50
51bool acpiphp_debug;
52bool acpiphp_disabled; 51bool acpiphp_disabled;
53 52
54/* local variables */ 53/* local variables */
@@ -61,9 +60,7 @@ static struct acpiphp_attention_info *attention_info;
61MODULE_AUTHOR(DRIVER_AUTHOR); 60MODULE_AUTHOR(DRIVER_AUTHOR);
62MODULE_DESCRIPTION(DRIVER_DESC); 61MODULE_DESCRIPTION(DRIVER_DESC);
63MODULE_LICENSE("GPL"); 62MODULE_LICENSE("GPL");
64MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
65MODULE_PARM_DESC(disable, "disable acpiphp driver"); 63MODULE_PARM_DESC(disable, "disable acpiphp driver");
66module_param_named(debug, acpiphp_debug, bool, 0644);
67module_param_named(disable, acpiphp_disabled, bool, 0444); 64module_param_named(disable, acpiphp_disabled, bool, 0444);
68 65
69/* export the attention callback registration methods */ 66/* export the attention callback registration methods */
@@ -139,7 +136,7 @@ static int enable_slot(struct hotplug_slot *hotplug_slot)
139{ 136{
140 struct slot *slot = hotplug_slot->private; 137 struct slot *slot = hotplug_slot->private;
141 138
142 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 139 pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot));
143 140
144 /* enable the specified slot */ 141 /* enable the specified slot */
145 return acpiphp_enable_slot(slot->acpi_slot); 142 return acpiphp_enable_slot(slot->acpi_slot);
@@ -156,7 +153,7 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
156{ 153{
157 struct slot *slot = hotplug_slot->private; 154 struct slot *slot = hotplug_slot->private;
158 155
159 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 156 pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot));
160 157
161 /* disable the specified slot */ 158 /* disable the specified slot */
162 return acpiphp_disable_and_eject_slot(slot->acpi_slot); 159 return acpiphp_disable_and_eject_slot(slot->acpi_slot);
@@ -176,8 +173,9 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
176 { 173 {
177 int retval = -ENODEV; 174 int retval = -ENODEV;
178 175
179 dbg("%s - physical_slot = %s\n", __func__, hotplug_slot_name(hotplug_slot)); 176 pr_debug("%s - physical_slot = %s\n", __func__,
180 177 hotplug_slot_name(hotplug_slot));
178
181 if (attention_info && try_module_get(attention_info->owner)) { 179 if (attention_info && try_module_get(attention_info->owner)) {
182 retval = attention_info->set_attn(hotplug_slot, status); 180 retval = attention_info->set_attn(hotplug_slot, status);
183 module_put(attention_info->owner); 181 module_put(attention_info->owner);
@@ -199,7 +197,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
199{ 197{
200 struct slot *slot = hotplug_slot->private; 198 struct slot *slot = hotplug_slot->private;
201 199
202 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 200 pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot));
203 201
204 *value = acpiphp_get_power_status(slot->acpi_slot); 202 *value = acpiphp_get_power_status(slot->acpi_slot);
205 203
@@ -221,7 +219,8 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
221{ 219{
222 int retval = -EINVAL; 220 int retval = -EINVAL;
223 221
224 dbg("%s - physical_slot = %s\n", __func__, hotplug_slot_name(hotplug_slot)); 222 pr_debug("%s - physical_slot = %s\n", __func__,
223 hotplug_slot_name(hotplug_slot));
225 224
226 if (attention_info && try_module_get(attention_info->owner)) { 225 if (attention_info && try_module_get(attention_info->owner)) {
227 retval = attention_info->get_attn(hotplug_slot, value); 226 retval = attention_info->get_attn(hotplug_slot, value);
@@ -244,7 +243,7 @@ static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
244{ 243{
245 struct slot *slot = hotplug_slot->private; 244 struct slot *slot = hotplug_slot->private;
246 245
247 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 246 pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot));
248 247
249 *value = acpiphp_get_latch_status(slot->acpi_slot); 248 *value = acpiphp_get_latch_status(slot->acpi_slot);
250 249
@@ -264,7 +263,7 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
264{ 263{
265 struct slot *slot = hotplug_slot->private; 264 struct slot *slot = hotplug_slot->private;
266 265
267 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 266 pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot));
268 267
269 *value = acpiphp_get_adapter_status(slot->acpi_slot); 268 *value = acpiphp_get_adapter_status(slot->acpi_slot);
270 269
@@ -279,7 +278,7 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
279{ 278{
280 struct slot *slot = hotplug_slot->private; 279 struct slot *slot = hotplug_slot->private;
281 280
282 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 281 pr_debug("%s - physical_slot = %s\n", __func__, slot_name(slot));
283 282
284 kfree(slot->hotplug_slot); 283 kfree(slot->hotplug_slot);
285 kfree(slot); 284 kfree(slot);
@@ -322,11 +321,11 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot,
322 if (retval == -EBUSY) 321 if (retval == -EBUSY)
323 goto error_hpslot; 322 goto error_hpslot;
324 if (retval) { 323 if (retval) {
325 err("pci_hp_register failed with error %d\n", retval); 324 pr_err("pci_hp_register failed with error %d\n", retval);
326 goto error_hpslot; 325 goto error_hpslot;
327 } 326 }
328 327
329 info("Slot [%s] registered\n", slot_name(slot)); 328 pr_info("Slot [%s] registered\n", slot_name(slot));
330 329
331 return 0; 330 return 0;
332error_hpslot: 331error_hpslot:
@@ -343,17 +342,17 @@ void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *acpiphp_slot)
343 struct slot *slot = acpiphp_slot->slot; 342 struct slot *slot = acpiphp_slot->slot;
344 int retval = 0; 343 int retval = 0;
345 344
346 info("Slot [%s] unregistered\n", slot_name(slot)); 345 pr_info("Slot [%s] unregistered\n", slot_name(slot));
347 346
348 retval = pci_hp_deregister(slot->hotplug_slot); 347 retval = pci_hp_deregister(slot->hotplug_slot);
349 if (retval) 348 if (retval)
350 err("pci_hp_deregister failed with error %d\n", retval); 349 pr_err("pci_hp_deregister failed with error %d\n", retval);
351} 350}
352 351
353 352
354void __init acpiphp_init(void) 353void __init acpiphp_init(void)
355{ 354{
356 info(DRIVER_DESC " version: " DRIVER_VERSION "%s\n", 355 pr_info(DRIVER_DESC " version: " DRIVER_VERSION "%s\n",
357 acpiphp_disabled ? ", disabled by user; please report a bug" 356 acpiphp_disabled ? ", disabled by user; please report a bug"
358 : ""); 357 : "");
359} 358}
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 0b7d23b4ad95..6557702a0592 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -39,6 +39,8 @@
39 * bus. It loses the refcount when the the driver unloads. 39 * bus. It loses the refcount when the the driver unloads.
40 */ 40 */
41 41
42#define pr_fmt(fmt) "acpiphp_glue: " fmt
43
42#include <linux/init.h> 44#include <linux/init.h>
43#include <linux/module.h> 45#include <linux/module.h>
44 46
@@ -58,8 +60,6 @@ static LIST_HEAD(bridge_list);
58static DEFINE_MUTEX(bridge_mutex); 60static DEFINE_MUTEX(bridge_mutex);
59static DEFINE_MUTEX(acpiphp_context_lock); 61static DEFINE_MUTEX(acpiphp_context_lock);
60 62
61#define MY_NAME "acpiphp_glue"
62
63static void handle_hotplug_event(acpi_handle handle, u32 type, void *data); 63static void handle_hotplug_event(acpi_handle handle, u32 type, void *data);
64static void acpiphp_sanitize_bus(struct pci_bus *bus); 64static void acpiphp_sanitize_bus(struct pci_bus *bus);
65static void acpiphp_set_hpp_values(struct pci_bus *bus); 65static void acpiphp_set_hpp_values(struct pci_bus *bus);
@@ -335,7 +335,7 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data,
335 if (ACPI_FAILURE(status)) 335 if (ACPI_FAILURE(status))
336 sun = bridge->nr_slots; 336 sun = bridge->nr_slots;
337 337
338 dbg("found ACPI PCI Hotplug slot %llu at PCI %04x:%02x:%02x\n", 338 pr_debug("found ACPI PCI Hotplug slot %llu at PCI %04x:%02x:%02x\n",
339 sun, pci_domain_nr(pbus), pbus->number, device); 339 sun, pci_domain_nr(pbus), pbus->number, device);
340 340
341 retval = acpiphp_register_hotplug_slot(slot, sun); 341 retval = acpiphp_register_hotplug_slot(slot, sun);
@@ -343,10 +343,10 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data,
343 slot->slot = NULL; 343 slot->slot = NULL;
344 bridge->nr_slots--; 344 bridge->nr_slots--;
345 if (retval == -EBUSY) 345 if (retval == -EBUSY)
346 warn("Slot %llu already registered by another " 346 pr_warn("Slot %llu already registered by another "
347 "hotplug driver\n", sun); 347 "hotplug driver\n", sun);
348 else 348 else
349 warn("acpiphp_register_hotplug_slot failed " 349 pr_warn("acpiphp_register_hotplug_slot failed "
350 "(err code = 0x%x)\n", retval); 350 "(err code = 0x%x)\n", retval);
351 } 351 }
352 /* Even if the slot registration fails, we can still use it. */ 352 /* Even if the slot registration fails, we can still use it. */
@@ -369,7 +369,7 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data,
369 if (register_hotplug_dock_device(handle, 369 if (register_hotplug_dock_device(handle,
370 &acpiphp_dock_ops, context, 370 &acpiphp_dock_ops, context,
371 acpiphp_dock_init, acpiphp_dock_release)) 371 acpiphp_dock_init, acpiphp_dock_release))
372 dbg("failed to register dock device\n"); 372 pr_debug("failed to register dock device\n");
373 } 373 }
374 374
375 /* install notify handler */ 375 /* install notify handler */
@@ -427,7 +427,7 @@ static void cleanup_bridge(struct acpiphp_bridge *bridge)
427 ACPI_SYSTEM_NOTIFY, 427 ACPI_SYSTEM_NOTIFY,
428 handle_hotplug_event); 428 handle_hotplug_event);
429 if (ACPI_FAILURE(status)) 429 if (ACPI_FAILURE(status))
430 err("failed to remove notify handler\n"); 430 pr_err("failed to remove notify handler\n");
431 } 431 }
432 } 432 }
433 if (slot->slot) 433 if (slot->slot)
@@ -830,8 +830,9 @@ static void hotplug_event(acpi_handle handle, u32 type, void *data)
830 switch (type) { 830 switch (type) {
831 case ACPI_NOTIFY_BUS_CHECK: 831 case ACPI_NOTIFY_BUS_CHECK:
832 /* bus re-enumerate */ 832 /* bus re-enumerate */
833 dbg("%s: Bus check notify on %s\n", __func__, objname); 833 pr_debug("%s: Bus check notify on %s\n", __func__, objname);
834 dbg("%s: re-enumerating slots under %s\n", __func__, objname); 834 pr_debug("%s: re-enumerating slots under %s\n",
835 __func__, objname);
835 if (bridge) { 836 if (bridge) {
836 acpiphp_check_bridge(bridge); 837 acpiphp_check_bridge(bridge);
837 } else { 838 } else {
@@ -845,7 +846,7 @@ static void hotplug_event(acpi_handle handle, u32 type, void *data)
845 846
846 case ACPI_NOTIFY_DEVICE_CHECK: 847 case ACPI_NOTIFY_DEVICE_CHECK:
847 /* device check */ 848 /* device check */
848 dbg("%s: Device check notify on %s\n", __func__, objname); 849 pr_debug("%s: Device check notify on %s\n", __func__, objname);
849 if (bridge) { 850 if (bridge) {
850 acpiphp_check_bridge(bridge); 851 acpiphp_check_bridge(bridge);
851 } else { 852 } else {
@@ -866,7 +867,7 @@ static void hotplug_event(acpi_handle handle, u32 type, void *data)
866 867
867 case ACPI_NOTIFY_EJECT_REQUEST: 868 case ACPI_NOTIFY_EJECT_REQUEST:
868 /* request device eject */ 869 /* request device eject */
869 dbg("%s: Device eject notify on %s\n", __func__, objname); 870 pr_debug("%s: Device eject notify on %s\n", __func__, objname);
870 acpiphp_disable_and_eject_slot(func->slot); 871 acpiphp_disable_and_eject_slot(func->slot);
871 break; 872 break;
872 } 873 }
diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c
index 2f5786c8522c..0d64c414bf78 100644
--- a/drivers/pci/hotplug/acpiphp_ibm.c
+++ b/drivers/pci/hotplug/acpiphp_ibm.c
@@ -25,6 +25,8 @@
25 * 25 *
26 */ 26 */
27 27
28#define pr_fmt(fmt) "acpiphp_ibm: " fmt
29
28#include <linux/init.h> 30#include <linux/init.h>
29#include <linux/slab.h> 31#include <linux/slab.h>
30#include <linux/module.h> 32#include <linux/module.h>
@@ -43,23 +45,11 @@
43#define DRIVER_AUTHOR "Irene Zubarev <zubarev@us.ibm.com>, Vernon Mauery <vernux@us.ibm.com>" 45#define DRIVER_AUTHOR "Irene Zubarev <zubarev@us.ibm.com>, Vernon Mauery <vernux@us.ibm.com>"
44#define DRIVER_DESC "ACPI Hot Plug PCI Controller Driver IBM extension" 46#define DRIVER_DESC "ACPI Hot Plug PCI Controller Driver IBM extension"
45 47
46static bool debug;
47 48
48MODULE_AUTHOR(DRIVER_AUTHOR); 49MODULE_AUTHOR(DRIVER_AUTHOR);
49MODULE_DESCRIPTION(DRIVER_DESC); 50MODULE_DESCRIPTION(DRIVER_DESC);
50MODULE_LICENSE("GPL"); 51MODULE_LICENSE("GPL");
51MODULE_VERSION(DRIVER_VERSION); 52MODULE_VERSION(DRIVER_VERSION);
52module_param(debug, bool, 0644);
53MODULE_PARM_DESC(debug, " Debugging mode enabled or not");
54#define MY_NAME "acpiphp_ibm"
55
56#undef dbg
57#define dbg(format, arg...) \
58do { \
59 if (debug) \
60 printk(KERN_DEBUG "%s: " format, \
61 MY_NAME , ## arg); \
62} while (0)
63 53
64#define FOUND_APCI 0x61504349 54#define FOUND_APCI 0x61504349
65/* these are the names for the IBM ACPI pseudo-device */ 55/* these are the names for the IBM ACPI pseudo-device */
@@ -189,7 +179,7 @@ static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status)
189 179
190 ibm_slot = ibm_slot_from_id(hpslot_to_sun(slot)); 180 ibm_slot = ibm_slot_from_id(hpslot_to_sun(slot));
191 181
192 dbg("%s: set slot %d (%d) attention status to %d\n", __func__, 182 pr_debug("%s: set slot %d (%d) attention status to %d\n", __func__,
193 ibm_slot->slot.slot_num, ibm_slot->slot.slot_id, 183 ibm_slot->slot.slot_num, ibm_slot->slot.slot_id,
194 (status ? 1 : 0)); 184 (status ? 1 : 0));
195 185
@@ -202,10 +192,10 @@ static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status)
202 192
203 stat = acpi_evaluate_integer(ibm_acpi_handle, "APLS", &params, &rc); 193 stat = acpi_evaluate_integer(ibm_acpi_handle, "APLS", &params, &rc);
204 if (ACPI_FAILURE(stat)) { 194 if (ACPI_FAILURE(stat)) {
205 err("APLS evaluation failed: 0x%08x\n", stat); 195 pr_err("APLS evaluation failed: 0x%08x\n", stat);
206 return -ENODEV; 196 return -ENODEV;
207 } else if (!rc) { 197 } else if (!rc) {
208 err("APLS method failed: 0x%08llx\n", rc); 198 pr_err("APLS method failed: 0x%08llx\n", rc);
209 return -ERANGE; 199 return -ERANGE;
210 } 200 }
211 return 0; 201 return 0;
@@ -234,7 +224,7 @@ static int ibm_get_attention_status(struct hotplug_slot *slot, u8 *status)
234 else 224 else
235 *status = 0; 225 *status = 0;
236 226
237 dbg("%s: get slot %d (%d) attention status is %d\n", __func__, 227 pr_debug("%s: get slot %d (%d) attention status is %d\n", __func__,
238 ibm_slot->slot.slot_num, ibm_slot->slot.slot_id, 228 ibm_slot->slot.slot_num, ibm_slot->slot.slot_id,
239 *status); 229 *status);
240 230
@@ -266,10 +256,10 @@ static void ibm_handle_events(acpi_handle handle, u32 event, void *context)
266 u8 subevent = event & 0xf0; 256 u8 subevent = event & 0xf0;
267 struct notification *note = context; 257 struct notification *note = context;
268 258
269 dbg("%s: Received notification %02x\n", __func__, event); 259 pr_debug("%s: Received notification %02x\n", __func__, event);
270 260
271 if (subevent == 0x80) { 261 if (subevent == 0x80) {
272 dbg("%s: generationg bus event\n", __func__); 262 pr_debug("%s: generationg bus event\n", __func__);
273 acpi_bus_generate_netlink_event(note->device->pnp.device_class, 263 acpi_bus_generate_netlink_event(note->device->pnp.device_class,
274 dev_name(&note->device->dev), 264 dev_name(&note->device->dev),
275 note->event, detail); 265 note->event, detail);
@@ -301,7 +291,7 @@ static int ibm_get_table_from_acpi(char **bufp)
301 291
302 status = acpi_evaluate_object(ibm_acpi_handle, "APCI", NULL, &buffer); 292 status = acpi_evaluate_object(ibm_acpi_handle, "APCI", NULL, &buffer);
303 if (ACPI_FAILURE(status)) { 293 if (ACPI_FAILURE(status)) {
304 err("%s: APCI evaluation failed\n", __func__); 294 pr_err("%s: APCI evaluation failed\n", __func__);
305 return -ENODEV; 295 return -ENODEV;
306 } 296 }
307 297
@@ -309,13 +299,13 @@ static int ibm_get_table_from_acpi(char **bufp)
309 if (!(package) || 299 if (!(package) ||
310 (package->type != ACPI_TYPE_PACKAGE) || 300 (package->type != ACPI_TYPE_PACKAGE) ||
311 !(package->package.elements)) { 301 !(package->package.elements)) {
312 err("%s: Invalid APCI object\n", __func__); 302 pr_err("%s: Invalid APCI object\n", __func__);
313 goto read_table_done; 303 goto read_table_done;
314 } 304 }
315 305
316 for(size = 0, i = 0; i < package->package.count; i++) { 306 for(size = 0, i = 0; i < package->package.count; i++) {
317 if (package->package.elements[i].type != ACPI_TYPE_BUFFER) { 307 if (package->package.elements[i].type != ACPI_TYPE_BUFFER) {
318 err("%s: Invalid APCI element %d\n", __func__, i); 308 pr_err("%s: Invalid APCI element %d\n", __func__, i);
319 goto read_table_done; 309 goto read_table_done;
320 } 310 }
321 size += package->package.elements[i].buffer.length; 311 size += package->package.elements[i].buffer.length;
@@ -325,7 +315,7 @@ static int ibm_get_table_from_acpi(char **bufp)
325 goto read_table_done; 315 goto read_table_done;
326 316
327 lbuf = kzalloc(size, GFP_KERNEL); 317 lbuf = kzalloc(size, GFP_KERNEL);
328 dbg("%s: element count: %i, ASL table size: %i, &table = 0x%p\n", 318 pr_debug("%s: element count: %i, ASL table size: %i, &table = 0x%p\n",
329 __func__, package->package.count, size, lbuf); 319 __func__, package->package.count, size, lbuf);
330 320
331 if (lbuf) { 321 if (lbuf) {
@@ -370,8 +360,8 @@ static ssize_t ibm_read_apci_table(struct file *filp, struct kobject *kobj,
370{ 360{
371 int bytes_read = -EINVAL; 361 int bytes_read = -EINVAL;
372 char *table = NULL; 362 char *table = NULL;
373 363
374 dbg("%s: pos = %d, size = %zd\n", __func__, (int)pos, size); 364 pr_debug("%s: pos = %d, size = %zd\n", __func__, (int)pos, size);
375 365
376 if (pos == 0) { 366 if (pos == 0) {
377 bytes_read = ibm_get_table_from_acpi(&table); 367 bytes_read = ibm_get_table_from_acpi(&table);
@@ -403,7 +393,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle,
403 393
404 status = acpi_get_object_info(handle, &info); 394 status = acpi_get_object_info(handle, &info);
405 if (ACPI_FAILURE(status)) { 395 if (ACPI_FAILURE(status)) {
406 err("%s: Failed to get device information status=0x%x\n", 396 pr_err("%s: Failed to get device information status=0x%x\n",
407 __func__, status); 397 __func__, status);
408 return retval; 398 return retval;
409 } 399 }
@@ -411,7 +401,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle,
411 if (info->current_status && (info->valid & ACPI_VALID_HID) && 401 if (info->current_status && (info->valid & ACPI_VALID_HID) &&
412 (!strcmp(info->hardware_id.string, IBM_HARDWARE_ID1) || 402 (!strcmp(info->hardware_id.string, IBM_HARDWARE_ID1) ||
413 !strcmp(info->hardware_id.string, IBM_HARDWARE_ID2))) { 403 !strcmp(info->hardware_id.string, IBM_HARDWARE_ID2))) {
414 dbg("found hardware: %s, handle: %p\n", 404 pr_debug("found hardware: %s, handle: %p\n",
415 info->hardware_id.string, handle); 405 info->hardware_id.string, handle);
416 *phandle = handle; 406 *phandle = handle;
417 /* returning non-zero causes the search to stop 407 /* returning non-zero causes the search to stop
@@ -432,18 +422,18 @@ static int __init ibm_acpiphp_init(void)
432 struct acpi_device *device; 422 struct acpi_device *device;
433 struct kobject *sysdir = &pci_slots_kset->kobj; 423 struct kobject *sysdir = &pci_slots_kset->kobj;
434 424
435 dbg("%s\n", __func__); 425 pr_debug("%s\n", __func__);
436 426
437 if (acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, 427 if (acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
438 ACPI_UINT32_MAX, ibm_find_acpi_device, NULL, 428 ACPI_UINT32_MAX, ibm_find_acpi_device, NULL,
439 &ibm_acpi_handle, NULL) != FOUND_APCI) { 429 &ibm_acpi_handle, NULL) != FOUND_APCI) {
440 err("%s: acpi_walk_namespace failed\n", __func__); 430 pr_err("%s: acpi_walk_namespace failed\n", __func__);
441 retval = -ENODEV; 431 retval = -ENODEV;
442 goto init_return; 432 goto init_return;
443 } 433 }
444 dbg("%s: found IBM aPCI device\n", __func__); 434 pr_debug("%s: found IBM aPCI device\n", __func__);
445 if (acpi_bus_get_device(ibm_acpi_handle, &device)) { 435 if (acpi_bus_get_device(ibm_acpi_handle, &device)) {
446 err("%s: acpi_bus_get_device failed\n", __func__); 436 pr_err("%s: acpi_bus_get_device failed\n", __func__);
447 retval = -ENODEV; 437 retval = -ENODEV;
448 goto init_return; 438 goto init_return;
449 } 439 }
@@ -457,7 +447,7 @@ static int __init ibm_acpiphp_init(void)
457 ACPI_DEVICE_NOTIFY, ibm_handle_events, 447 ACPI_DEVICE_NOTIFY, ibm_handle_events,
458 &ibm_note); 448 &ibm_note);
459 if (ACPI_FAILURE(status)) { 449 if (ACPI_FAILURE(status)) {
460 err("%s: Failed to register notification handler\n", 450 pr_err("%s: Failed to register notification handler\n",
461 __func__); 451 __func__);
462 retval = -EBUSY; 452 retval = -EBUSY;
463 goto init_cleanup; 453 goto init_cleanup;
@@ -479,17 +469,17 @@ static void __exit ibm_acpiphp_exit(void)
479 acpi_status status; 469 acpi_status status;
480 struct kobject *sysdir = &pci_slots_kset->kobj; 470 struct kobject *sysdir = &pci_slots_kset->kobj;
481 471
482 dbg("%s\n", __func__); 472 pr_debug("%s\n", __func__);
483 473
484 if (acpiphp_unregister_attention(&ibm_attention_info)) 474 if (acpiphp_unregister_attention(&ibm_attention_info))
485 err("%s: attention info deregistration failed", __func__); 475 pr_err("%s: attention info deregistration failed", __func__);
486 476
487 status = acpi_remove_notify_handler( 477 status = acpi_remove_notify_handler(
488 ibm_acpi_handle, 478 ibm_acpi_handle,
489 ACPI_DEVICE_NOTIFY, 479 ACPI_DEVICE_NOTIFY,
490 ibm_handle_events); 480 ibm_handle_events);
491 if (ACPI_FAILURE(status)) 481 if (ACPI_FAILURE(status))
492 err("%s: Notification handler removal failed\n", __func__); 482 pr_err("%s: Notification handler removal failed\n", __func__);
493 /* remove the /sys entries */ 483 /* remove the /sys entries */
494 sysfs_remove_bin_file(sysdir, &ibm_apci_table_attr); 484 sysfs_remove_bin_file(sysdir, &ibm_apci_table_attr);
495} 485}
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index e8ccf6c0f08a..ad7fc72a40a0 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2854,7 +2854,7 @@ void __weak pcibios_set_master(struct pci_dev *dev)
2854 lat = pcibios_max_latency; 2854 lat = pcibios_max_latency;
2855 else 2855 else
2856 return; 2856 return;
2857 dev_printk(KERN_DEBUG, &dev->dev, "setting latency timer to %d\n", lat); 2857
2858 pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat); 2858 pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
2859} 2859}
2860 2860
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index c90d0f8021e7..5e14f5a51357 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -983,7 +983,6 @@ void set_pcie_port_type(struct pci_dev *pdev)
983 pos = pci_find_capability(pdev, PCI_CAP_ID_EXP); 983 pos = pci_find_capability(pdev, PCI_CAP_ID_EXP);
984 if (!pos) 984 if (!pos)
985 return; 985 return;
986 pdev->is_pcie = 1;
987 pdev->pcie_cap = pos; 986 pdev->pcie_cap = pos;
988 pci_read_config_word(pdev, pos + PCI_EXP_FLAGS, &reg16); 987 pci_read_config_word(pdev, pos + PCI_EXP_FLAGS, &reg16);
989 pdev->pcie_flags_reg = reg16; 988 pdev->pcie_flags_reg = reg16;
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index f6c31fabf3af..91490453c229 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2955,6 +2955,29 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0102, disable_igfx_irq);
2955DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); 2955DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq);
2956 2956
2957/* 2957/*
2958 * PCI devices which are on Intel chips can skip the 10ms delay
2959 * before entering D3 mode.
2960 */
2961static void quirk_remove_d3_delay(struct pci_dev *dev)
2962{
2963 dev->d3_delay = 0;
2964}
2965DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0c00, quirk_remove_d3_delay);
2966DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0412, quirk_remove_d3_delay);
2967DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0c0c, quirk_remove_d3_delay);
2968DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c31, quirk_remove_d3_delay);
2969DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c3a, quirk_remove_d3_delay);
2970DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c3d, quirk_remove_d3_delay);
2971DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c2d, quirk_remove_d3_delay);
2972DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c20, quirk_remove_d3_delay);
2973DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c18, quirk_remove_d3_delay);
2974DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c1c, quirk_remove_d3_delay);
2975DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c26, quirk_remove_d3_delay);
2976DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c4e, quirk_remove_d3_delay);
2977DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c02, quirk_remove_d3_delay);
2978DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x8c22, quirk_remove_d3_delay);
2979
2980/*
2958 * Some devices may pass our check in pci_intx_mask_supported if 2981 * Some devices may pass our check in pci_intx_mask_supported if
2959 * PCI_COMMAND_INTX_DISABLE works though they actually do not properly 2982 * PCI_COMMAND_INTX_DISABLE works though they actually do not properly
2960 * support this feature. 2983 * support this feature.
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index bc26d7990cc3..4ce83b26ae9e 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -982,7 +982,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
982 } 982 }
983 983
984 min_align = calculate_mem_align(aligns, max_order); 984 min_align = calculate_mem_align(aligns, max_order);
985 min_align = max(min_align, window_alignment(bus, b_res->flags & mask)); 985 min_align = max(min_align, window_alignment(bus, b_res->flags));
986 size0 = calculate_memsize(size, min_size, 0, resource_size(b_res), min_align); 986 size0 = calculate_memsize(size, min_size, 0, resource_size(b_res), min_align);
987 if (children_add_size > add_size) 987 if (children_add_size > add_size)
988 add_size = children_add_size; 988 add_size = children_add_size;
@@ -1136,7 +1136,7 @@ void __ref __pci_bus_size_bridges(struct pci_bus *bus,
1136 } 1136 }
1137 1137
1138 /* The root bus? */ 1138 /* The root bus? */
1139 if (!bus->self) 1139 if (pci_is_root_bus(bus))
1140 return; 1140 return;
1141 1141
1142 switch (bus->self->class >> 8) { 1142 switch (bus->self->class >> 8) {