diff options
Diffstat (limited to 'drivers/scsi/ipr.c')
-rw-r--r-- | drivers/scsi/ipr.c | 91 |
1 files changed, 40 insertions, 51 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 821386c7b576..95045e33710d 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -595,10 +595,8 @@ static int ipr_save_pcix_cmd_reg(struct ipr_ioa_cfg *ioa_cfg) | |||
595 | { | 595 | { |
596 | int pcix_cmd_reg = pci_find_capability(ioa_cfg->pdev, PCI_CAP_ID_PCIX); | 596 | int pcix_cmd_reg = pci_find_capability(ioa_cfg->pdev, PCI_CAP_ID_PCIX); |
597 | 597 | ||
598 | if (pcix_cmd_reg == 0) { | 598 | if (pcix_cmd_reg == 0) |
599 | dev_err(&ioa_cfg->pdev->dev, "Failed to save PCI-X command register\n"); | 599 | return 0; |
600 | return -EIO; | ||
601 | } | ||
602 | 600 | ||
603 | if (pci_read_config_word(ioa_cfg->pdev, pcix_cmd_reg + PCI_X_CMD, | 601 | if (pci_read_config_word(ioa_cfg->pdev, pcix_cmd_reg + PCI_X_CMD, |
604 | &ioa_cfg->saved_pcix_cmd_reg) != PCIBIOS_SUCCESSFUL) { | 602 | &ioa_cfg->saved_pcix_cmd_reg) != PCIBIOS_SUCCESSFUL) { |
@@ -627,10 +625,6 @@ static int ipr_set_pcix_cmd_reg(struct ipr_ioa_cfg *ioa_cfg) | |||
627 | dev_err(&ioa_cfg->pdev->dev, "Failed to setup PCI-X command register\n"); | 625 | dev_err(&ioa_cfg->pdev->dev, "Failed to setup PCI-X command register\n"); |
628 | return -EIO; | 626 | return -EIO; |
629 | } | 627 | } |
630 | } else { | ||
631 | dev_err(&ioa_cfg->pdev->dev, | ||
632 | "Failed to setup PCI-X command register\n"); | ||
633 | return -EIO; | ||
634 | } | 628 | } |
635 | 629 | ||
636 | return 0; | 630 | return 0; |
@@ -6314,7 +6308,6 @@ static int ipr_reset_restore_cfg_space(struct ipr_cmnd *ipr_cmd) | |||
6314 | int rc; | 6308 | int rc; |
6315 | 6309 | ||
6316 | ENTER; | 6310 | ENTER; |
6317 | pci_unblock_user_cfg_access(ioa_cfg->pdev); | ||
6318 | rc = pci_restore_state(ioa_cfg->pdev); | 6311 | rc = pci_restore_state(ioa_cfg->pdev); |
6319 | 6312 | ||
6320 | if (rc != PCIBIOS_SUCCESSFUL) { | 6313 | if (rc != PCIBIOS_SUCCESSFUL) { |
@@ -6355,6 +6348,24 @@ static int ipr_reset_restore_cfg_space(struct ipr_cmnd *ipr_cmd) | |||
6355 | } | 6348 | } |
6356 | 6349 | ||
6357 | /** | 6350 | /** |
6351 | * ipr_reset_bist_done - BIST has completed on the adapter. | ||
6352 | * @ipr_cmd: ipr command struct | ||
6353 | * | ||
6354 | * Description: Unblock config space and resume the reset process. | ||
6355 | * | ||
6356 | * Return value: | ||
6357 | * IPR_RC_JOB_CONTINUE | ||
6358 | **/ | ||
6359 | static int ipr_reset_bist_done(struct ipr_cmnd *ipr_cmd) | ||
6360 | { | ||
6361 | ENTER; | ||
6362 | pci_unblock_user_cfg_access(ipr_cmd->ioa_cfg->pdev); | ||
6363 | ipr_cmd->job_step = ipr_reset_restore_cfg_space; | ||
6364 | LEAVE; | ||
6365 | return IPR_RC_JOB_CONTINUE; | ||
6366 | } | ||
6367 | |||
6368 | /** | ||
6358 | * ipr_reset_start_bist - Run BIST on the adapter. | 6369 | * ipr_reset_start_bist - Run BIST on the adapter. |
6359 | * @ipr_cmd: ipr command struct | 6370 | * @ipr_cmd: ipr command struct |
6360 | * | 6371 | * |
@@ -6376,7 +6387,7 @@ static int ipr_reset_start_bist(struct ipr_cmnd *ipr_cmd) | |||
6376 | ipr_cmd->ioasa.ioasc = cpu_to_be32(IPR_IOASC_PCI_ACCESS_ERROR); | 6387 | ipr_cmd->ioasa.ioasc = cpu_to_be32(IPR_IOASC_PCI_ACCESS_ERROR); |
6377 | rc = IPR_RC_JOB_CONTINUE; | 6388 | rc = IPR_RC_JOB_CONTINUE; |
6378 | } else { | 6389 | } else { |
6379 | ipr_cmd->job_step = ipr_reset_restore_cfg_space; | 6390 | ipr_cmd->job_step = ipr_reset_bist_done; |
6380 | ipr_reset_start_timer(ipr_cmd, IPR_WAIT_FOR_BIST_TIMEOUT); | 6391 | ipr_reset_start_timer(ipr_cmd, IPR_WAIT_FOR_BIST_TIMEOUT); |
6381 | rc = IPR_RC_JOB_RETURN; | 6392 | rc = IPR_RC_JOB_RETURN; |
6382 | } | 6393 | } |
@@ -7166,9 +7177,6 @@ ipr_get_chip_cfg(const struct pci_device_id *dev_id) | |||
7166 | { | 7177 | { |
7167 | int i; | 7178 | int i; |
7168 | 7179 | ||
7169 | if (dev_id->driver_data) | ||
7170 | return (const struct ipr_chip_cfg_t *)dev_id->driver_data; | ||
7171 | |||
7172 | for (i = 0; i < ARRAY_SIZE(ipr_chip); i++) | 7180 | for (i = 0; i < ARRAY_SIZE(ipr_chip); i++) |
7173 | if (ipr_chip[i].vendor == dev_id->vendor && | 7181 | if (ipr_chip[i].vendor == dev_id->vendor && |
7174 | ipr_chip[i].device == dev_id->device) | 7182 | ipr_chip[i].device == dev_id->device) |
@@ -7517,62 +7525,43 @@ static void ipr_shutdown(struct pci_dev *pdev) | |||
7517 | 7525 | ||
7518 | static struct pci_device_id ipr_pci_table[] __devinitdata = { | 7526 | static struct pci_device_id ipr_pci_table[] __devinitdata = { |
7519 | { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE, | 7527 | { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE, |
7520 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_5702, | 7528 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_5702, 0, 0, 0 }, |
7521 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] }, | ||
7522 | { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE, | 7529 | { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE, |
7523 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_5703, | 7530 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_5703, 0, 0, 0 }, |
7524 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] }, | ||
7525 | { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE, | 7531 | { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE, |
7526 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_573D, | 7532 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_573D, 0, 0, 0 }, |
7527 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] }, | ||
7528 | { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE, | 7533 | { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE, |
7529 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_573E, | 7534 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_573E, 0, 0, 0 }, |
7530 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] }, | ||
7531 | { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, | 7535 | { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, |
7532 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571B, | 7536 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571B, 0, 0, 0 }, |
7533 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] }, | ||
7534 | { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, | 7537 | { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, |
7535 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572E, | 7538 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572E, 0, 0, 0 }, |
7536 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] }, | ||
7537 | { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, | 7539 | { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, |
7538 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571A, | 7540 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571A, 0, 0, 0 }, |
7539 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] }, | ||
7540 | { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, | 7541 | { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, |
7541 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575B, | 7542 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575B, 0, 0, 0 }, |
7542 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] }, | ||
7543 | { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN, | 7543 | { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN, |
7544 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572A, | 7544 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572A, 0, 0, 0 }, |
7545 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] }, | ||
7546 | { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN, | 7545 | { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN, |
7547 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572B, | 7546 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572B, 0, 0, 0 }, |
7548 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] }, | ||
7549 | { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN, | 7547 | { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN, |
7550 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575C, | 7548 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575C, 0, 0, 0 }, |
7551 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] }, | ||
7552 | { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN, | 7549 | { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN, |
7553 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572A, | 7550 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572A, 0, 0, 0 }, |
7554 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] }, | ||
7555 | { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN, | 7551 | { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN, |
7556 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572B, | 7552 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572B, 0, 0, 0 }, |
7557 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] }, | ||
7558 | { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN, | 7553 | { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN, |
7559 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575C, | 7554 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575C, 0, 0, 0 }, |
7560 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] }, | ||
7561 | { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN_E, | 7555 | { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN_E, |
7562 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_57B7, | 7556 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_57B7, 0, 0, 0 }, |
7563 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[0] }, | ||
7564 | { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_SNIPE, | 7557 | { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_SNIPE, |
7565 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_2780, | 7558 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_2780, 0, 0, 0 }, |
7566 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[1] }, | ||
7567 | { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP, | 7559 | { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP, |
7568 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571E, | 7560 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571E, 0, 0, 0 }, |
7569 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[1] }, | ||
7570 | { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP, | 7561 | { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP, |
7571 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571F, | 7562 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571F, 0, 0, 0 }, |
7572 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[1] }, | ||
7573 | { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP, | 7563 | { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP, |
7574 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572F, | 7564 | PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572F, 0, 0, 0 }, |
7575 | 0, 0, (kernel_ulong_t)&ipr_chip_cfg[1] }, | ||
7576 | { } | 7565 | { } |
7577 | }; | 7566 | }; |
7578 | MODULE_DEVICE_TABLE(pci, ipr_pci_table); | 7567 | MODULE_DEVICE_TABLE(pci, ipr_pci_table); |