aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/hotplug/cpqphp_ctrl.c76
1 files changed, 14 insertions, 62 deletions
diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c
index 72eb8e2d2065..55d2dc7e39ca 100644
--- a/drivers/pci/hotplug/cpqphp_ctrl.c
+++ b/drivers/pci/hotplug/cpqphp_ctrl.c
@@ -1282,9 +1282,7 @@ static u32 board_replaced(struct pci_func *func, struct controller *ctrl)
1282 u8 hp_slot; 1282 u8 hp_slot;
1283 u8 temp_byte; 1283 u8 temp_byte;
1284 u8 adapter_speed; 1284 u8 adapter_speed;
1285 u32 index;
1286 u32 rc = 0; 1285 u32 rc = 0;
1287 u32 src = 8;
1288 1286
1289 hp_slot = func->device - ctrl->slot_device_offset; 1287 hp_slot = func->device - ctrl->slot_device_offset;
1290 1288
@@ -1368,68 +1366,17 @@ static u32 board_replaced(struct pci_func *func, struct controller *ctrl)
1368 1366
1369 rc = cpqhp_configure_board(ctrl, func); 1367 rc = cpqhp_configure_board(ctrl, func);
1370 1368
1371 if (rc || src) { 1369 /* If configuration fails, turn it off
1372 /* If configuration fails, turn it off 1370 * Get slot won't work for devices behind
1373 * Get slot won't work for devices behind 1371 * bridges, but in this case it will always be
1374 * bridges, but in this case it will always be 1372 * called for the "base" bus/dev/func of an
1375 * called for the "base" bus/dev/func of an 1373 * adapter. */
1376 * adapter. */
1377
1378 mutex_lock(&ctrl->crit_sect);
1379
1380 amber_LED_on (ctrl, hp_slot);
1381 green_LED_off (ctrl, hp_slot);
1382 slot_disable (ctrl, hp_slot);
1383
1384 set_SOGO(ctrl);
1385
1386 /* Wait for SOBS to be unset */
1387 wait_for_ctrl_irq (ctrl);
1388
1389 mutex_unlock(&ctrl->crit_sect);
1390
1391 if (rc)
1392 return rc;
1393 else
1394 return 1;
1395 }
1396
1397 func->status = 0;
1398 func->switch_save = 0x10;
1399
1400 index = 1;
1401 while (((func = cpqhp_slot_find(func->bus, func->device, index)) != NULL) && !rc) {
1402 rc |= cpqhp_configure_board(ctrl, func);
1403 index++;
1404 }
1405
1406 if (rc) {
1407 /* If configuration fails, turn it off
1408 * Get slot won't work for devices behind
1409 * bridges, but in this case it will always be
1410 * called for the "base" bus/dev/func of an
1411 * adapter. */
1412
1413 mutex_lock(&ctrl->crit_sect);
1414
1415 amber_LED_on (ctrl, hp_slot);
1416 green_LED_off (ctrl, hp_slot);
1417 slot_disable (ctrl, hp_slot);
1418
1419 set_SOGO(ctrl);
1420
1421 /* Wait for SOBS to be unset */
1422 wait_for_ctrl_irq (ctrl);
1423
1424 mutex_unlock(&ctrl->crit_sect);
1425
1426 return rc;
1427 }
1428 /* Done configuring so turn LED on full time */
1429 1374
1430 mutex_lock(&ctrl->crit_sect); 1375 mutex_lock(&ctrl->crit_sect);
1431 1376
1432 green_LED_on (ctrl, hp_slot); 1377 amber_LED_on (ctrl, hp_slot);
1378 green_LED_off (ctrl, hp_slot);
1379 slot_disable (ctrl, hp_slot);
1433 1380
1434 set_SOGO(ctrl); 1381 set_SOGO(ctrl);
1435 1382
@@ -1437,7 +1384,12 @@ static u32 board_replaced(struct pci_func *func, struct controller *ctrl)
1437 wait_for_ctrl_irq (ctrl); 1384 wait_for_ctrl_irq (ctrl);
1438 1385
1439 mutex_unlock(&ctrl->crit_sect); 1386 mutex_unlock(&ctrl->crit_sect);
1440 rc = 0; 1387
1388 if (rc)
1389 return rc;
1390 else
1391 return 1;
1392
1441 } else { 1393 } else {
1442 /* Something is wrong 1394 /* Something is wrong
1443 1395