Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195618
b: refs/heads/master
c: 1469585
h: refs/heads/master
v: v3
  • Loading branch information
Kashyap, Desai authored and James Bottomley committed Apr 11, 2010
1 parent ca7d5ba commit 41b2e6c
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f87146bba523cad0196aa8e80ca9e8243d7a6c0c
refs/heads/master: 1469585309bb52869cbaa449c6d2cd1ce9869cca
49 changes: 40 additions & 9 deletions trunk/drivers/scsi/mpt2sas/mpt2sas_scsih.c
Original file line number Diff line number Diff line change
Expand Up @@ -5505,6 +5505,26 @@ _scsih_task_set_full(struct MPT2SAS_ADAPTER *ioc, struct fw_event_work
}
}

/**
* _scsih_prep_device_scan - initialize parameters prior to device scan
* @ioc: per adapter object
*
* Set the deleted flag prior to device scan. If the device is found during
* the scan, then we clear the deleted flag.
*/
static void
_scsih_prep_device_scan(struct MPT2SAS_ADAPTER *ioc)
{
struct MPT2SAS_DEVICE *sas_device_priv_data;
struct scsi_device *sdev;

shost_for_each_device(sdev, ioc->shost) {
sas_device_priv_data = sdev->hostdata;
if (sas_device_priv_data && sas_device_priv_data->sas_target)
sas_device_priv_data->sas_target->deleted = 1;
}
}

/**
* _scsih_mark_responding_sas_device - mark a sas_devices as responding
* @ioc: per adapter object
Expand Down Expand Up @@ -5532,8 +5552,12 @@ _scsih_mark_responding_sas_device(struct MPT2SAS_ADAPTER *ioc, u64 sas_address,
sas_device->slot == slot && sas_device->starget) {
sas_device->responding = 1;
starget = sas_device->starget;
sas_target_priv_data = starget->hostdata;
sas_target_priv_data->tm_busy = 0;
if (starget && starget->hostdata) {
sas_target_priv_data = starget->hostdata;
sas_target_priv_data->tm_busy = 0;
sas_target_priv_data->deleted = 0;
} else
sas_target_priv_data = NULL;
starget_printk(KERN_INFO, sas_device->starget,
"handle(0x%04x), sas_addr(0x%016llx), enclosure "
"logical id(0x%016llx), slot(%d)\n", handle,
Expand All @@ -5546,7 +5570,8 @@ _scsih_mark_responding_sas_device(struct MPT2SAS_ADAPTER *ioc, u64 sas_address,
printk(KERN_INFO "\thandle changed from(0x%04x)!!!\n",
sas_device->handle);
sas_device->handle = handle;
sas_target_priv_data->handle = handle;
if (sas_target_priv_data)
sas_target_priv_data->handle = handle;
goto out;
}
}
Expand Down Expand Up @@ -5621,6 +5646,12 @@ _scsih_mark_responding_raid_device(struct MPT2SAS_ADAPTER *ioc, u64 wwid,
spin_lock_irqsave(&ioc->raid_device_lock, flags);
list_for_each_entry(raid_device, &ioc->raid_device_list, list) {
if (raid_device->wwid == wwid && raid_device->starget) {
starget = raid_device->starget;
if (starget && starget->hostdata) {
sas_target_priv_data = starget->hostdata;
sas_target_priv_data->deleted = 0;
} else
sas_target_priv_data = NULL;
raid_device->responding = 1;
starget_printk(KERN_INFO, raid_device->starget,
"handle(0x%04x), wwid(0x%016llx)\n", handle,
Expand All @@ -5630,9 +5661,8 @@ _scsih_mark_responding_raid_device(struct MPT2SAS_ADAPTER *ioc, u64 wwid,
printk(KERN_INFO "\thandle changed from(0x%04x)!!!\n",
raid_device->handle);
raid_device->handle = handle;
starget = raid_device->starget;
sas_target_priv_data = starget->hostdata;
sas_target_priv_data->handle = handle;
if (sas_target_priv_data)
sas_target_priv_data->handle = handle;
goto out;
}
}
Expand Down Expand Up @@ -5857,6 +5887,10 @@ mpt2sas_scsih_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase)
dtmprintk(ioc, printk(MPT2SAS_DEBUG_FMT "%s: "
"MPT2_IOC_DONE_RESET\n", ioc->name, __func__));
_scsih_sas_host_refresh(ioc);
_scsih_prep_device_scan(ioc);
_scsih_search_responding_sas_devices(ioc);
_scsih_search_responding_raid_devices(ioc);
_scsih_search_responding_expanders(ioc);
break;
}
}
Expand Down Expand Up @@ -5894,9 +5928,6 @@ _firmware_event_work(struct work_struct *work)
} else
spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock,
flags);
_scsih_search_responding_sas_devices(ioc);
_scsih_search_responding_raid_devices(ioc);
_scsih_search_responding_expanders(ioc);
_scsih_remove_unresponding_sas_devices(ioc);
return;
}
Expand Down

0 comments on commit 41b2e6c

Please sign in to comment.