Skip to content

Commit c65c945

Browse files
committed
Merge remote-tracking branch 'mkp-scsi/4.9/scsi-fixes' into fixes
2 parents d8188b1 + 23b98e4 commit c65c945

5 files changed

Lines changed: 23 additions & 12 deletions

File tree

drivers/scsi/be2iscsi/be_mgmt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ unsigned int beiscsi_boot_get_sinfo(struct beiscsi_hba *phba)
10831083
nonemb_cmd = &phba->boot_struct.nonemb_cmd;
10841084
nonemb_cmd->size = sizeof(*resp);
10851085
nonemb_cmd->va = pci_alloc_consistent(phba->ctrl.pdev,
1086-
sizeof(nonemb_cmd->size),
1086+
nonemb_cmd->size,
10871087
&nonemb_cmd->dma);
10881088
if (!nonemb_cmd->va) {
10891089
mutex_unlock(&ctrl->mbox_lock);

drivers/scsi/hpsa.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,7 +2009,7 @@ static struct hpsa_scsi_dev_t *lookup_hpsa_scsi_dev(struct ctlr_info *h,
20092009

20102010
static int hpsa_slave_alloc(struct scsi_device *sdev)
20112011
{
2012-
struct hpsa_scsi_dev_t *sd;
2012+
struct hpsa_scsi_dev_t *sd = NULL;
20132013
unsigned long flags;
20142014
struct ctlr_info *h;
20152015

@@ -2026,7 +2026,8 @@ static int hpsa_slave_alloc(struct scsi_device *sdev)
20262026
sd->target = sdev_id(sdev);
20272027
sd->lun = sdev->lun;
20282028
}
2029-
} else
2029+
}
2030+
if (!sd)
20302031
sd = lookup_hpsa_scsi_dev(h, sdev_channel(sdev),
20312032
sdev_id(sdev), sdev->lun);
20322033

@@ -3840,6 +3841,7 @@ static int hpsa_update_device_info(struct ctlr_info *h,
38403841
sizeof(this_device->vendor));
38413842
memcpy(this_device->model, &inq_buff[16],
38423843
sizeof(this_device->model));
3844+
this_device->rev = inq_buff[2];
38433845
memset(this_device->device_id, 0,
38443846
sizeof(this_device->device_id));
38453847
if (hpsa_get_device_id(h, scsi3addr, this_device->device_id, 8,
@@ -3929,10 +3931,14 @@ static void figure_bus_target_lun(struct ctlr_info *h,
39293931

39303932
if (!is_logical_dev_addr_mode(lunaddrbytes)) {
39313933
/* physical device, target and lun filled in later */
3932-
if (is_hba_lunid(lunaddrbytes))
3934+
if (is_hba_lunid(lunaddrbytes)) {
3935+
int bus = HPSA_HBA_BUS;
3936+
3937+
if (!device->rev)
3938+
bus = HPSA_LEGACY_HBA_BUS;
39333939
hpsa_set_bus_target_lun(device,
3934-
HPSA_HBA_BUS, 0, lunid & 0x3fff);
3935-
else
3940+
bus, 0, lunid & 0x3fff);
3941+
} else
39363942
/* defer target, lun assignment for physical devices */
39373943
hpsa_set_bus_target_lun(device,
39383944
HPSA_PHYSICAL_DEVICE_BUS, -1, -1);

drivers/scsi/hpsa.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ struct hpsa_scsi_dev_t {
6969
u64 sas_address;
7070
unsigned char vendor[8]; /* bytes 8-15 of inquiry data */
7171
unsigned char model[16]; /* bytes 16-31 of inquiry data */
72+
unsigned char rev; /* byte 2 of inquiry data */
7273
unsigned char raid_level; /* from inquiry page 0xC1 */
7374
unsigned char volume_offline; /* discovered via TUR or VPD */
7475
u16 queue_depth; /* max queue_depth for this device */
@@ -402,6 +403,7 @@ struct offline_device_entry {
402403
#define HPSA_RAID_VOLUME_BUS 1
403404
#define HPSA_EXTERNAL_RAID_VOLUME_BUS 2
404405
#define HPSA_HBA_BUS 0
406+
#define HPSA_LEGACY_HBA_BUS 3
405407

406408
/*
407409
Send the command to the hardware

drivers/scsi/libfc/fc_lport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ struct fc_host_statistics *fc_get_host_stats(struct Scsi_Host *shost)
308308
fc_stats = &lport->host_stats;
309309
memset(fc_stats, 0, sizeof(struct fc_host_statistics));
310310

311-
fc_stats->seconds_since_last_reset = (lport->boot_time - jiffies) / HZ;
311+
fc_stats->seconds_since_last_reset = (jiffies - lport->boot_time) / HZ;
312312

313313
for_each_possible_cpu(cpu) {
314314
struct fc_stats *stats;

drivers/scsi/mpt3sas/mpt3sas_scsih.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3885,6 +3885,11 @@ _scsih_temp_threshold_events(struct MPT3SAS_ADAPTER *ioc,
38853885
}
38863886
}
38873887

3888+
static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd)
3889+
{
3890+
return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16);
3891+
}
3892+
38883893
/**
38893894
* _scsih_flush_running_cmds - completing outstanding commands.
38903895
* @ioc: per adapter object
@@ -3906,6 +3911,9 @@ _scsih_flush_running_cmds(struct MPT3SAS_ADAPTER *ioc)
39063911
if (!scmd)
39073912
continue;
39083913
count++;
3914+
if (ata_12_16_cmd(scmd))
3915+
scsi_internal_device_unblock(scmd->device,
3916+
SDEV_RUNNING);
39093917
mpt3sas_base_free_smid(ioc, smid);
39103918
scsi_dma_unmap(scmd);
39113919
if (ioc->pci_error_recovery)
@@ -4010,11 +4018,6 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
40104018
SAM_STAT_CHECK_CONDITION;
40114019
}
40124020

4013-
static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd)
4014-
{
4015-
return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16);
4016-
}
4017-
40184021
/**
40194022
* scsih_qcmd - main scsi request entry point
40204023
* @scmd: pointer to scsi command object

0 commit comments

Comments
 (0)