diff options
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r-- | drivers/scsi/hpsa.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 31184b35370f..8545d1826725 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -1708,7 +1708,14 @@ static void complete_scsi_command(struct CommandList *cp) | |||
1708 | 1708 | ||
1709 | cmd->result |= ei->ScsiStatus; | 1709 | cmd->result |= ei->ScsiStatus; |
1710 | 1710 | ||
1711 | /* copy the sense data whether we need to or not. */ | 1711 | scsi_set_resid(cmd, ei->ResidualCnt); |
1712 | if (ei->CommandStatus == 0) { | ||
1713 | cmd_free(h, cp); | ||
1714 | cmd->scsi_done(cmd); | ||
1715 | return; | ||
1716 | } | ||
1717 | |||
1718 | /* copy the sense data */ | ||
1712 | if (SCSI_SENSE_BUFFERSIZE < sizeof(ei->SenseInfo)) | 1719 | if (SCSI_SENSE_BUFFERSIZE < sizeof(ei->SenseInfo)) |
1713 | sense_data_size = SCSI_SENSE_BUFFERSIZE; | 1720 | sense_data_size = SCSI_SENSE_BUFFERSIZE; |
1714 | else | 1721 | else |
@@ -1717,13 +1724,6 @@ static void complete_scsi_command(struct CommandList *cp) | |||
1717 | sense_data_size = ei->SenseLen; | 1724 | sense_data_size = ei->SenseLen; |
1718 | 1725 | ||
1719 | memcpy(cmd->sense_buffer, ei->SenseInfo, sense_data_size); | 1726 | memcpy(cmd->sense_buffer, ei->SenseInfo, sense_data_size); |
1720 | scsi_set_resid(cmd, ei->ResidualCnt); | ||
1721 | |||
1722 | if (ei->CommandStatus == 0) { | ||
1723 | cmd_free(h, cp); | ||
1724 | cmd->scsi_done(cmd); | ||
1725 | return; | ||
1726 | } | ||
1727 | 1727 | ||
1728 | /* For I/O accelerator commands, copy over some fields to the normal | 1728 | /* For I/O accelerator commands, copy over some fields to the normal |
1729 | * CISS header used below for error handling. | 1729 | * CISS header used below for error handling. |
@@ -3686,6 +3686,8 @@ static int hpsa_scsi_ioaccel_raid_map(struct ctlr_info *h, | |||
3686 | (((u64) cmd->cmnd[2]) << 8) | | 3686 | (((u64) cmd->cmnd[2]) << 8) | |
3687 | cmd->cmnd[3]; | 3687 | cmd->cmnd[3]; |
3688 | block_cnt = cmd->cmnd[4]; | 3688 | block_cnt = cmd->cmnd[4]; |
3689 | if (block_cnt == 0) | ||
3690 | block_cnt = 256; | ||
3689 | break; | 3691 | break; |
3690 | case WRITE_10: | 3692 | case WRITE_10: |
3691 | is_write = 1; | 3693 | is_write = 1; |
@@ -3734,7 +3736,6 @@ static int hpsa_scsi_ioaccel_raid_map(struct ctlr_info *h, | |||
3734 | default: | 3736 | default: |
3735 | return IO_ACCEL_INELIGIBLE; /* process via normal I/O path */ | 3737 | return IO_ACCEL_INELIGIBLE; /* process via normal I/O path */ |
3736 | } | 3738 | } |
3737 | BUG_ON(block_cnt == 0); | ||
3738 | last_block = first_block + block_cnt - 1; | 3739 | last_block = first_block + block_cnt - 1; |
3739 | 3740 | ||
3740 | /* check for write to non-RAID-0 */ | 3741 | /* check for write to non-RAID-0 */ |
@@ -4590,7 +4591,7 @@ static int hpsa_eh_abort_handler(struct scsi_cmnd *sc) | |||
4590 | return FAILED; | 4591 | return FAILED; |
4591 | 4592 | ||
4592 | memset(msg, 0, sizeof(msg)); | 4593 | memset(msg, 0, sizeof(msg)); |
4593 | ml += sprintf(msg+ml, "ABORT REQUEST on C%d:B%d:T%d:L%d ", | 4594 | ml += sprintf(msg+ml, "ABORT REQUEST on C%d:B%d:T%d:L%llu ", |
4594 | h->scsi_host->host_no, sc->device->channel, | 4595 | h->scsi_host->host_no, sc->device->channel, |
4595 | sc->device->id, sc->device->lun); | 4596 | sc->device->id, sc->device->lun); |
4596 | 4597 | ||
@@ -5092,7 +5093,7 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp) | |||
5092 | } | 5093 | } |
5093 | if (ioc->Request.Type.Direction & XFER_WRITE) { | 5094 | if (ioc->Request.Type.Direction & XFER_WRITE) { |
5094 | if (copy_from_user(buff[sg_used], data_ptr, sz)) { | 5095 | if (copy_from_user(buff[sg_used], data_ptr, sz)) { |
5095 | status = -ENOMEM; | 5096 | status = -EFAULT; |
5096 | goto cleanup1; | 5097 | goto cleanup1; |
5097 | } | 5098 | } |
5098 | } else | 5099 | } else |
@@ -6365,9 +6366,9 @@ static inline void hpsa_set_driver_support_bits(struct ctlr_info *h) | |||
6365 | { | 6366 | { |
6366 | u32 driver_support; | 6367 | u32 driver_support; |
6367 | 6368 | ||
6368 | #ifdef CONFIG_X86 | ||
6369 | /* Need to enable prefetch in the SCSI core for 6400 in x86 */ | ||
6370 | driver_support = readl(&(h->cfgtable->driver_support)); | 6369 | driver_support = readl(&(h->cfgtable->driver_support)); |
6370 | /* Need to enable prefetch in the SCSI core for 6400 in x86 */ | ||
6371 | #ifdef CONFIG_X86 | ||
6371 | driver_support |= ENABLE_SCSI_PREFETCH; | 6372 | driver_support |= ENABLE_SCSI_PREFETCH; |
6372 | #endif | 6373 | #endif |
6373 | driver_support |= ENABLE_UNIT_ATTN; | 6374 | driver_support |= ENABLE_UNIT_ATTN; |
@@ -6913,8 +6914,12 @@ static int hpsa_offline_devices_ready(struct ctlr_info *h) | |||
6913 | d = list_entry(this, struct offline_device_entry, | 6914 | d = list_entry(this, struct offline_device_entry, |
6914 | offline_list); | 6915 | offline_list); |
6915 | spin_unlock_irqrestore(&h->offline_device_lock, flags); | 6916 | spin_unlock_irqrestore(&h->offline_device_lock, flags); |
6916 | if (!hpsa_volume_offline(h, d->scsi3addr)) | 6917 | if (!hpsa_volume_offline(h, d->scsi3addr)) { |
6918 | spin_lock_irqsave(&h->offline_device_lock, flags); | ||
6919 | list_del(&d->offline_list); | ||
6920 | spin_unlock_irqrestore(&h->offline_device_lock, flags); | ||
6917 | return 1; | 6921 | return 1; |
6922 | } | ||
6918 | spin_lock_irqsave(&h->offline_device_lock, flags); | 6923 | spin_lock_irqsave(&h->offline_device_lock, flags); |
6919 | } | 6924 | } |
6920 | spin_unlock_irqrestore(&h->offline_device_lock, flags); | 6925 | spin_unlock_irqrestore(&h->offline_device_lock, flags); |
@@ -6995,8 +7000,10 @@ reinit_after_soft_reset: | |||
6995 | 7000 | ||
6996 | /* Allocate and clear per-cpu variable lockup_detected */ | 7001 | /* Allocate and clear per-cpu variable lockup_detected */ |
6997 | h->lockup_detected = alloc_percpu(u32); | 7002 | h->lockup_detected = alloc_percpu(u32); |
6998 | if (!h->lockup_detected) | 7003 | if (!h->lockup_detected) { |
7004 | rc = -ENOMEM; | ||
6999 | goto clean1; | 7005 | goto clean1; |
7006 | } | ||
7000 | set_lockup_detected_for_all_cpus(h, 0); | 7007 | set_lockup_detected_for_all_cpus(h, 0); |
7001 | 7008 | ||
7002 | rc = hpsa_pci_init(h); | 7009 | rc = hpsa_pci_init(h); |