diff options
Diffstat (limited to 'drivers/pci/hotplug/pciehp_ctrl.c')
-rw-r--r-- | drivers/pci/hotplug/pciehp_ctrl.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index d6c5eb297753..fead63c6b49e 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c | |||
@@ -61,7 +61,7 @@ u8 pciehp_handle_attention_button(struct slot *p_slot) | |||
61 | struct controller *ctrl = p_slot->ctrl; | 61 | struct controller *ctrl = p_slot->ctrl; |
62 | 62 | ||
63 | /* Attention Button Change */ | 63 | /* Attention Button Change */ |
64 | ctrl_dbg(ctrl, "Attention button interrupt received.\n"); | 64 | ctrl_dbg(ctrl, "Attention button interrupt received\n"); |
65 | 65 | ||
66 | /* | 66 | /* |
67 | * Button pressed - See if need to TAKE ACTION!!! | 67 | * Button pressed - See if need to TAKE ACTION!!! |
@@ -81,7 +81,7 @@ u8 pciehp_handle_switch_change(struct slot *p_slot) | |||
81 | struct controller *ctrl = p_slot->ctrl; | 81 | struct controller *ctrl = p_slot->ctrl; |
82 | 82 | ||
83 | /* Switch Change */ | 83 | /* Switch Change */ |
84 | ctrl_dbg(ctrl, "Switch interrupt received.\n"); | 84 | ctrl_dbg(ctrl, "Switch interrupt received\n"); |
85 | 85 | ||
86 | p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); | 86 | p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); |
87 | if (getstatus) { | 87 | if (getstatus) { |
@@ -110,7 +110,7 @@ u8 pciehp_handle_presence_change(struct slot *p_slot) | |||
110 | struct controller *ctrl = p_slot->ctrl; | 110 | struct controller *ctrl = p_slot->ctrl; |
111 | 111 | ||
112 | /* Presence Change */ | 112 | /* Presence Change */ |
113 | ctrl_dbg(ctrl, "Presence/Notify input change.\n"); | 113 | ctrl_dbg(ctrl, "Presence/Notify input change\n"); |
114 | 114 | ||
115 | /* Switch is open, assume a presence change | 115 | /* Switch is open, assume a presence change |
116 | * Save the presence state | 116 | * Save the presence state |
@@ -142,7 +142,7 @@ u8 pciehp_handle_power_fault(struct slot *p_slot) | |||
142 | struct controller *ctrl = p_slot->ctrl; | 142 | struct controller *ctrl = p_slot->ctrl; |
143 | 143 | ||
144 | /* power fault */ | 144 | /* power fault */ |
145 | ctrl_dbg(ctrl, "Power fault interrupt received.\n"); | 145 | ctrl_dbg(ctrl, "Power fault interrupt received\n"); |
146 | 146 | ||
147 | if ( !(p_slot->hpc_ops->query_power_fault(p_slot))) { | 147 | if ( !(p_slot->hpc_ops->query_power_fault(p_slot))) { |
148 | /* | 148 | /* |
@@ -157,7 +157,7 @@ u8 pciehp_handle_power_fault(struct slot *p_slot) | |||
157 | */ | 157 | */ |
158 | ctrl_info(ctrl, "Power fault on Slot(%s)\n", slot_name(p_slot)); | 158 | ctrl_info(ctrl, "Power fault on Slot(%s)\n", slot_name(p_slot)); |
159 | event_type = INT_POWER_FAULT; | 159 | event_type = INT_POWER_FAULT; |
160 | ctrl_info(ctrl, "power fault bit %x set\n", 0); | 160 | ctrl_info(ctrl, "Power fault bit %x set\n", 0); |
161 | } | 161 | } |
162 | 162 | ||
163 | queue_interrupt_event(p_slot, event_type); | 163 | queue_interrupt_event(p_slot, event_type); |
@@ -175,8 +175,7 @@ static void set_slot_off(struct controller *ctrl, struct slot * pslot) | |||
175 | if (POWER_CTRL(ctrl)) { | 175 | if (POWER_CTRL(ctrl)) { |
176 | if (pslot->hpc_ops->power_off_slot(pslot)) { | 176 | if (pslot->hpc_ops->power_off_slot(pslot)) { |
177 | ctrl_err(ctrl, | 177 | ctrl_err(ctrl, |
178 | "%s: Issue of Slot Power Off command failed\n", | 178 | "Issue of Slot Power Off command failed\n"); |
179 | __func__); | ||
180 | return; | 179 | return; |
181 | } | 180 | } |
182 | } | 181 | } |
@@ -193,8 +192,8 @@ static void set_slot_off(struct controller *ctrl, struct slot * pslot) | |||
193 | 192 | ||
194 | if (ATTN_LED(ctrl)) { | 193 | if (ATTN_LED(ctrl)) { |
195 | if (pslot->hpc_ops->set_attention_status(pslot, 1)) { | 194 | if (pslot->hpc_ops->set_attention_status(pslot, 1)) { |
196 | ctrl_err(ctrl, "%s: Issue of Set Attention " | 195 | ctrl_err(ctrl, |
197 | "Led command failed\n", __func__); | 196 | "Issue of Set Attention Led command failed\n"); |
198 | return; | 197 | return; |
199 | } | 198 | } |
200 | } | 199 | } |
@@ -211,8 +210,9 @@ static int board_added(struct slot *p_slot) | |||
211 | { | 210 | { |
212 | int retval = 0; | 211 | int retval = 0; |
213 | struct controller *ctrl = p_slot->ctrl; | 212 | struct controller *ctrl = p_slot->ctrl; |
213 | struct pci_bus *parent = ctrl->pci_dev->subordinate; | ||
214 | 214 | ||
215 | ctrl_dbg(ctrl, "%s: slot device, slot offset, hp slot = %d, %d ,%d\n", | 215 | ctrl_dbg(ctrl, "%s: slot device, slot offset, hp slot = %d, %d, %d\n", |
216 | __func__, p_slot->device, ctrl->slot_device_offset, | 216 | __func__, p_slot->device, ctrl->slot_device_offset, |
217 | p_slot->hp_slot); | 217 | p_slot->hp_slot); |
218 | 218 | ||
@@ -229,22 +229,22 @@ static int board_added(struct slot *p_slot) | |||
229 | /* Check link training status */ | 229 | /* Check link training status */ |
230 | retval = p_slot->hpc_ops->check_lnk_status(ctrl); | 230 | retval = p_slot->hpc_ops->check_lnk_status(ctrl); |
231 | if (retval) { | 231 | if (retval) { |
232 | ctrl_err(ctrl, "%s: Failed to check link status\n", __func__); | 232 | ctrl_err(ctrl, "Failed to check link status\n"); |
233 | set_slot_off(ctrl, p_slot); | 233 | set_slot_off(ctrl, p_slot); |
234 | return retval; | 234 | return retval; |
235 | } | 235 | } |
236 | 236 | ||
237 | /* Check for a power fault */ | 237 | /* Check for a power fault */ |
238 | if (p_slot->hpc_ops->query_power_fault(p_slot)) { | 238 | if (p_slot->hpc_ops->query_power_fault(p_slot)) { |
239 | ctrl_dbg(ctrl, "%s: power fault detected\n", __func__); | 239 | ctrl_dbg(ctrl, "Power fault detected\n"); |
240 | retval = POWER_FAILURE; | 240 | retval = POWER_FAILURE; |
241 | goto err_exit; | 241 | goto err_exit; |
242 | } | 242 | } |
243 | 243 | ||
244 | retval = pciehp_configure_device(p_slot); | 244 | retval = pciehp_configure_device(p_slot); |
245 | if (retval) { | 245 | if (retval) { |
246 | ctrl_err(ctrl, "Cannot add device 0x%x:%x\n", | 246 | ctrl_err(ctrl, "Cannot add device at %04x:%02x:%02x\n", |
247 | p_slot->bus, p_slot->device); | 247 | pci_domain_nr(parent), p_slot->bus, p_slot->device); |
248 | goto err_exit; | 248 | goto err_exit; |
249 | } | 249 | } |
250 | 250 | ||
@@ -276,14 +276,14 @@ static int remove_board(struct slot *p_slot) | |||
276 | if (retval) | 276 | if (retval) |
277 | return retval; | 277 | return retval; |
278 | 278 | ||
279 | ctrl_dbg(ctrl, "In %s, hp_slot = %d\n", __func__, p_slot->hp_slot); | 279 | ctrl_dbg(ctrl, "%s: hp_slot = %d\n", __func__, p_slot->hp_slot); |
280 | 280 | ||
281 | if (POWER_CTRL(ctrl)) { | 281 | if (POWER_CTRL(ctrl)) { |
282 | /* power off slot */ | 282 | /* power off slot */ |
283 | retval = p_slot->hpc_ops->power_off_slot(p_slot); | 283 | retval = p_slot->hpc_ops->power_off_slot(p_slot); |
284 | if (retval) { | 284 | if (retval) { |
285 | ctrl_err(ctrl, "%s: Issue of Slot Disable command " | 285 | ctrl_err(ctrl, |
286 | "failed\n", __func__); | 286 | "Issue of Slot Disable command failed\n"); |
287 | return retval; | 287 | return retval; |
288 | } | 288 | } |
289 | } | 289 | } |
@@ -324,8 +324,10 @@ static void pciehp_power_thread(struct work_struct *work) | |||
324 | switch (p_slot->state) { | 324 | switch (p_slot->state) { |
325 | case POWEROFF_STATE: | 325 | case POWEROFF_STATE: |
326 | mutex_unlock(&p_slot->lock); | 326 | mutex_unlock(&p_slot->lock); |
327 | ctrl_dbg(p_slot->ctrl, "%s: disabling bus:device(%x:%x)\n", | 327 | ctrl_dbg(p_slot->ctrl, |
328 | __func__, p_slot->bus, p_slot->device); | 328 | "Disabling domain:bus:device=%04x:%02x:%02x\n", |
329 | pci_domain_nr(p_slot->ctrl->pci_dev->subordinate), | ||
330 | p_slot->bus, p_slot->device); | ||
329 | pciehp_disable_slot(p_slot); | 331 | pciehp_disable_slot(p_slot); |
330 | mutex_lock(&p_slot->lock); | 332 | mutex_lock(&p_slot->lock); |
331 | p_slot->state = STATIC_STATE; | 333 | p_slot->state = STATIC_STATE; |
@@ -433,7 +435,6 @@ static void handle_button_press_event(struct slot *p_slot) | |||
433 | * expires to cancel hot-add or hot-remove | 435 | * expires to cancel hot-add or hot-remove |
434 | */ | 436 | */ |
435 | ctrl_info(ctrl, "Button cancel on Slot(%s)\n", slot_name(p_slot)); | 437 | ctrl_info(ctrl, "Button cancel on Slot(%s)\n", slot_name(p_slot)); |
436 | ctrl_dbg(ctrl, "%s: button cancel\n", __func__); | ||
437 | cancel_delayed_work(&p_slot->work); | 438 | cancel_delayed_work(&p_slot->work); |
438 | if (p_slot->state == BLINKINGOFF_STATE) { | 439 | if (p_slot->state == BLINKINGOFF_STATE) { |
439 | if (PWR_LED(ctrl)) | 440 | if (PWR_LED(ctrl)) |
@@ -537,16 +538,15 @@ int pciehp_enable_slot(struct slot *p_slot) | |||
537 | 538 | ||
538 | rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); | 539 | rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); |
539 | if (rc || !getstatus) { | 540 | if (rc || !getstatus) { |
540 | ctrl_info(ctrl, "%s: no adapter on slot(%s)\n", | 541 | ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot)); |
541 | __func__, slot_name(p_slot)); | ||
542 | mutex_unlock(&p_slot->ctrl->crit_sect); | 542 | mutex_unlock(&p_slot->ctrl->crit_sect); |
543 | return -ENODEV; | 543 | return -ENODEV; |
544 | } | 544 | } |
545 | if (MRL_SENS(p_slot->ctrl)) { | 545 | if (MRL_SENS(p_slot->ctrl)) { |
546 | rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); | 546 | rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); |
547 | if (rc || getstatus) { | 547 | if (rc || getstatus) { |
548 | ctrl_info(ctrl, "%s: latch open on slot(%s)\n", | 548 | ctrl_info(ctrl, "Latch open on slot(%s)\n", |
549 | __func__, slot_name(p_slot)); | 549 | slot_name(p_slot)); |
550 | mutex_unlock(&p_slot->ctrl->crit_sect); | 550 | mutex_unlock(&p_slot->ctrl->crit_sect); |
551 | return -ENODEV; | 551 | return -ENODEV; |
552 | } | 552 | } |
@@ -555,8 +555,8 @@ int pciehp_enable_slot(struct slot *p_slot) | |||
555 | if (POWER_CTRL(p_slot->ctrl)) { | 555 | if (POWER_CTRL(p_slot->ctrl)) { |
556 | rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); | 556 | rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); |
557 | if (rc || getstatus) { | 557 | if (rc || getstatus) { |
558 | ctrl_info(ctrl, "%s: already enabled on slot(%s)\n", | 558 | ctrl_info(ctrl, "Already enabled on slot(%s)\n", |
559 | __func__, slot_name(p_slot)); | 559 | slot_name(p_slot)); |
560 | mutex_unlock(&p_slot->ctrl->crit_sect); | 560 | mutex_unlock(&p_slot->ctrl->crit_sect); |
561 | return -EINVAL; | 561 | return -EINVAL; |
562 | } | 562 | } |
@@ -591,8 +591,8 @@ int pciehp_disable_slot(struct slot *p_slot) | |||
591 | if (!HP_SUPR_RM(p_slot->ctrl)) { | 591 | if (!HP_SUPR_RM(p_slot->ctrl)) { |
592 | ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); | 592 | ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); |
593 | if (ret || !getstatus) { | 593 | if (ret || !getstatus) { |
594 | ctrl_info(ctrl, "%s: no adapter on slot(%s)\n", | 594 | ctrl_info(ctrl, "No adapter on slot(%s)\n", |
595 | __func__, slot_name(p_slot)); | 595 | slot_name(p_slot)); |
596 | mutex_unlock(&p_slot->ctrl->crit_sect); | 596 | mutex_unlock(&p_slot->ctrl->crit_sect); |
597 | return -ENODEV; | 597 | return -ENODEV; |
598 | } | 598 | } |
@@ -601,8 +601,8 @@ int pciehp_disable_slot(struct slot *p_slot) | |||
601 | if (MRL_SENS(p_slot->ctrl)) { | 601 | if (MRL_SENS(p_slot->ctrl)) { |
602 | ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); | 602 | ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); |
603 | if (ret || getstatus) { | 603 | if (ret || getstatus) { |
604 | ctrl_info(ctrl, "%s: latch open on slot(%s)\n", | 604 | ctrl_info(ctrl, "Latch open on slot(%s)\n", |
605 | __func__, slot_name(p_slot)); | 605 | slot_name(p_slot)); |
606 | mutex_unlock(&p_slot->ctrl->crit_sect); | 606 | mutex_unlock(&p_slot->ctrl->crit_sect); |
607 | return -ENODEV; | 607 | return -ENODEV; |
608 | } | 608 | } |
@@ -611,8 +611,8 @@ int pciehp_disable_slot(struct slot *p_slot) | |||
611 | if (POWER_CTRL(p_slot->ctrl)) { | 611 | if (POWER_CTRL(p_slot->ctrl)) { |
612 | ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); | 612 | ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); |
613 | if (ret || !getstatus) { | 613 | if (ret || !getstatus) { |
614 | ctrl_info(ctrl, "%s: already disabled slot(%s)\n", | 614 | ctrl_info(ctrl, "Already disabled on slot(%s)\n", |
615 | __func__, slot_name(p_slot)); | 615 | slot_name(p_slot)); |
616 | mutex_unlock(&p_slot->ctrl->crit_sect); | 616 | mutex_unlock(&p_slot->ctrl->crit_sect); |
617 | return -EINVAL; | 617 | return -EINVAL; |
618 | } | 618 | } |