aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/hotplug/pciehp.h2
-rw-r--r--drivers/pci/hotplug/pciehp_core.c38
-rw-r--r--drivers/pci/hotplug/pciehp_ctrl.c64
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c43
-rw-r--r--drivers/pci/hotplug/pciehp_pci.c19
5 files changed, 78 insertions, 88 deletions
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h
index a4817a841fae..b2801a7ee37f 100644
--- a/drivers/pci/hotplug/pciehp.h
+++ b/drivers/pci/hotplug/pciehp.h
@@ -188,7 +188,7 @@ static inline struct slot *pciehp_find_slot(struct controller *ctrl, u8 device)
188 return slot; 188 return slot;
189 } 189 }
190 190
191 ctrl_err(ctrl, "%s: slot (device=0x%x) not found\n", __func__, device); 191 ctrl_err(ctrl, "Slot (device=0x%02x) not found\n", device);
192 return NULL; 192 return NULL;
193} 193}
194 194
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
index 62be1b59c74b..4b23bc39b11e 100644
--- a/drivers/pci/hotplug/pciehp_core.c
+++ b/drivers/pci/hotplug/pciehp_core.c
@@ -184,7 +184,7 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
184{ 184{
185 struct slot *slot = hotplug_slot->private; 185 struct slot *slot = hotplug_slot->private;
186 186
187 ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 187 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
188 __func__, hotplug_slot_name(hotplug_slot)); 188 __func__, hotplug_slot_name(hotplug_slot));
189 189
190 kfree(hotplug_slot->info); 190 kfree(hotplug_slot->info);
@@ -216,9 +216,11 @@ static int init_slots(struct controller *ctrl)
216 slot->hotplug_slot = hotplug_slot; 216 slot->hotplug_slot = hotplug_slot;
217 snprintf(name, SLOT_NAME_SIZE, "%u", slot->number); 217 snprintf(name, SLOT_NAME_SIZE, "%u", slot->number);
218 218
219 ctrl_dbg(ctrl, "Registering bus=%x dev=%x hp_slot=%x sun=%x " 219 ctrl_dbg(ctrl, "Registering domain:bus:dev=%04x:%02x:%02x "
220 "slot_device_offset=%x\n", slot->bus, slot->device, 220 "hp_slot=%x sun=%x slot_device_offset=%x\n",
221 slot->hp_slot, slot->number, ctrl->slot_device_offset); 221 pci_domain_nr(ctrl->pci_dev->subordinate),
222 slot->bus, slot->device, slot->hp_slot, slot->number,
223 ctrl->slot_device_offset);
222 retval = pci_hp_register(hotplug_slot, 224 retval = pci_hp_register(hotplug_slot,
223 ctrl->pci_dev->subordinate, 225 ctrl->pci_dev->subordinate,
224 slot->device, 226 slot->device,
@@ -238,7 +240,7 @@ static int init_slots(struct controller *ctrl)
238 &hotplug_slot_attr_lock.attr); 240 &hotplug_slot_attr_lock.attr);
239 if (retval) { 241 if (retval) {
240 pci_hp_deregister(hotplug_slot); 242 pci_hp_deregister(hotplug_slot);
241 ctrl_err(ctrl, "cannot create additional sysfs " 243 ctrl_err(ctrl, "Cannot create additional sysfs "
242 "entries\n"); 244 "entries\n");
243 goto error_info; 245 goto error_info;
244 } 246 }
@@ -273,7 +275,7 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
273{ 275{
274 struct slot *slot = hotplug_slot->private; 276 struct slot *slot = hotplug_slot->private;
275 277
276 ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 278 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
277 __func__, slot_name(slot)); 279 __func__, slot_name(slot));
278 280
279 hotplug_slot->info->attention_status = status; 281 hotplug_slot->info->attention_status = status;
@@ -289,7 +291,7 @@ static int enable_slot(struct hotplug_slot *hotplug_slot)
289{ 291{
290 struct slot *slot = hotplug_slot->private; 292 struct slot *slot = hotplug_slot->private;
291 293
292 ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 294 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
293 __func__, slot_name(slot)); 295 __func__, slot_name(slot));
294 296
295 return pciehp_sysfs_enable_slot(slot); 297 return pciehp_sysfs_enable_slot(slot);
@@ -300,7 +302,7 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
300{ 302{
301 struct slot *slot = hotplug_slot->private; 303 struct slot *slot = hotplug_slot->private;
302 304
303 ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 305 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
304 __func__, slot_name(slot)); 306 __func__, slot_name(slot));
305 307
306 return pciehp_sysfs_disable_slot(slot); 308 return pciehp_sysfs_disable_slot(slot);
@@ -311,7 +313,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
311 struct slot *slot = hotplug_slot->private; 313 struct slot *slot = hotplug_slot->private;
312 int retval; 314 int retval;
313 315
314 ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 316 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
315 __func__, slot_name(slot)); 317 __func__, slot_name(slot));
316 318
317 retval = slot->hpc_ops->get_power_status(slot, value); 319 retval = slot->hpc_ops->get_power_status(slot, value);
@@ -326,7 +328,7 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
326 struct slot *slot = hotplug_slot->private; 328 struct slot *slot = hotplug_slot->private;
327 int retval; 329 int retval;
328 330
329 ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 331 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
330 __func__, slot_name(slot)); 332 __func__, slot_name(slot));
331 333
332 retval = slot->hpc_ops->get_attention_status(slot, value); 334 retval = slot->hpc_ops->get_attention_status(slot, value);
@@ -341,7 +343,7 @@ static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
341 struct slot *slot = hotplug_slot->private; 343 struct slot *slot = hotplug_slot->private;
342 int retval; 344 int retval;
343 345
344 ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 346 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
345 __func__, slot_name(slot)); 347 __func__, slot_name(slot));
346 348
347 retval = slot->hpc_ops->get_latch_status(slot, value); 349 retval = slot->hpc_ops->get_latch_status(slot, value);
@@ -356,7 +358,7 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
356 struct slot *slot = hotplug_slot->private; 358 struct slot *slot = hotplug_slot->private;
357 int retval; 359 int retval;
358 360
359 ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 361 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
360 __func__, slot_name(slot)); 362 __func__, slot_name(slot));
361 363
362 retval = slot->hpc_ops->get_adapter_status(slot, value); 364 retval = slot->hpc_ops->get_adapter_status(slot, value);
@@ -372,7 +374,7 @@ static int get_max_bus_speed(struct hotplug_slot *hotplug_slot,
372 struct slot *slot = hotplug_slot->private; 374 struct slot *slot = hotplug_slot->private;
373 int retval; 375 int retval;
374 376
375 ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 377 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
376 __func__, slot_name(slot)); 378 __func__, slot_name(slot));
377 379
378 retval = slot->hpc_ops->get_max_bus_speed(slot, value); 380 retval = slot->hpc_ops->get_max_bus_speed(slot, value);
@@ -387,7 +389,7 @@ static int get_cur_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_spe
387 struct slot *slot = hotplug_slot->private; 389 struct slot *slot = hotplug_slot->private;
388 int retval; 390 int retval;
389 391
390 ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 392 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
391 __func__, slot_name(slot)); 393 __func__, slot_name(slot));
392 394
393 retval = slot->hpc_ops->get_cur_bus_speed(slot, value); 395 retval = slot->hpc_ops->get_cur_bus_speed(slot, value);
@@ -414,7 +416,7 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
414 416
415 ctrl = pcie_init(dev); 417 ctrl = pcie_init(dev);
416 if (!ctrl) { 418 if (!ctrl) {
417 dev_err(&dev->device, "controller initialization failed\n"); 419 dev_err(&dev->device, "Controller initialization failed\n");
418 goto err_out_none; 420 goto err_out_none;
419 } 421 }
420 set_service_data(dev, ctrl); 422 set_service_data(dev, ctrl);
@@ -423,10 +425,10 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
423 rc = init_slots(ctrl); 425 rc = init_slots(ctrl);
424 if (rc) { 426 if (rc) {
425 if (rc == -EBUSY) 427 if (rc == -EBUSY)
426 ctrl_warn(ctrl, "slot already registered by another " 428 ctrl_warn(ctrl, "Slot already registered by another "
427 "hotplug driver\n"); 429 "hotplug driver\n");
428 else 430 else
429 ctrl_err(ctrl, "slot initialization failed\n"); 431 ctrl_err(ctrl, "Slot initialization failed\n");
430 goto err_out_release_ctlr; 432 goto err_out_release_ctlr;
431 } 433 }
432 434
@@ -523,7 +525,7 @@ static int __init pcied_init(void)
523 dbg("pcie_port_service_register = %d\n", retval); 525 dbg("pcie_port_service_register = %d\n", retval);
524 info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); 526 info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
525 if (retval) 527 if (retval)
526 dbg("%s: Failure to register service\n", __func__); 528 dbg("Failure to register service\n");
527 return retval; 529 return retval;
528} 530}
529 531
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 }
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 58c72d2cc217..b643ca13e4f1 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -316,22 +316,19 @@ static int pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask)
316 * proceed forward to issue the next command according 316 * proceed forward to issue the next command according
317 * to spec. Just print out the error message. 317 * to spec. Just print out the error message.
318 */ 318 */
319 ctrl_dbg(ctrl, 319 ctrl_dbg(ctrl, "CMD_COMPLETED not clear after 1 sec\n");
320 "%s: CMD_COMPLETED not clear after 1 sec.\n",
321 __func__);
322 } else if (!NO_CMD_CMPL(ctrl)) { 320 } else if (!NO_CMD_CMPL(ctrl)) {
323 /* 321 /*
324 * This controller semms to notify of command completed 322 * This controller semms to notify of command completed
325 * event even though it supports none of power 323 * event even though it supports none of power
326 * controller, attention led, power led and EMI. 324 * controller, attention led, power led and EMI.
327 */ 325 */
328 ctrl_dbg(ctrl, "%s: Unexpected CMD_COMPLETED. Need to " 326 ctrl_dbg(ctrl, "Unexpected CMD_COMPLETED. Need to "
329 "wait for command completed event.\n", 327 "wait for command completed event.\n");
330 __func__);
331 ctrl->no_cmd_complete = 0; 328 ctrl->no_cmd_complete = 0;
332 } else { 329 } else {
333 ctrl_dbg(ctrl, "%s: Unexpected CMD_COMPLETED. Maybe " 330 ctrl_dbg(ctrl, "Unexpected CMD_COMPLETED. Maybe "
334 "the controller is broken.\n", __func__); 331 "the controller is broken.\n");
335 } 332 }
336 } 333 }
337 334
@@ -347,8 +344,7 @@ static int pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask)
347 smp_mb(); 344 smp_mb();
348 retval = pciehp_writew(ctrl, SLOTCTRL, slot_ctrl); 345 retval = pciehp_writew(ctrl, SLOTCTRL, slot_ctrl);
349 if (retval) 346 if (retval)
350 ctrl_err(ctrl, "%s: Cannot write to SLOTCTRL register\n", 347 ctrl_err(ctrl, "Cannot write to SLOTCTRL register\n");
351 __func__);
352 348
353 /* 349 /*
354 * Wait for command completion. 350 * Wait for command completion.
@@ -418,15 +414,14 @@ static int hpc_check_lnk_status(struct controller *ctrl)
418 414
419 retval = pciehp_readw(ctrl, LNKSTATUS, &lnk_status); 415 retval = pciehp_readw(ctrl, LNKSTATUS, &lnk_status);
420 if (retval) { 416 if (retval) {
421 ctrl_err(ctrl, "%s: Cannot read LNKSTATUS register\n", 417 ctrl_err(ctrl, "Cannot read LNKSTATUS register\n");
422 __func__);
423 return retval; 418 return retval;
424 } 419 }
425 420
426 ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status); 421 ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status);
427 if ( (lnk_status & LNK_TRN) || (lnk_status & LNK_TRN_ERR) || 422 if ( (lnk_status & LNK_TRN) || (lnk_status & LNK_TRN_ERR) ||
428 !(lnk_status & NEG_LINK_WD)) { 423 !(lnk_status & NEG_LINK_WD)) {
429 ctrl_err(ctrl, "%s : Link Training Error occurs \n", __func__); 424 ctrl_err(ctrl, "Link Training Error occurs \n");
430 retval = -1; 425 retval = -1;
431 return retval; 426 return retval;
432 } 427 }
@@ -551,7 +546,7 @@ static int hpc_query_power_fault(struct slot *slot)
551 546
552 retval = pciehp_readw(ctrl, SLOTSTATUS, &slot_status); 547 retval = pciehp_readw(ctrl, SLOTSTATUS, &slot_status);
553 if (retval) { 548 if (retval) {
554 ctrl_err(ctrl, "%s: Cannot check for power fault\n", __func__); 549 ctrl_err(ctrl, "Cannot check for power fault\n");
555 return retval; 550 return retval;
556 } 551 }
557 pwr_fault = (u8)((slot_status & PWR_FAULT_DETECTED) >> 1); 552 pwr_fault = (u8)((slot_status & PWR_FAULT_DETECTED) >> 1);
@@ -567,7 +562,7 @@ static int hpc_get_emi_status(struct slot *slot, u8 *status)
567 562
568 retval = pciehp_readw(ctrl, SLOTSTATUS, &slot_status); 563 retval = pciehp_readw(ctrl, SLOTSTATUS, &slot_status);
569 if (retval) { 564 if (retval) {
570 ctrl_err(ctrl, "%s : Cannot check EMI status\n", __func__); 565 ctrl_err(ctrl, "Cannot check EMI status\n");
571 return retval; 566 return retval;
572 } 567 }
573 *status = (slot_status & EMI_STATE) >> EMI_STATUS_BIT; 568 *status = (slot_status & EMI_STATE) >> EMI_STATUS_BIT;
@@ -697,8 +692,7 @@ static int hpc_power_on_slot(struct slot * slot)
697 retval = pcie_write_cmd(ctrl, slot_cmd, cmd_mask); 692 retval = pcie_write_cmd(ctrl, slot_cmd, cmd_mask);
698 693
699 if (retval) { 694 if (retval) {
700 ctrl_err(ctrl, "%s: Write %x command failed!\n", 695 ctrl_err(ctrl, "Write %x command failed!\n", slot_cmd);
701 __func__, slot_cmd);
702 return -1; 696 return -1;
703 } 697 }
704 ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", 698 ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n",
@@ -776,7 +770,7 @@ static int hpc_power_off_slot(struct slot * slot)
776 770
777 retval = pcie_write_cmd(ctrl, slot_cmd, cmd_mask); 771 retval = pcie_write_cmd(ctrl, slot_cmd, cmd_mask);
778 if (retval) { 772 if (retval) {
779 ctrl_err(ctrl, "%s: Write command failed!\n", __func__); 773 ctrl_err(ctrl, "Write command failed!\n");
780 retval = -1; 774 retval = -1;
781 goto out; 775 goto out;
782 } 776 }
@@ -1056,8 +1050,7 @@ int pcie_enable_notification(struct controller *ctrl)
1056 PWR_FAULT_DETECT_ENABLE | HP_INTR_ENABLE | CMD_CMPL_INTR_ENABLE; 1050 PWR_FAULT_DETECT_ENABLE | HP_INTR_ENABLE | CMD_CMPL_INTR_ENABLE;
1057 1051
1058 if (pcie_write_cmd(ctrl, cmd, mask)) { 1052 if (pcie_write_cmd(ctrl, cmd, mask)) {
1059 ctrl_err(ctrl, "%s: Cannot enable software notification\n", 1053 ctrl_err(ctrl, "Cannot enable software notification\n");
1060 __func__);
1061 return -1; 1054 return -1;
1062 } 1055 }
1063 return 0; 1056 return 0;
@@ -1069,8 +1062,7 @@ static void pcie_disable_notification(struct controller *ctrl)
1069 mask = PRSN_DETECT_ENABLE | ATTN_BUTTN_ENABLE | MRL_DETECT_ENABLE | 1062 mask = PRSN_DETECT_ENABLE | ATTN_BUTTN_ENABLE | MRL_DETECT_ENABLE |
1070 PWR_FAULT_DETECT_ENABLE | HP_INTR_ENABLE | CMD_CMPL_INTR_ENABLE; 1063 PWR_FAULT_DETECT_ENABLE | HP_INTR_ENABLE | CMD_CMPL_INTR_ENABLE;
1071 if (pcie_write_cmd(ctrl, 0, mask)) 1064 if (pcie_write_cmd(ctrl, 0, mask))
1072 ctrl_warn(ctrl, "%s: Cannot disable software notification\n", 1065 ctrl_warn(ctrl, "Cannot disable software notification\n");
1073 __func__);
1074} 1066}
1075 1067
1076static int pcie_init_notification(struct controller *ctrl) 1068static int pcie_init_notification(struct controller *ctrl)
@@ -1179,7 +1171,7 @@ struct controller *pcie_init(struct pcie_device *dev)
1179 1171
1180 ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); 1172 ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);
1181 if (!ctrl) { 1173 if (!ctrl) {
1182 dev_err(&dev->device, "%s : out of memory\n", __func__); 1174 dev_err(&dev->device, "%s: Out of memory\n", __func__);
1183 goto abort; 1175 goto abort;
1184 } 1176 }
1185 INIT_LIST_HEAD(&ctrl->slot_list); 1177 INIT_LIST_HEAD(&ctrl->slot_list);
@@ -1188,12 +1180,11 @@ struct controller *pcie_init(struct pcie_device *dev)
1188 ctrl->pci_dev = pdev; 1180 ctrl->pci_dev = pdev;
1189 ctrl->cap_base = pci_find_capability(pdev, PCI_CAP_ID_EXP); 1181 ctrl->cap_base = pci_find_capability(pdev, PCI_CAP_ID_EXP);
1190 if (!ctrl->cap_base) { 1182 if (!ctrl->cap_base) {
1191 ctrl_err(ctrl, "%s: Cannot find PCI Express capability\n", 1183 ctrl_err(ctrl, "Cannot find PCI Express capability\n");
1192 __func__);
1193 goto abort_ctrl; 1184 goto abort_ctrl;
1194 } 1185 }
1195 if (pciehp_readl(ctrl, SLOTCAP, &slot_cap)) { 1186 if (pciehp_readl(ctrl, SLOTCAP, &slot_cap)) {
1196 ctrl_err(ctrl, "%s: Cannot read SLOTCAP register\n", __func__); 1187 ctrl_err(ctrl, "Cannot read SLOTCAP register\n");
1197 goto abort_ctrl; 1188 goto abort_ctrl;
1198 } 1189 }
1199 1190
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c
index ffd11148fbe2..10f9566cceeb 100644
--- a/drivers/pci/hotplug/pciehp_pci.c
+++ b/drivers/pci/hotplug/pciehp_pci.c
@@ -39,8 +39,7 @@ static void program_hpp_type0(struct pci_dev *dev, struct hpp_type0 *hpp)
39 u16 pci_cmd, pci_bctl; 39 u16 pci_cmd, pci_bctl;
40 40
41 if (hpp->revision > 1) { 41 if (hpp->revision > 1) {
42 printk(KERN_WARNING "%s: Rev.%d type0 record not supported\n", 42 warn("Rev.%d type0 record not supported\n", hpp->revision);
43 __func__, hpp->revision);
44 return; 43 return;
45 } 44 }
46 45
@@ -81,8 +80,7 @@ static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp)
81 u32 reg32; 80 u32 reg32;
82 81
83 if (hpp->revision > 1) { 82 if (hpp->revision > 1) {
84 printk(KERN_WARNING "%s: Rev.%d type2 record not supported\n", 83 warn("Rev.%d type2 record not supported\n", hpp->revision);
85 __func__, hpp->revision);
86 return; 84 return;
87 } 85 }
88 86
@@ -149,8 +147,7 @@ static void program_fw_provided_values(struct pci_dev *dev)
149 return; 147 return;
150 148
151 if (pciehp_get_hp_params_from_firmware(dev, &hpp)) { 149 if (pciehp_get_hp_params_from_firmware(dev, &hpp)) {
152 printk(KERN_WARNING "%s: Could not get hotplug parameters\n", 150 warn("Could not get hotplug parameters\n");
153 __func__);
154 return; 151 return;
155 } 152 }
156 153
@@ -202,9 +199,9 @@ int pciehp_configure_device(struct slot *p_slot)
202 199
203 dev = pci_get_slot(parent, PCI_DEVFN(p_slot->device, 0)); 200 dev = pci_get_slot(parent, PCI_DEVFN(p_slot->device, 0));
204 if (dev) { 201 if (dev) {
205 ctrl_err(ctrl, 202 ctrl_err(ctrl, "Device %s already exists "
206 "Device %s already exists at %x:%x, cannot hot-add\n", 203 "at %04x:%02x:%02x, cannot hot-add\n", pci_name(dev),
207 pci_name(dev), p_slot->bus, p_slot->device); 204 pci_domain_nr(parent), p_slot->bus, p_slot->device);
208 pci_dev_put(dev); 205 pci_dev_put(dev);
209 return -EINVAL; 206 return -EINVAL;
210 } 207 }
@@ -248,8 +245,8 @@ int pciehp_unconfigure_device(struct slot *p_slot)
248 u16 command; 245 u16 command;
249 struct controller *ctrl = p_slot->ctrl; 246 struct controller *ctrl = p_slot->ctrl;
250 247
251 ctrl_dbg(ctrl, "%s: bus/dev = %x/%x\n", __func__, 248 ctrl_dbg(ctrl, "%s: domain:bus:dev = %04x:%02x:%02x\n",
252 p_slot->bus, p_slot->device); 249 __func__, pci_domain_nr(parent), p_slot->bus, p_slot->device);
253 ret = p_slot->hpc_ops->get_adapter_status(p_slot, &presence); 250 ret = p_slot->hpc_ops->get_adapter_status(p_slot, &presence);
254 if (ret) 251 if (ret)
255 presence = 0; 252 presence = 0;