|
@@ -1008,6 +1008,8 @@ mptsas_slave_alloc(struct scsi_device *sdev)
|
|
|
static int
|
|
|
mptsas_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
|
|
|
{
|
|
|
+ MPT_SCSI_HOST *hd;
|
|
|
+ MPT_ADAPTER *ioc;
|
|
|
VirtDevice *vdevice = SCpnt->device->hostdata;
|
|
|
|
|
|
if (!vdevice || !vdevice->vtarget || vdevice->vtarget->deleted) {
|
|
@@ -1016,6 +1018,12 @@ mptsas_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+ hd = shost_priv(SCpnt->device->host);
|
|
|
+ ioc = hd->ioc;
|
|
|
+
|
|
|
+ if (ioc->sas_discovery_quiesce_io)
|
|
|
+ return SCSI_MLQUEUE_HOST_BUSY;
|
|
|
+
|
|
|
// scsi_print_command(SCpnt);
|
|
|
|
|
|
return mptscsih_qcmd(SCpnt,done);
|
|
@@ -3009,6 +3017,7 @@ mptsas_send_discovery_event(MPT_ADAPTER *ioc,
|
|
|
EVENT_DATA_SAS_DISCOVERY *discovery_data)
|
|
|
{
|
|
|
struct mptsas_discovery_event *ev;
|
|
|
+ u32 discovery_status;
|
|
|
|
|
|
/*
|
|
|
* DiscoveryStatus
|
|
@@ -3017,7 +3026,9 @@ mptsas_send_discovery_event(MPT_ADAPTER *ioc,
|
|
|
* kicks off discovery, and return to zero
|
|
|
* once its completed.
|
|
|
*/
|
|
|
- if (discovery_data->DiscoveryStatus)
|
|
|
+ discovery_status = le32_to_cpu(discovery_data->DiscoveryStatus);
|
|
|
+ ioc->sas_discovery_quiesce_io = discovery_status ? 1 : 0;
|
|
|
+ if (discovery_status)
|
|
|
return;
|
|
|
|
|
|
ev = kzalloc(sizeof(*ev), GFP_ATOMIC);
|
|
@@ -3299,12 +3310,22 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
|
|
return error;
|
|
|
}
|
|
|
|
|
|
+void
|
|
|
+mptsas_shutdown(struct pci_dev *pdev)
|
|
|
+{
|
|
|
+ MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
|
|
|
+
|
|
|
+ ioc->sas_discovery_quiesce_io = 0;
|
|
|
+}
|
|
|
+
|
|
|
static void __devexit mptsas_remove(struct pci_dev *pdev)
|
|
|
{
|
|
|
MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
|
|
|
struct mptsas_portinfo *p, *n;
|
|
|
int i;
|
|
|
|
|
|
+ mptsas_shutdown(pdev);
|
|
|
+
|
|
|
ioc->sas_discovery_ignore_events = 1;
|
|
|
sas_remove_host(ioc->sh);
|
|
|
|
|
@@ -3342,7 +3363,7 @@ static struct pci_driver mptsas_driver = {
|
|
|
.id_table = mptsas_pci_table,
|
|
|
.probe = mptsas_probe,
|
|
|
.remove = __devexit_p(mptsas_remove),
|
|
|
- .shutdown = mptscsih_shutdown,
|
|
|
+ .shutdown = mptsas_shutdown,
|
|
|
#ifdef CONFIG_PM
|
|
|
.suspend = mptscsih_suspend,
|
|
|
.resume = mptscsih_resume,
|