~ubuntu-branches/ubuntu/karmic/linux-mvl-dove/karmic-proposed

« back to all changes in this revision

Viewing changes to drivers/scsi/mpt2sas/mpt2sas_base.c

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Bader
  • Date: 2010-03-10 22:24:12 UTC
  • mto: (15.1.2 karmic-security)
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20100310222412-k86m3r53jw0je7x1
Tags: upstream-2.6.31
ImportĀ upstreamĀ versionĀ 2.6.31

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
        int rc;
95
95
 
96
96
        spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags);
97
 
        if (ioc->shost_recovery)
 
97
        if (ioc->ioc_reset_in_progress)
98
98
                goto rearm_timer;
99
99
        spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
100
100
 
101
101
        doorbell = mpt2sas_base_get_iocstate(ioc, 0);
102
102
        if ((doorbell & MPI2_IOC_STATE_MASK) == MPI2_IOC_STATE_FAULT) {
103
103
                rc = mpt2sas_base_hard_reset_handler(ioc, CAN_SLEEP,
104
 
                    MPT2SAS_FORCE_BIG_HAMMER);
 
104
                    FORCE_BIG_HAMMER);
105
105
                printk(MPT2SAS_WARN_FMT "%s: hard reset: %s\n", ioc->name,
106
106
                    __func__, (rc == 0) ? "success" : "failed");
107
107
                doorbell = mpt2sas_base_get_iocstate(ioc, 0);
1542
1542
           (ioc->bios_pg3.BiosVersion & 0x0000FF00) >> 8,
1543
1543
            ioc->bios_pg3.BiosVersion & 0x000000FF);
1544
1544
 
1545
 
        _base_display_dell_branding(ioc);
1546
 
 
1547
1545
        printk(MPT2SAS_INFO_FMT "Protocol=(", ioc->name);
1548
1546
 
1549
1547
        if (ioc->facts.ProtocolFlags & MPI2_IOCFACTS_PROTOCOL_SCSI_INITIATOR) {
1556
1554
                i++;
1557
1555
        }
1558
1556
 
 
1557
        _base_display_dell_branding(ioc);
 
1558
 
1559
1559
        i = 0;
1560
1560
        printk("), ");
1561
1561
        printk("Capabilities=(");
1627
1627
        u32 iounit_pg1_flags;
1628
1628
 
1629
1629
        mpt2sas_config_get_manufacturing_pg0(ioc, &mpi_reply, &ioc->manu_pg0);
1630
 
        if (ioc->ir_firmware)
1631
 
                mpt2sas_config_get_manufacturing_pg10(ioc, &mpi_reply,
1632
 
                    &ioc->manu_pg10);
1633
1630
        mpt2sas_config_get_bios_pg2(ioc, &mpi_reply, &ioc->bios_pg2);
1634
1631
        mpt2sas_config_get_bios_pg3(ioc, &mpi_reply, &ioc->bios_pg3);
1635
1632
        mpt2sas_config_get_ioc_pg8(ioc, &mpi_reply, &ioc->ioc_pg8);
2487
2484
 issue_host_reset:
2488
2485
        if (issue_reset)
2489
2486
                mpt2sas_base_hard_reset_handler(ioc, CAN_SLEEP,
2490
 
                    MPT2SAS_FORCE_BIG_HAMMER);
 
2487
                    FORCE_BIG_HAMMER);
2491
2488
        ioc->base_cmds.status = MPT2_CMD_NOT_USED;
2492
2489
        rc = -EFAULT;
2493
2490
 out:
2584
2581
 issue_host_reset:
2585
2582
        if (issue_reset)
2586
2583
                mpt2sas_base_hard_reset_handler(ioc, CAN_SLEEP,
2587
 
                    MPT2SAS_FORCE_BIG_HAMMER);
 
2584
                    FORCE_BIG_HAMMER);
2588
2585
        ioc->base_cmds.status = MPT2_CMD_NOT_USED;
2589
2586
        rc = -EFAULT;
2590
2587
 out:
3119
3116
 * _base_make_ioc_ready - put controller in READY state
3120
3117
 * @ioc: per adapter object
3121
3118
 * @sleep_flag: CAN_SLEEP or NO_SLEEP
3122
 
 * @type: MPT2SAS_FORCE_BIG_HAMMER or MPT2SAS_SOFT_RESET
 
3119
 * @type: FORCE_BIG_HAMMER or SOFT_RESET
3123
3120
 *
3124
3121
 * Returns 0 for success, non-zero for failure.
3125
3122
 */
3151
3148
                goto issue_diag_reset;
3152
3149
        }
3153
3150
 
3154
 
        if (type == MPT2SAS_FORCE_BIG_HAMMER)
 
3151
        if (type == FORCE_BIG_HAMMER)
3155
3152
                goto issue_diag_reset;
3156
3153
 
3157
3154
        if ((ioc_state & MPI2_IOC_STATE_MASK) == MPI2_IOC_STATE_OPERATIONAL)
3242
3239
            __func__));
3243
3240
 
3244
3241
        _base_mask_interrupts(ioc);
3245
 
        _base_make_ioc_ready(ioc, CAN_SLEEP, MPT2SAS_SOFT_RESET);
 
3242
        _base_make_ioc_ready(ioc, CAN_SLEEP, SOFT_RESET);
3246
3243
        if (ioc->pci_irq) {
3247
3244
                synchronize_irq(pdev->irq);
3248
3245
                free_irq(ioc->pci_irq, ioc);
3489
3486
 * mpt2sas_base_hard_reset_handler - reset controller
3490
3487
 * @ioc: Pointer to MPT_ADAPTER structure
3491
3488
 * @sleep_flag: CAN_SLEEP or NO_SLEEP
3492
 
 * @type: MPT2SAS_FORCE_BIG_HAMMER or MPT2SAS_SOFT_RESET
 
3489
 * @type: FORCE_BIG_HAMMER or SOFT_RESET
3493
3490
 *
3494
3491
 * Returns 0 for success, non-zero for failure.
3495
3492
 */
3504
3501
            __func__));
3505
3502
 
3506
3503
        spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags);
3507
 
        if (ioc->shost_recovery) {
 
3504
        if (ioc->ioc_reset_in_progress) {
3508
3505
                spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
3509
3506
                printk(MPT2SAS_ERR_FMT "%s: busy\n",
3510
3507
                    ioc->name, __func__);
3511
3508
                return -EBUSY;
3512
3509
        }
 
3510
        ioc->ioc_reset_in_progress = 1;
3513
3511
        ioc->shost_recovery = 1;
 
3512
        if (ioc->shost->shost_state == SHOST_RUNNING) {
 
3513
                /* set back to SHOST_RUNNING in mpt2sas_scsih.c */
 
3514
                scsi_host_set_state(ioc->shost, SHOST_RECOVERY);
 
3515
                printk(MPT2SAS_INFO_FMT "putting controller into "
 
3516
                    "SHOST_RECOVERY\n", ioc->name);
 
3517
        }
3514
3518
        spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
3515
3519
 
3516
3520
        _base_reset_handler(ioc, MPT2_IOC_PRE_RESET);
3530
3534
            ioc->name, __func__, ((r == 0) ? "SUCCESS" : "FAILED")));
3531
3535
 
3532
3536
        spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags);
3533
 
        ioc->shost_recovery = 0;
 
3537
        ioc->ioc_reset_in_progress = 0;
3534
3538
        spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
3535
 
 
3536
 
        if (!r)
3537
 
                _base_reset_handler(ioc, MPT2_IOC_RUNNING);
3538
3539
        return r;
3539
3540
}