diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2006-09-22 13:17:10 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-10-18 14:36:10 -0400 |
commit | 49ed2b4963cd00993eab518b820a6700f94f222d (patch) | |
tree | d315e016f093fa48d0a132bf535f81c8dda97b99 /drivers/pci/hotplug | |
parent | b4a1efffcf8070dbc7734f27da10ce49fb9f2a34 (diff) |
pciehp: fix improper info messages
The slot number displayed in info messages would cause a confusion
because those are displayed in several ways (decimal and hex).
Furthermore, those slot number is not same as slot name (directory
name). This patch fixes those improper info messages.
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r-- | drivers/pci/hotplug/pciehp.h | 8 | ||||
-rw-r--r-- | drivers/pci/hotplug/pciehp_ctrl.c | 47 |
2 files changed, 33 insertions, 22 deletions
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index eaea9d36a1bb..b71f774aca16 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h | |||
@@ -166,10 +166,10 @@ struct controller { | |||
166 | * error Messages | 166 | * error Messages |
167 | */ | 167 | */ |
168 | #define msg_initialization_err "Initialization failure, error=%d\n" | 168 | #define msg_initialization_err "Initialization failure, error=%d\n" |
169 | #define msg_button_on "PCI slot #%d - powering on due to button press.\n" | 169 | #define msg_button_on "PCI slot #%s - powering on due to button press.\n" |
170 | #define msg_button_off "PCI slot #%d - powering off due to button press.\n" | 170 | #define msg_button_off "PCI slot #%s - powering off due to button press.\n" |
171 | #define msg_button_cancel "PCI slot #%d - action canceled due to button press.\n" | 171 | #define msg_button_cancel "PCI slot #%s - action canceled due to button press.\n" |
172 | #define msg_button_ignore "PCI slot #%d - button press ignored. (action in progress...)\n" | 172 | #define msg_button_ignore "PCI slot #%s - button press ignored. (action in progress...)\n" |
173 | 173 | ||
174 | /* controller functions */ | 174 | /* controller functions */ |
175 | extern int pciehp_event_start_thread (void); | 175 | extern int pciehp_event_start_thread (void); |
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index 41290a106bd8..f602b042adcf 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c | |||
@@ -43,6 +43,11 @@ static int event_finished; | |||
43 | static unsigned long pushbutton_pending; /* = 0 */ | 43 | static unsigned long pushbutton_pending; /* = 0 */ |
44 | static unsigned long surprise_rm_pending; /* = 0 */ | 44 | static unsigned long surprise_rm_pending; /* = 0 */ |
45 | 45 | ||
46 | static inline char *slot_name(struct slot *p_slot) | ||
47 | { | ||
48 | return p_slot->hotplug_slot->name; | ||
49 | } | ||
50 | |||
46 | u8 pciehp_handle_attention_button(u8 hp_slot, void *inst_id) | 51 | u8 pciehp_handle_attention_button(u8 hp_slot, void *inst_id) |
47 | { | 52 | { |
48 | struct controller *ctrl = (struct controller *) inst_id; | 53 | struct controller *ctrl = (struct controller *) inst_id; |
@@ -68,7 +73,7 @@ u8 pciehp_handle_attention_button(u8 hp_slot, void *inst_id) | |||
68 | /* | 73 | /* |
69 | * Button pressed - See if need to TAKE ACTION!!! | 74 | * Button pressed - See if need to TAKE ACTION!!! |
70 | */ | 75 | */ |
71 | info("Button pressed on Slot(%d)\n", ctrl->first_slot + hp_slot); | 76 | info("Button pressed on Slot(%s)\n", slot_name(p_slot)); |
72 | taskInfo->event_type = INT_BUTTON_PRESS; | 77 | taskInfo->event_type = INT_BUTTON_PRESS; |
73 | 78 | ||
74 | if ((p_slot->state == BLINKINGON_STATE) | 79 | if ((p_slot->state == BLINKINGON_STATE) |
@@ -78,7 +83,7 @@ u8 pciehp_handle_attention_button(u8 hp_slot, void *inst_id) | |||
78 | * or hot-remove | 83 | * or hot-remove |
79 | */ | 84 | */ |
80 | taskInfo->event_type = INT_BUTTON_CANCEL; | 85 | taskInfo->event_type = INT_BUTTON_CANCEL; |
81 | info("Button cancel on Slot(%d)\n", ctrl->first_slot + hp_slot); | 86 | info("Button cancel on Slot(%s)\n", slot_name(p_slot)); |
82 | } else if ((p_slot->state == POWERON_STATE) | 87 | } else if ((p_slot->state == POWERON_STATE) |
83 | || (p_slot->state == POWEROFF_STATE)) { | 88 | || (p_slot->state == POWEROFF_STATE)) { |
84 | /* Ignore if the slot is on power-on or power-off state; this | 89 | /* Ignore if the slot is on power-on or power-off state; this |
@@ -86,7 +91,7 @@ u8 pciehp_handle_attention_button(u8 hp_slot, void *inst_id) | |||
86 | * hot-remove is undergoing | 91 | * hot-remove is undergoing |
87 | */ | 92 | */ |
88 | taskInfo->event_type = INT_BUTTON_IGNORE; | 93 | taskInfo->event_type = INT_BUTTON_IGNORE; |
89 | info("Button ignore on Slot(%d)\n", ctrl->first_slot + hp_slot); | 94 | info("Button ignore on Slot(%s)\n", slot_name(p_slot)); |
90 | } | 95 | } |
91 | 96 | ||
92 | if (rc) | 97 | if (rc) |
@@ -122,13 +127,13 @@ u8 pciehp_handle_switch_change(u8 hp_slot, void *inst_id) | |||
122 | /* | 127 | /* |
123 | * Switch opened | 128 | * Switch opened |
124 | */ | 129 | */ |
125 | info("Latch open on Slot(%d)\n", ctrl->first_slot + hp_slot); | 130 | info("Latch open on Slot(%s)\n", slot_name(p_slot)); |
126 | taskInfo->event_type = INT_SWITCH_OPEN; | 131 | taskInfo->event_type = INT_SWITCH_OPEN; |
127 | } else { | 132 | } else { |
128 | /* | 133 | /* |
129 | * Switch closed | 134 | * Switch closed |
130 | */ | 135 | */ |
131 | info("Latch close on Slot(%d)\n", ctrl->first_slot + hp_slot); | 136 | info("Latch close on Slot(%s)\n", slot_name(p_slot)); |
132 | taskInfo->event_type = INT_SWITCH_CLOSE; | 137 | taskInfo->event_type = INT_SWITCH_CLOSE; |
133 | } | 138 | } |
134 | 139 | ||
@@ -166,13 +171,13 @@ u8 pciehp_handle_presence_change(u8 hp_slot, void *inst_id) | |||
166 | /* | 171 | /* |
167 | * Card Present | 172 | * Card Present |
168 | */ | 173 | */ |
169 | info("Card present on Slot(%d)\n", ctrl->first_slot + hp_slot); | 174 | info("Card present on Slot(%s)\n", slot_name(p_slot)); |
170 | taskInfo->event_type = INT_PRESENCE_ON; | 175 | taskInfo->event_type = INT_PRESENCE_ON; |
171 | } else { | 176 | } else { |
172 | /* | 177 | /* |
173 | * Not Present | 178 | * Not Present |
174 | */ | 179 | */ |
175 | info("Card not present on Slot(%d)\n", ctrl->first_slot + hp_slot); | 180 | info("Card not present on Slot(%s)\n", slot_name(p_slot)); |
176 | taskInfo->event_type = INT_PRESENCE_OFF; | 181 | taskInfo->event_type = INT_PRESENCE_OFF; |
177 | } | 182 | } |
178 | 183 | ||
@@ -206,13 +211,13 @@ u8 pciehp_handle_power_fault(u8 hp_slot, void *inst_id) | |||
206 | /* | 211 | /* |
207 | * power fault Cleared | 212 | * power fault Cleared |
208 | */ | 213 | */ |
209 | info("Power fault cleared on Slot(%d)\n", ctrl->first_slot + hp_slot); | 214 | info("Power fault cleared on Slot(%s)\n", slot_name(p_slot)); |
210 | taskInfo->event_type = INT_POWER_FAULT_CLEAR; | 215 | taskInfo->event_type = INT_POWER_FAULT_CLEAR; |
211 | } else { | 216 | } else { |
212 | /* | 217 | /* |
213 | * power fault | 218 | * power fault |
214 | */ | 219 | */ |
215 | info("Power fault on Slot(%d)\n", ctrl->first_slot + hp_slot); | 220 | info("Power fault on Slot(%s)\n", slot_name(p_slot)); |
216 | taskInfo->event_type = INT_POWER_FAULT; | 221 | taskInfo->event_type = INT_POWER_FAULT; |
217 | info("power fault bit %x set\n", hp_slot); | 222 | info("power fault bit %x set\n", hp_slot); |
218 | } | 223 | } |
@@ -654,7 +659,7 @@ static void interrupt_event_handler(struct controller *ctrl) | |||
654 | warn("Not a valid state\n"); | 659 | warn("Not a valid state\n"); |
655 | return; | 660 | return; |
656 | } | 661 | } |
657 | info(msg_button_cancel, p_slot->number); | 662 | info(msg_button_cancel, slot_name(p_slot)); |
658 | p_slot->state = STATIC_STATE; | 663 | p_slot->state = STATIC_STATE; |
659 | } | 664 | } |
660 | /* ***********Button Pressed (No action on 1st press...) */ | 665 | /* ***********Button Pressed (No action on 1st press...) */ |
@@ -667,12 +672,12 @@ static void interrupt_event_handler(struct controller *ctrl) | |||
667 | /* slot is on */ | 672 | /* slot is on */ |
668 | dbg("slot is on\n"); | 673 | dbg("slot is on\n"); |
669 | p_slot->state = BLINKINGOFF_STATE; | 674 | p_slot->state = BLINKINGOFF_STATE; |
670 | info(msg_button_off, p_slot->number); | 675 | info(msg_button_off, slot_name(p_slot)); |
671 | } else { | 676 | } else { |
672 | /* slot is off */ | 677 | /* slot is off */ |
673 | dbg("slot is off\n"); | 678 | dbg("slot is off\n"); |
674 | p_slot->state = BLINKINGON_STATE; | 679 | p_slot->state = BLINKINGON_STATE; |
675 | info(msg_button_on, p_slot->number); | 680 | info(msg_button_on, slot_name(p_slot)); |
676 | } | 681 | } |
677 | 682 | ||
678 | /* Wait for exclusive access to hardware */ | 683 | /* Wait for exclusive access to hardware */ |
@@ -760,14 +765,16 @@ int pciehp_enable_slot(struct slot *p_slot) | |||
760 | 765 | ||
761 | rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); | 766 | rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); |
762 | if (rc || !getstatus) { | 767 | if (rc || !getstatus) { |
763 | info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number); | 768 | info("%s: no adapter on slot(%s)\n", __FUNCTION__, |
769 | slot_name(p_slot)); | ||
764 | mutex_unlock(&p_slot->ctrl->crit_sect); | 770 | mutex_unlock(&p_slot->ctrl->crit_sect); |
765 | return -ENODEV; | 771 | return -ENODEV; |
766 | } | 772 | } |
767 | if (MRL_SENS(p_slot->ctrl->ctrlcap)) { | 773 | if (MRL_SENS(p_slot->ctrl->ctrlcap)) { |
768 | rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); | 774 | rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); |
769 | if (rc || getstatus) { | 775 | if (rc || getstatus) { |
770 | info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number); | 776 | info("%s: latch open on slot(%s)\n", __FUNCTION__, |
777 | slot_name(p_slot)); | ||
771 | mutex_unlock(&p_slot->ctrl->crit_sect); | 778 | mutex_unlock(&p_slot->ctrl->crit_sect); |
772 | return -ENODEV; | 779 | return -ENODEV; |
773 | } | 780 | } |
@@ -776,7 +783,8 @@ int pciehp_enable_slot(struct slot *p_slot) | |||
776 | if (POWER_CTRL(p_slot->ctrl->ctrlcap)) { | 783 | if (POWER_CTRL(p_slot->ctrl->ctrlcap)) { |
777 | rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); | 784 | rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); |
778 | if (rc || getstatus) { | 785 | if (rc || getstatus) { |
779 | info("%s: already enabled on slot(%x)\n", __FUNCTION__, p_slot->number); | 786 | info("%s: already enabled on slot(%s)\n", __FUNCTION__, |
787 | slot_name(p_slot)); | ||
780 | mutex_unlock(&p_slot->ctrl->crit_sect); | 788 | mutex_unlock(&p_slot->ctrl->crit_sect); |
781 | return -EINVAL; | 789 | return -EINVAL; |
782 | } | 790 | } |
@@ -811,7 +819,8 @@ int pciehp_disable_slot(struct slot *p_slot) | |||
811 | if (!HP_SUPR_RM(p_slot->ctrl->ctrlcap)) { | 819 | if (!HP_SUPR_RM(p_slot->ctrl->ctrlcap)) { |
812 | ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); | 820 | ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); |
813 | if (ret || !getstatus) { | 821 | if (ret || !getstatus) { |
814 | info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number); | 822 | info("%s: no adapter on slot(%s)\n", __FUNCTION__, |
823 | slot_name(p_slot)); | ||
815 | mutex_unlock(&p_slot->ctrl->crit_sect); | 824 | mutex_unlock(&p_slot->ctrl->crit_sect); |
816 | return -ENODEV; | 825 | return -ENODEV; |
817 | } | 826 | } |
@@ -820,7 +829,8 @@ int pciehp_disable_slot(struct slot *p_slot) | |||
820 | if (MRL_SENS(p_slot->ctrl->ctrlcap)) { | 829 | if (MRL_SENS(p_slot->ctrl->ctrlcap)) { |
821 | ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); | 830 | ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); |
822 | if (ret || getstatus) { | 831 | if (ret || getstatus) { |
823 | info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number); | 832 | info("%s: latch open on slot(%s)\n", __FUNCTION__, |
833 | slot_name(p_slot)); | ||
824 | mutex_unlock(&p_slot->ctrl->crit_sect); | 834 | mutex_unlock(&p_slot->ctrl->crit_sect); |
825 | return -ENODEV; | 835 | return -ENODEV; |
826 | } | 836 | } |
@@ -829,7 +839,8 @@ int pciehp_disable_slot(struct slot *p_slot) | |||
829 | if (POWER_CTRL(p_slot->ctrl->ctrlcap)) { | 839 | if (POWER_CTRL(p_slot->ctrl->ctrlcap)) { |
830 | ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); | 840 | ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); |
831 | if (ret || !getstatus) { | 841 | if (ret || !getstatus) { |
832 | info("%s: already disabled slot(%x)\n", __FUNCTION__, p_slot->number); | 842 | info("%s: already disabled slot(%s)\n", __FUNCTION__, |
843 | slot_name(p_slot)); | ||
833 | mutex_unlock(&p_slot->ctrl->crit_sect); | 844 | mutex_unlock(&p_slot->ctrl->crit_sect); |
834 | return -EINVAL; | 845 | return -EINVAL; |
835 | } | 846 | } |