diff options
-rw-r--r-- | drivers/pci/hotplug/pciehp_ctrl.c | 56 | ||||
-rw-r--r-- | drivers/pci/hotplug/pciehp_hpc.c | 12 |
2 files changed, 33 insertions, 35 deletions
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index a7876842d5c1..bf50f2681178 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c | |||
@@ -106,7 +106,7 @@ static int board_added(struct slot *p_slot) | |||
106 | 106 | ||
107 | /* Check for a power fault */ | 107 | /* Check for a power fault */ |
108 | if (ctrl->power_fault_detected || pciehp_query_power_fault(p_slot)) { | 108 | if (ctrl->power_fault_detected || pciehp_query_power_fault(p_slot)) { |
109 | ctrl_err(ctrl, "Power fault on slot %s\n", slot_name(p_slot)); | 109 | ctrl_err(ctrl, "Slot(%s): Power fault\n", slot_name(p_slot)); |
110 | retval = -EIO; | 110 | retval = -EIO; |
111 | goto err_exit; | 111 | goto err_exit; |
112 | } | 112 | } |
@@ -254,11 +254,11 @@ static void handle_button_press_event(struct slot *p_slot) | |||
254 | pciehp_get_power_status(p_slot, &getstatus); | 254 | pciehp_get_power_status(p_slot, &getstatus); |
255 | if (getstatus) { | 255 | if (getstatus) { |
256 | p_slot->state = BLINKINGOFF_STATE; | 256 | p_slot->state = BLINKINGOFF_STATE; |
257 | ctrl_info(ctrl, "PCI slot #%s - powering off due to button press\n", | 257 | ctrl_info(ctrl, "Slot(%s): Powering off due to button press\n", |
258 | slot_name(p_slot)); | 258 | slot_name(p_slot)); |
259 | } else { | 259 | } else { |
260 | p_slot->state = BLINKINGON_STATE; | 260 | p_slot->state = BLINKINGON_STATE; |
261 | ctrl_info(ctrl, "PCI slot #%s - powering on due to button press\n", | 261 | ctrl_info(ctrl, "Slot(%s) Powering on due to button press\n", |
262 | slot_name(p_slot)); | 262 | slot_name(p_slot)); |
263 | } | 263 | } |
264 | /* blink green LED and turn off amber */ | 264 | /* blink green LED and turn off amber */ |
@@ -273,14 +273,14 @@ static void handle_button_press_event(struct slot *p_slot) | |||
273 | * press the attention again before the 5 sec. limit | 273 | * press the attention again before the 5 sec. limit |
274 | * expires to cancel hot-add or hot-remove | 274 | * expires to cancel hot-add or hot-remove |
275 | */ | 275 | */ |
276 | ctrl_info(ctrl, "Button cancel on Slot(%s)\n", slot_name(p_slot)); | 276 | ctrl_info(ctrl, "Slot(%s): Button cancel\n", slot_name(p_slot)); |
277 | cancel_delayed_work(&p_slot->work); | 277 | cancel_delayed_work(&p_slot->work); |
278 | if (p_slot->state == BLINKINGOFF_STATE) | 278 | if (p_slot->state == BLINKINGOFF_STATE) |
279 | pciehp_green_led_on(p_slot); | 279 | pciehp_green_led_on(p_slot); |
280 | else | 280 | else |
281 | pciehp_green_led_off(p_slot); | 281 | pciehp_green_led_off(p_slot); |
282 | pciehp_set_attention_status(p_slot, 0); | 282 | pciehp_set_attention_status(p_slot, 0); |
283 | ctrl_info(ctrl, "PCI slot #%s - action canceled due to button press\n", | 283 | ctrl_info(ctrl, "Slot(%s): Action canceled due to button press\n", |
284 | slot_name(p_slot)); | 284 | slot_name(p_slot)); |
285 | p_slot->state = STATIC_STATE; | 285 | p_slot->state = STATIC_STATE; |
286 | break; | 286 | break; |
@@ -291,10 +291,12 @@ static void handle_button_press_event(struct slot *p_slot) | |||
291 | * this means that the previous attention button action | 291 | * this means that the previous attention button action |
292 | * to hot-add or hot-remove is undergoing | 292 | * to hot-add or hot-remove is undergoing |
293 | */ | 293 | */ |
294 | ctrl_info(ctrl, "Button ignore on Slot(%s)\n", slot_name(p_slot)); | 294 | ctrl_info(ctrl, "Slot(%s): Button ignored\n", |
295 | slot_name(p_slot)); | ||
295 | break; | 296 | break; |
296 | default: | 297 | default: |
297 | ctrl_warn(ctrl, "ignoring invalid state %#x\n", p_slot->state); | 298 | ctrl_err(ctrl, "Slot(%s): Ignoring invalid state %#x\n", |
299 | slot_name(p_slot), p_slot->state); | ||
298 | break; | 300 | break; |
299 | } | 301 | } |
300 | } | 302 | } |
@@ -317,31 +319,27 @@ static void handle_link_event(struct slot *p_slot, u32 event) | |||
317 | break; | 319 | break; |
318 | case POWERON_STATE: | 320 | case POWERON_STATE: |
319 | if (event == INT_LINK_UP) { | 321 | if (event == INT_LINK_UP) { |
320 | ctrl_info(ctrl, | 322 | ctrl_info(ctrl, "Slot(%s): Link Up event ignored; already powering on\n", |
321 | "Link Up event ignored on slot(%s): already powering on\n", | ||
322 | slot_name(p_slot)); | 323 | slot_name(p_slot)); |
323 | } else { | 324 | } else { |
324 | ctrl_info(ctrl, | 325 | ctrl_info(ctrl, "Slot(%s): Link Down event queued; currently getting powered on\n", |
325 | "Link Down event queued on slot(%s): currently getting powered on\n", | ||
326 | slot_name(p_slot)); | 326 | slot_name(p_slot)); |
327 | pciehp_queue_power_work(p_slot, DISABLE_REQ); | 327 | pciehp_queue_power_work(p_slot, DISABLE_REQ); |
328 | } | 328 | } |
329 | break; | 329 | break; |
330 | case POWEROFF_STATE: | 330 | case POWEROFF_STATE: |
331 | if (event == INT_LINK_UP) { | 331 | if (event == INT_LINK_UP) { |
332 | ctrl_info(ctrl, | 332 | ctrl_info(ctrl, "Slot(%s): Link Up event queued; currently getting powered off\n", |
333 | "Link Up event queued on slot(%s): currently getting powered off\n", | ||
334 | slot_name(p_slot)); | 333 | slot_name(p_slot)); |
335 | pciehp_queue_power_work(p_slot, ENABLE_REQ); | 334 | pciehp_queue_power_work(p_slot, ENABLE_REQ); |
336 | } else { | 335 | } else { |
337 | ctrl_info(ctrl, | 336 | ctrl_info(ctrl, "Slot(%s): Link Down event ignored; already powering off\n", |
338 | "Link Down event ignored on slot(%s): already powering off\n", | ||
339 | slot_name(p_slot)); | 337 | slot_name(p_slot)); |
340 | } | 338 | } |
341 | break; | 339 | break; |
342 | default: | 340 | default: |
343 | ctrl_err(ctrl, "ignoring invalid state %#x on slot(%s)\n", | 341 | ctrl_err(ctrl, "Slot(%s): Ignoring invalid state %#x\n", |
344 | p_slot->state, slot_name(p_slot)); | 342 | slot_name(p_slot), p_slot->state); |
345 | break; | 343 | break; |
346 | } | 344 | } |
347 | } | 345 | } |
@@ -396,13 +394,13 @@ int pciehp_enable_slot(struct slot *p_slot) | |||
396 | 394 | ||
397 | pciehp_get_adapter_status(p_slot, &getstatus); | 395 | pciehp_get_adapter_status(p_slot, &getstatus); |
398 | if (!getstatus) { | 396 | if (!getstatus) { |
399 | ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot)); | 397 | ctrl_info(ctrl, "Slot(%s): No adapter\n", slot_name(p_slot)); |
400 | return -ENODEV; | 398 | return -ENODEV; |
401 | } | 399 | } |
402 | if (MRL_SENS(p_slot->ctrl)) { | 400 | if (MRL_SENS(p_slot->ctrl)) { |
403 | pciehp_get_latch_status(p_slot, &getstatus); | 401 | pciehp_get_latch_status(p_slot, &getstatus); |
404 | if (getstatus) { | 402 | if (getstatus) { |
405 | ctrl_info(ctrl, "Latch open on slot(%s)\n", | 403 | ctrl_info(ctrl, "Slot(%s): Latch open\n", |
406 | slot_name(p_slot)); | 404 | slot_name(p_slot)); |
407 | return -ENODEV; | 405 | return -ENODEV; |
408 | } | 406 | } |
@@ -411,7 +409,7 @@ int pciehp_enable_slot(struct slot *p_slot) | |||
411 | if (POWER_CTRL(p_slot->ctrl)) { | 409 | if (POWER_CTRL(p_slot->ctrl)) { |
412 | pciehp_get_power_status(p_slot, &getstatus); | 410 | pciehp_get_power_status(p_slot, &getstatus); |
413 | if (getstatus) { | 411 | if (getstatus) { |
414 | ctrl_info(ctrl, "Already enabled on slot(%s)\n", | 412 | ctrl_info(ctrl, "Slot(%s): Already enabled\n", |
415 | slot_name(p_slot)); | 413 | slot_name(p_slot)); |
416 | return -EINVAL; | 414 | return -EINVAL; |
417 | } | 415 | } |
@@ -440,7 +438,7 @@ int pciehp_disable_slot(struct slot *p_slot) | |||
440 | if (POWER_CTRL(p_slot->ctrl)) { | 438 | if (POWER_CTRL(p_slot->ctrl)) { |
441 | pciehp_get_power_status(p_slot, &getstatus); | 439 | pciehp_get_power_status(p_slot, &getstatus); |
442 | if (!getstatus) { | 440 | if (!getstatus) { |
443 | ctrl_info(ctrl, "Already disabled on slot(%s)\n", | 441 | ctrl_info(ctrl, "Slot(%s): Already disabled\n", |
444 | slot_name(p_slot)); | 442 | slot_name(p_slot)); |
445 | return -EINVAL; | 443 | return -EINVAL; |
446 | } | 444 | } |
@@ -468,17 +466,17 @@ int pciehp_sysfs_enable_slot(struct slot *p_slot) | |||
468 | p_slot->state = STATIC_STATE; | 466 | p_slot->state = STATIC_STATE; |
469 | break; | 467 | break; |
470 | case POWERON_STATE: | 468 | case POWERON_STATE: |
471 | ctrl_info(ctrl, "Slot %s is already in powering on state\n", | 469 | ctrl_info(ctrl, "Slot(%s): Already in powering on state\n", |
472 | slot_name(p_slot)); | 470 | slot_name(p_slot)); |
473 | break; | 471 | break; |
474 | case BLINKINGOFF_STATE: | 472 | case BLINKINGOFF_STATE: |
475 | case POWEROFF_STATE: | 473 | case POWEROFF_STATE: |
476 | ctrl_info(ctrl, "Already enabled on slot %s\n", | 474 | ctrl_info(ctrl, "Slot(%s): Already enabled\n", |
477 | slot_name(p_slot)); | 475 | slot_name(p_slot)); |
478 | break; | 476 | break; |
479 | default: | 477 | default: |
480 | ctrl_err(ctrl, "invalid state %#x on slot %s\n", | 478 | ctrl_err(ctrl, "Slot(%s): Invalid state %#x\n", |
481 | p_slot->state, slot_name(p_slot)); | 479 | slot_name(p_slot), p_slot->state); |
482 | break; | 480 | break; |
483 | } | 481 | } |
484 | mutex_unlock(&p_slot->lock); | 482 | mutex_unlock(&p_slot->lock); |
@@ -505,17 +503,17 @@ int pciehp_sysfs_disable_slot(struct slot *p_slot) | |||
505 | p_slot->state = STATIC_STATE; | 503 | p_slot->state = STATIC_STATE; |
506 | break; | 504 | break; |
507 | case POWEROFF_STATE: | 505 | case POWEROFF_STATE: |
508 | ctrl_info(ctrl, "Slot %s is already in powering off state\n", | 506 | ctrl_info(ctrl, "Slot(%s): Already in powering off state\n", |
509 | slot_name(p_slot)); | 507 | slot_name(p_slot)); |
510 | break; | 508 | break; |
511 | case BLINKINGON_STATE: | 509 | case BLINKINGON_STATE: |
512 | case POWERON_STATE: | 510 | case POWERON_STATE: |
513 | ctrl_info(ctrl, "Already disabled on slot %s\n", | 511 | ctrl_info(ctrl, "Slot(%s): Already disabled\n", |
514 | slot_name(p_slot)); | 512 | slot_name(p_slot)); |
515 | break; | 513 | break; |
516 | default: | 514 | default: |
517 | ctrl_err(ctrl, "invalid state %#x on slot %s\n", | 515 | ctrl_err(ctrl, "Slot(%s): Invalid state %#x\n", |
518 | p_slot->state, slot_name(p_slot)); | 516 | slot_name(p_slot), p_slot->state); |
519 | break; | 517 | break; |
520 | } | 518 | } |
521 | mutex_unlock(&p_slot->lock); | 519 | mutex_unlock(&p_slot->lock); |
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 60e1d55b4eef..4582fdf2d8b5 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -592,7 +592,7 @@ static irqreturn_t pciehp_isr(int irq, void *dev_id) | |||
592 | 592 | ||
593 | /* Check Attention Button Pressed */ | 593 | /* Check Attention Button Pressed */ |
594 | if (events & PCI_EXP_SLTSTA_ABP) { | 594 | if (events & PCI_EXP_SLTSTA_ABP) { |
595 | ctrl_info(ctrl, "Button pressed on Slot(%s)\n", | 595 | ctrl_info(ctrl, "Slot(%s): Attention button pressed\n", |
596 | slot_name(slot)); | 596 | slot_name(slot)); |
597 | pciehp_queue_interrupt_event(slot, INT_BUTTON_PRESS); | 597 | pciehp_queue_interrupt_event(slot, INT_BUTTON_PRESS); |
598 | } | 598 | } |
@@ -600,8 +600,8 @@ static irqreturn_t pciehp_isr(int irq, void *dev_id) | |||
600 | /* Check Presence Detect Changed */ | 600 | /* Check Presence Detect Changed */ |
601 | if (events & PCI_EXP_SLTSTA_PDC) { | 601 | if (events & PCI_EXP_SLTSTA_PDC) { |
602 | present = !!(status & PCI_EXP_SLTSTA_PDS); | 602 | present = !!(status & PCI_EXP_SLTSTA_PDS); |
603 | ctrl_info(ctrl, "Card %spresent on Slot(%s)\n", | 603 | ctrl_info(ctrl, "Slot(%s): Card %spresent\n", slot_name(slot), |
604 | present ? "" : "not ", slot_name(slot)); | 604 | present ? "" : "not "); |
605 | pciehp_queue_interrupt_event(slot, present ? INT_PRESENCE_ON : | 605 | pciehp_queue_interrupt_event(slot, present ? INT_PRESENCE_ON : |
606 | INT_PRESENCE_OFF); | 606 | INT_PRESENCE_OFF); |
607 | } | 607 | } |
@@ -609,13 +609,13 @@ static irqreturn_t pciehp_isr(int irq, void *dev_id) | |||
609 | /* Check Power Fault Detected */ | 609 | /* Check Power Fault Detected */ |
610 | if ((events & PCI_EXP_SLTSTA_PFD) && !ctrl->power_fault_detected) { | 610 | if ((events & PCI_EXP_SLTSTA_PFD) && !ctrl->power_fault_detected) { |
611 | ctrl->power_fault_detected = 1; | 611 | ctrl->power_fault_detected = 1; |
612 | ctrl_err(ctrl, "Power fault on slot %s\n", slot_name(slot)); | 612 | ctrl_err(ctrl, "Slot(%s): Power fault\n", slot_name(slot)); |
613 | pciehp_queue_interrupt_event(slot, INT_POWER_FAULT); | 613 | pciehp_queue_interrupt_event(slot, INT_POWER_FAULT); |
614 | } | 614 | } |
615 | 615 | ||
616 | if (events & PCI_EXP_SLTSTA_DLLSC) { | 616 | if (events & PCI_EXP_SLTSTA_DLLSC) { |
617 | ctrl_info(ctrl, "slot(%s): Link %s event\n", | 617 | ctrl_info(ctrl, "Slot(%s): Link %s\n", slot_name(slot), |
618 | slot_name(slot), link ? "Up" : "Down"); | 618 | link ? "Up" : "Down"); |
619 | pciehp_queue_interrupt_event(slot, link ? INT_LINK_UP : | 619 | pciehp_queue_interrupt_event(slot, link ? INT_LINK_UP : |
620 | INT_LINK_DOWN); | 620 | INT_LINK_DOWN); |
621 | } | 621 | } |