diff options
Diffstat (limited to 'drivers/pci/hotplug/pciehp_ctrl.c')
-rw-r--r-- | drivers/pci/hotplug/pciehp_ctrl.c | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index acb7f9efd182..d6c5eb297753 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c | |||
@@ -66,7 +66,7 @@ u8 pciehp_handle_attention_button(struct slot *p_slot) | |||
66 | /* | 66 | /* |
67 | * Button pressed - See if need to TAKE ACTION!!! | 67 | * Button pressed - See if need to TAKE ACTION!!! |
68 | */ | 68 | */ |
69 | ctrl_info(ctrl, "Button pressed on Slot(%s)\n", p_slot->name); | 69 | ctrl_info(ctrl, "Button pressed on Slot(%s)\n", slot_name(p_slot)); |
70 | event_type = INT_BUTTON_PRESS; | 70 | event_type = INT_BUTTON_PRESS; |
71 | 71 | ||
72 | queue_interrupt_event(p_slot, event_type); | 72 | queue_interrupt_event(p_slot, event_type); |
@@ -88,13 +88,13 @@ u8 pciehp_handle_switch_change(struct slot *p_slot) | |||
88 | /* | 88 | /* |
89 | * Switch opened | 89 | * Switch opened |
90 | */ | 90 | */ |
91 | ctrl_info(ctrl, "Latch open on Slot(%s)\n", p_slot->name); | 91 | ctrl_info(ctrl, "Latch open on Slot(%s)\n", slot_name(p_slot)); |
92 | event_type = INT_SWITCH_OPEN; | 92 | event_type = INT_SWITCH_OPEN; |
93 | } else { | 93 | } else { |
94 | /* | 94 | /* |
95 | * Switch closed | 95 | * Switch closed |
96 | */ | 96 | */ |
97 | ctrl_info(ctrl, "Latch close on Slot(%s)\n", p_slot->name); | 97 | ctrl_info(ctrl, "Latch close on Slot(%s)\n", slot_name(p_slot)); |
98 | event_type = INT_SWITCH_CLOSE; | 98 | event_type = INT_SWITCH_CLOSE; |
99 | } | 99 | } |
100 | 100 | ||
@@ -120,13 +120,14 @@ u8 pciehp_handle_presence_change(struct slot *p_slot) | |||
120 | /* | 120 | /* |
121 | * Card Present | 121 | * Card Present |
122 | */ | 122 | */ |
123 | ctrl_info(ctrl, "Card present on Slot(%s)\n", p_slot->name); | 123 | ctrl_info(ctrl, "Card present on Slot(%s)\n", slot_name(p_slot)); |
124 | event_type = INT_PRESENCE_ON; | 124 | event_type = INT_PRESENCE_ON; |
125 | } else { | 125 | } else { |
126 | /* | 126 | /* |
127 | * Not Present | 127 | * Not Present |
128 | */ | 128 | */ |
129 | ctrl_info(ctrl, "Card not present on Slot(%s)\n", p_slot->name); | 129 | ctrl_info(ctrl, "Card not present on Slot(%s)\n", |
130 | slot_name(p_slot)); | ||
130 | event_type = INT_PRESENCE_OFF; | 131 | event_type = INT_PRESENCE_OFF; |
131 | } | 132 | } |
132 | 133 | ||
@@ -148,13 +149,13 @@ u8 pciehp_handle_power_fault(struct slot *p_slot) | |||
148 | * power fault Cleared | 149 | * power fault Cleared |
149 | */ | 150 | */ |
150 | ctrl_info(ctrl, "Power fault cleared on Slot(%s)\n", | 151 | ctrl_info(ctrl, "Power fault cleared on Slot(%s)\n", |
151 | p_slot->name); | 152 | slot_name(p_slot)); |
152 | event_type = INT_POWER_FAULT_CLEAR; | 153 | event_type = INT_POWER_FAULT_CLEAR; |
153 | } else { | 154 | } else { |
154 | /* | 155 | /* |
155 | * power fault | 156 | * power fault |
156 | */ | 157 | */ |
157 | ctrl_info(ctrl, "Power fault on Slot(%s)\n", p_slot->name); | 158 | ctrl_info(ctrl, "Power fault on Slot(%s)\n", slot_name(p_slot)); |
158 | event_type = INT_POWER_FAULT; | 159 | event_type = INT_POWER_FAULT; |
159 | ctrl_info(ctrl, "power fault bit %x set\n", 0); | 160 | ctrl_info(ctrl, "power fault bit %x set\n", 0); |
160 | } | 161 | } |
@@ -225,9 +226,6 @@ static int board_added(struct slot *p_slot) | |||
225 | if (PWR_LED(ctrl)) | 226 | if (PWR_LED(ctrl)) |
226 | p_slot->hpc_ops->green_led_blink(p_slot); | 227 | p_slot->hpc_ops->green_led_blink(p_slot); |
227 | 228 | ||
228 | /* Wait for ~1 second */ | ||
229 | msleep(1000); | ||
230 | |||
231 | /* Check link training status */ | 229 | /* Check link training status */ |
232 | retval = p_slot->hpc_ops->check_lnk_status(ctrl); | 230 | retval = p_slot->hpc_ops->check_lnk_status(ctrl); |
233 | if (retval) { | 231 | if (retval) { |
@@ -412,12 +410,12 @@ static void handle_button_press_event(struct slot *p_slot) | |||
412 | p_slot->state = BLINKINGOFF_STATE; | 410 | p_slot->state = BLINKINGOFF_STATE; |
413 | ctrl_info(ctrl, | 411 | ctrl_info(ctrl, |
414 | "PCI slot #%s - powering off due to button " | 412 | "PCI slot #%s - powering off due to button " |
415 | "press.\n", p_slot->name); | 413 | "press.\n", slot_name(p_slot)); |
416 | } else { | 414 | } else { |
417 | p_slot->state = BLINKINGON_STATE; | 415 | p_slot->state = BLINKINGON_STATE; |
418 | ctrl_info(ctrl, | 416 | ctrl_info(ctrl, |
419 | "PCI slot #%s - powering on due to button " | 417 | "PCI slot #%s - powering on due to button " |
420 | "press.\n", p_slot->name); | 418 | "press.\n", slot_name(p_slot)); |
421 | } | 419 | } |
422 | /* blink green LED and turn off amber */ | 420 | /* blink green LED and turn off amber */ |
423 | if (PWR_LED(ctrl)) | 421 | if (PWR_LED(ctrl)) |
@@ -434,7 +432,7 @@ static void handle_button_press_event(struct slot *p_slot) | |||
434 | * press the attention again before the 5 sec. limit | 432 | * press the attention again before the 5 sec. limit |
435 | * expires to cancel hot-add or hot-remove | 433 | * expires to cancel hot-add or hot-remove |
436 | */ | 434 | */ |
437 | ctrl_info(ctrl, "Button cancel on Slot(%s)\n", p_slot->name); | 435 | ctrl_info(ctrl, "Button cancel on Slot(%s)\n", slot_name(p_slot)); |
438 | ctrl_dbg(ctrl, "%s: button cancel\n", __func__); | 436 | ctrl_dbg(ctrl, "%s: button cancel\n", __func__); |
439 | cancel_delayed_work(&p_slot->work); | 437 | cancel_delayed_work(&p_slot->work); |
440 | if (p_slot->state == BLINKINGOFF_STATE) { | 438 | if (p_slot->state == BLINKINGOFF_STATE) { |
@@ -447,7 +445,7 @@ static void handle_button_press_event(struct slot *p_slot) | |||
447 | if (ATTN_LED(ctrl)) | 445 | if (ATTN_LED(ctrl)) |
448 | p_slot->hpc_ops->set_attention_status(p_slot, 0); | 446 | p_slot->hpc_ops->set_attention_status(p_slot, 0); |
449 | ctrl_info(ctrl, "PCI slot #%s - action canceled " | 447 | ctrl_info(ctrl, "PCI slot #%s - action canceled " |
450 | "due to button press\n", p_slot->name); | 448 | "due to button press\n", slot_name(p_slot)); |
451 | p_slot->state = STATIC_STATE; | 449 | p_slot->state = STATIC_STATE; |
452 | break; | 450 | break; |
453 | case POWEROFF_STATE: | 451 | case POWEROFF_STATE: |
@@ -457,7 +455,7 @@ static void handle_button_press_event(struct slot *p_slot) | |||
457 | * this means that the previous attention button action | 455 | * this means that the previous attention button action |
458 | * to hot-add or hot-remove is undergoing | 456 | * to hot-add or hot-remove is undergoing |
459 | */ | 457 | */ |
460 | ctrl_info(ctrl, "Button ignore on Slot(%s)\n", p_slot->name); | 458 | ctrl_info(ctrl, "Button ignore on Slot(%s)\n", slot_name(p_slot)); |
461 | update_slot_info(p_slot); | 459 | update_slot_info(p_slot); |
462 | break; | 460 | break; |
463 | default: | 461 | default: |
@@ -540,7 +538,7 @@ int pciehp_enable_slot(struct slot *p_slot) | |||
540 | rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); | 538 | rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); |
541 | if (rc || !getstatus) { | 539 | if (rc || !getstatus) { |
542 | ctrl_info(ctrl, "%s: no adapter on slot(%s)\n", | 540 | ctrl_info(ctrl, "%s: no adapter on slot(%s)\n", |
543 | __func__, p_slot->name); | 541 | __func__, slot_name(p_slot)); |
544 | mutex_unlock(&p_slot->ctrl->crit_sect); | 542 | mutex_unlock(&p_slot->ctrl->crit_sect); |
545 | return -ENODEV; | 543 | return -ENODEV; |
546 | } | 544 | } |
@@ -548,7 +546,7 @@ int pciehp_enable_slot(struct slot *p_slot) | |||
548 | rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); | 546 | rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); |
549 | if (rc || getstatus) { | 547 | if (rc || getstatus) { |
550 | ctrl_info(ctrl, "%s: latch open on slot(%s)\n", | 548 | ctrl_info(ctrl, "%s: latch open on slot(%s)\n", |
551 | __func__, p_slot->name); | 549 | __func__, slot_name(p_slot)); |
552 | mutex_unlock(&p_slot->ctrl->crit_sect); | 550 | mutex_unlock(&p_slot->ctrl->crit_sect); |
553 | return -ENODEV; | 551 | return -ENODEV; |
554 | } | 552 | } |
@@ -558,7 +556,7 @@ int pciehp_enable_slot(struct slot *p_slot) | |||
558 | rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); | 556 | rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); |
559 | if (rc || getstatus) { | 557 | if (rc || getstatus) { |
560 | ctrl_info(ctrl, "%s: already enabled on slot(%s)\n", | 558 | ctrl_info(ctrl, "%s: already enabled on slot(%s)\n", |
561 | __func__, p_slot->name); | 559 | __func__, slot_name(p_slot)); |
562 | mutex_unlock(&p_slot->ctrl->crit_sect); | 560 | mutex_unlock(&p_slot->ctrl->crit_sect); |
563 | return -EINVAL; | 561 | return -EINVAL; |
564 | } | 562 | } |
@@ -594,7 +592,7 @@ int pciehp_disable_slot(struct slot *p_slot) | |||
594 | ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); | 592 | ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); |
595 | if (ret || !getstatus) { | 593 | if (ret || !getstatus) { |
596 | ctrl_info(ctrl, "%s: no adapter on slot(%s)\n", | 594 | ctrl_info(ctrl, "%s: no adapter on slot(%s)\n", |
597 | __func__, p_slot->name); | 595 | __func__, slot_name(p_slot)); |
598 | mutex_unlock(&p_slot->ctrl->crit_sect); | 596 | mutex_unlock(&p_slot->ctrl->crit_sect); |
599 | return -ENODEV; | 597 | return -ENODEV; |
600 | } | 598 | } |
@@ -604,7 +602,7 @@ int pciehp_disable_slot(struct slot *p_slot) | |||
604 | ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); | 602 | ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); |
605 | if (ret || getstatus) { | 603 | if (ret || getstatus) { |
606 | ctrl_info(ctrl, "%s: latch open on slot(%s)\n", | 604 | ctrl_info(ctrl, "%s: latch open on slot(%s)\n", |
607 | __func__, p_slot->name); | 605 | __func__, slot_name(p_slot)); |
608 | mutex_unlock(&p_slot->ctrl->crit_sect); | 606 | mutex_unlock(&p_slot->ctrl->crit_sect); |
609 | return -ENODEV; | 607 | return -ENODEV; |
610 | } | 608 | } |
@@ -614,7 +612,7 @@ int pciehp_disable_slot(struct slot *p_slot) | |||
614 | ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); | 612 | ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); |
615 | if (ret || !getstatus) { | 613 | if (ret || !getstatus) { |
616 | ctrl_info(ctrl, "%s: already disabled slot(%s)\n", | 614 | ctrl_info(ctrl, "%s: already disabled slot(%s)\n", |
617 | __func__, p_slot->name); | 615 | __func__, slot_name(p_slot)); |
618 | mutex_unlock(&p_slot->ctrl->crit_sect); | 616 | mutex_unlock(&p_slot->ctrl->crit_sect); |
619 | return -EINVAL; | 617 | return -EINVAL; |
620 | } | 618 | } |
@@ -645,14 +643,16 @@ int pciehp_sysfs_enable_slot(struct slot *p_slot) | |||
645 | break; | 643 | break; |
646 | case POWERON_STATE: | 644 | case POWERON_STATE: |
647 | ctrl_info(ctrl, "Slot %s is already in powering on state\n", | 645 | ctrl_info(ctrl, "Slot %s is already in powering on state\n", |
648 | p_slot->name); | 646 | slot_name(p_slot)); |
649 | break; | 647 | break; |
650 | case BLINKINGOFF_STATE: | 648 | case BLINKINGOFF_STATE: |
651 | case POWEROFF_STATE: | 649 | case POWEROFF_STATE: |
652 | ctrl_info(ctrl, "Already enabled on slot %s\n", p_slot->name); | 650 | ctrl_info(ctrl, "Already enabled on slot %s\n", |
651 | slot_name(p_slot)); | ||
653 | break; | 652 | break; |
654 | default: | 653 | default: |
655 | ctrl_err(ctrl, "Not a valid state on slot %s\n", p_slot->name); | 654 | ctrl_err(ctrl, "Not a valid state on slot %s\n", |
655 | slot_name(p_slot)); | ||
656 | break; | 656 | break; |
657 | } | 657 | } |
658 | mutex_unlock(&p_slot->lock); | 658 | mutex_unlock(&p_slot->lock); |
@@ -678,14 +678,16 @@ int pciehp_sysfs_disable_slot(struct slot *p_slot) | |||
678 | break; | 678 | break; |
679 | case POWEROFF_STATE: | 679 | case POWEROFF_STATE: |
680 | ctrl_info(ctrl, "Slot %s is already in powering off state\n", | 680 | ctrl_info(ctrl, "Slot %s is already in powering off state\n", |
681 | p_slot->name); | 681 | slot_name(p_slot)); |
682 | break; | 682 | break; |
683 | case BLINKINGON_STATE: | 683 | case BLINKINGON_STATE: |
684 | case POWERON_STATE: | 684 | case POWERON_STATE: |
685 | ctrl_info(ctrl, "Already disabled on slot %s\n", p_slot->name); | 685 | ctrl_info(ctrl, "Already disabled on slot %s\n", |
686 | slot_name(p_slot)); | ||
686 | break; | 687 | break; |
687 | default: | 688 | default: |
688 | ctrl_err(ctrl, "Not a valid state on slot %s\n", p_slot->name); | 689 | ctrl_err(ctrl, "Not a valid state on slot %s\n", |
690 | slot_name(p_slot)); | ||
689 | break; | 691 | break; |
690 | } | 692 | } |
691 | mutex_unlock(&p_slot->lock); | 693 | mutex_unlock(&p_slot->lock); |